1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -march=amdgcn -mcpu=gfx900 -show-mc-encoding < %s | FileCheck -check-prefixes=GFX9 %s
3; RUN: llc -march=amdgcn -mcpu=gfx1010 -show-mc-encoding < %s | FileCheck -check-prefixes=GFX10 %s
4; RUN: llc -march=amdgcn -mcpu=gfx1100 -show-mc-encoding < %s | FileCheck -check-prefixes=GFX11 %s
5
6define amdgpu_ps <4 x float> @load_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
7; GFX9-LABEL: load_1d:
8; GFX9:       ; %bb.0: ; %main_body
9; GFX9-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x00,0xf0,0x00,0x00,0x00,0x00]
10; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
11; GFX9-NEXT:    ; return to shader part epilog
12;
13; GFX10-LABEL: load_1d:
14; GFX10:       ; %bb.0: ; %main_body
15; GFX10-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x1f,0x00,0xf0,0x00,0x00,0x00,0x40]
16; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
17; GFX10-NEXT:    ; return to shader part epilog
18;
19; GFX11-LABEL: load_1d:
20; GFX11:       ; %bb.0: ; %main_body
21; GFX11-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x0f,0x01,0xf0,0x00,0x00,0x00,0x00]
22; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
23; GFX11-NEXT:    ; return to shader part epilog
24main_body:
25  %s = extractelement <2 x i16> %coords, i32 0
26  %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
27  ret <4 x float> %v
28}
29
30define amdgpu_ps <4 x float> @load_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
31; GFX9-LABEL: load_2d:
32; GFX9:       ; %bb.0: ; %main_body
33; GFX9-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x00,0xf0,0x00,0x00,0x00,0x00]
34; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
35; GFX9-NEXT:    ; return to shader part epilog
36;
37; GFX10-LABEL: load_2d:
38; GFX10:       ; %bb.0: ; %main_body
39; GFX10-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x08,0x1f,0x00,0xf0,0x00,0x00,0x00,0x40]
40; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
41; GFX10-NEXT:    ; return to shader part epilog
42;
43; GFX11-LABEL: load_2d:
44; GFX11:       ; %bb.0: ; %main_body
45; GFX11-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x84,0x0f,0x01,0xf0,0x00,0x00,0x00,0x00]
46; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
47; GFX11-NEXT:    ; return to shader part epilog
48main_body:
49  %s = extractelement <2 x i16> %coords, i32 0
50  %t = extractelement <2 x i16> %coords, i32 1
51  %v = call <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i16(i32 15, i16 %s, i16 %t, <8 x i32> %rsrc, i32 0, i32 0)
52  ret <4 x float> %v
53}
54
55define amdgpu_ps <4 x float> @load_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
56; GFX9-LABEL: load_3d:
57; GFX9:       ; %bb.0: ; %main_body
58; GFX9-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x00,0xf0,0x00,0x00,0x00,0x00]
59; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
60; GFX9-NEXT:    ; return to shader part epilog
61;
62; GFX10-LABEL: load_3d:
63; GFX10:       ; %bb.0: ; %main_body
64; GFX10-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x10,0x1f,0x00,0xf0,0x00,0x00,0x00,0x40]
65; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
66; GFX10-NEXT:    ; return to shader part epilog
67;
68; GFX11-LABEL: load_3d:
69; GFX11:       ; %bb.0: ; %main_body
70; GFX11-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x88,0x0f,0x01,0xf0,0x00,0x00,0x00,0x00]
71; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
72; GFX11-NEXT:    ; return to shader part epilog
73main_body:
74  %s = extractelement <2 x i16> %coords_lo, i32 0
75  %t = extractelement <2 x i16> %coords_lo, i32 1
76  %r = extractelement <2 x i16> %coords_hi, i32 0
77  %v = call <4 x float> @llvm.amdgcn.image.load.3d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %r, <8 x i32> %rsrc, i32 0, i32 0)
78  ret <4 x float> %v
79}
80
81define amdgpu_ps <4 x float> @load_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
82; GFX9-LABEL: load_cube:
83; GFX9:       ; %bb.0: ; %main_body
84; GFX9-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x00,0xf0,0x00,0x00,0x00,0x00]
85; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
86; GFX9-NEXT:    ; return to shader part epilog
87;
88; GFX10-LABEL: load_cube:
89; GFX10:       ; %bb.0: ; %main_body
90; GFX10-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x18,0x1f,0x00,0xf0,0x00,0x00,0x00,0x40]
91; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
92; GFX10-NEXT:    ; return to shader part epilog
93;
94; GFX11-LABEL: load_cube:
95; GFX11:       ; %bb.0: ; %main_body
96; GFX11-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x8c,0x0f,0x01,0xf0,0x00,0x00,0x00,0x00]
97; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
98; GFX11-NEXT:    ; return to shader part epilog
99main_body:
100  %s = extractelement <2 x i16> %coords_lo, i32 0
101  %t = extractelement <2 x i16> %coords_lo, i32 1
102  %slice = extractelement <2 x i16> %coords_hi, i32 0
103  %v = call <4 x float> @llvm.amdgcn.image.load.cube.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
104  ret <4 x float> %v
105}
106
107define amdgpu_ps <4 x float> @load_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
108; GFX9-LABEL: load_1darray:
109; GFX9:       ; %bb.0: ; %main_body
110; GFX9-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x00,0xf0,0x00,0x00,0x00,0x00]
111; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
112; GFX9-NEXT:    ; return to shader part epilog
113;
114; GFX10-LABEL: load_1darray:
115; GFX10:       ; %bb.0: ; %main_body
116; GFX10-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x20,0x1f,0x00,0xf0,0x00,0x00,0x00,0x40]
117; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
118; GFX10-NEXT:    ; return to shader part epilog
119;
120; GFX11-LABEL: load_1darray:
121; GFX11:       ; %bb.0: ; %main_body
122; GFX11-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x90,0x0f,0x01,0xf0,0x00,0x00,0x00,0x00]
123; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
124; GFX11-NEXT:    ; return to shader part epilog
125main_body:
126  %s = extractelement <2 x i16> %coords, i32 0
127  %slice = extractelement <2 x i16> %coords, i32 1
128  %v = call <4 x float> @llvm.amdgcn.image.load.1darray.v4f32.i16(i32 15, i16 %s, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
129  ret <4 x float> %v
130}
131
132define amdgpu_ps <4 x float> @load_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
133; GFX9-LABEL: load_2darray:
134; GFX9:       ; %bb.0: ; %main_body
135; GFX9-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x00,0xf0,0x00,0x00,0x00,0x00]
136; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
137; GFX9-NEXT:    ; return to shader part epilog
138;
139; GFX10-LABEL: load_2darray:
140; GFX10:       ; %bb.0: ; %main_body
141; GFX10-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x28,0x1f,0x00,0xf0,0x00,0x00,0x00,0x40]
142; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
143; GFX10-NEXT:    ; return to shader part epilog
144;
145; GFX11-LABEL: load_2darray:
146; GFX11:       ; %bb.0: ; %main_body
147; GFX11-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x94,0x0f,0x01,0xf0,0x00,0x00,0x00,0x00]
148; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
149; GFX11-NEXT:    ; return to shader part epilog
150main_body:
151  %s = extractelement <2 x i16> %coords_lo, i32 0
152  %t = extractelement <2 x i16> %coords_lo, i32 1
153  %slice = extractelement <2 x i16> %coords_hi, i32 0
154  %v = call <4 x float> @llvm.amdgcn.image.load.2darray.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
155  ret <4 x float> %v
156}
157
158define amdgpu_ps <4 x float> @load_2dmsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
159; GFX9-LABEL: load_2dmsaa:
160; GFX9:       ; %bb.0: ; %main_body
161; GFX9-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x00,0xf0,0x00,0x00,0x00,0x00]
162; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
163; GFX9-NEXT:    ; return to shader part epilog
164;
165; GFX10-LABEL: load_2dmsaa:
166; GFX10:       ; %bb.0: ; %main_body
167; GFX10-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm a16 ; encoding: [0x30,0x1f,0x00,0xf0,0x00,0x00,0x00,0x40]
168; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
169; GFX10-NEXT:    ; return to shader part epilog
170;
171; GFX11-LABEL: load_2dmsaa:
172; GFX11:       ; %bb.0: ; %main_body
173; GFX11-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm a16 ; encoding: [0x98,0x0f,0x01,0xf0,0x00,0x00,0x00,0x00]
174; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
175; GFX11-NEXT:    ; return to shader part epilog
176main_body:
177  %s = extractelement <2 x i16> %coords_lo, i32 0
178  %t = extractelement <2 x i16> %coords_lo, i32 1
179  %fragid = extractelement <2 x i16> %coords_hi, i32 0
180  %v = call <4 x float> @llvm.amdgcn.image.load.2dmsaa.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
181  ret <4 x float> %v
182}
183
184define amdgpu_ps <4 x float> @load_2darraymsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
185; GFX9-LABEL: load_2darraymsaa:
186; GFX9:       ; %bb.0: ; %main_body
187; GFX9-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x00,0xf0,0x00,0x00,0x00,0x00]
188; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
189; GFX9-NEXT:    ; return to shader part epilog
190;
191; GFX10-LABEL: load_2darraymsaa:
192; GFX10:       ; %bb.0: ; %main_body
193; GFX10-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm a16 ; encoding: [0x38,0x1f,0x00,0xf0,0x00,0x00,0x00,0x40]
194; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
195; GFX10-NEXT:    ; return to shader part epilog
196;
197; GFX11-LABEL: load_2darraymsaa:
198; GFX11:       ; %bb.0: ; %main_body
199; GFX11-NEXT:    image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm a16 ; encoding: [0x9c,0x0f,0x01,0xf0,0x00,0x00,0x00,0x00]
200; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
201; GFX11-NEXT:    ; return to shader part epilog
202main_body:
203  %s = extractelement <2 x i16> %coords_lo, i32 0
204  %t = extractelement <2 x i16> %coords_lo, i32 1
205  %slice = extractelement <2 x i16> %coords_hi, i32 0
206  %fragid = extractelement <2 x i16> %coords_hi, i32 1
207  %v = call <4 x float> @llvm.amdgcn.image.load.2darraymsaa.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
208  ret <4 x float> %v
209}
210
211define amdgpu_ps <4 x float> @load_mip_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
212; GFX9-LABEL: load_mip_1d:
213; GFX9:       ; %bb.0: ; %main_body
214; GFX9-NEXT:    image_load_mip v[0:3], v0, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x04,0xf0,0x00,0x00,0x00,0x00]
215; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
216; GFX9-NEXT:    ; return to shader part epilog
217;
218; GFX10-LABEL: load_mip_1d:
219; GFX10:       ; %bb.0: ; %main_body
220; GFX10-NEXT:    image_load_mip v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x1f,0x04,0xf0,0x00,0x00,0x00,0x40]
221; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
222; GFX10-NEXT:    ; return to shader part epilog
223;
224; GFX11-LABEL: load_mip_1d:
225; GFX11:       ; %bb.0: ; %main_body
226; GFX11-NEXT:    image_load_mip v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x0f,0x05,0xf0,0x00,0x00,0x00,0x00]
227; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
228; GFX11-NEXT:    ; return to shader part epilog
229main_body:
230  %s = extractelement <2 x i16> %coords, i32 0
231  %mip = extractelement <2 x i16> %coords, i32 1
232  %v = call <4 x float> @llvm.amdgcn.image.load.mip.1d.v4f32.i16(i32 15, i16 %s, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
233  ret <4 x float> %v
234}
235
236define amdgpu_ps <4 x float> @load_mip_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
237; GFX9-LABEL: load_mip_2d:
238; GFX9:       ; %bb.0: ; %main_body
239; GFX9-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x04,0xf0,0x00,0x00,0x00,0x00]
240; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
241; GFX9-NEXT:    ; return to shader part epilog
242;
243; GFX10-LABEL: load_mip_2d:
244; GFX10:       ; %bb.0: ; %main_body
245; GFX10-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x08,0x1f,0x04,0xf0,0x00,0x00,0x00,0x40]
246; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
247; GFX10-NEXT:    ; return to shader part epilog
248;
249; GFX11-LABEL: load_mip_2d:
250; GFX11:       ; %bb.0: ; %main_body
251; GFX11-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x84,0x0f,0x05,0xf0,0x00,0x00,0x00,0x00]
252; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
253; GFX11-NEXT:    ; return to shader part epilog
254main_body:
255  %s = extractelement <2 x i16> %coords_lo, i32 0
256  %t = extractelement <2 x i16> %coords_lo, i32 1
257  %mip = extractelement <2 x i16> %coords_hi, i32 0
258  %v = call <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
259  ret <4 x float> %v
260}
261
262define amdgpu_ps <4 x float> @load_mip_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
263; GFX9-LABEL: load_mip_3d:
264; GFX9:       ; %bb.0: ; %main_body
265; GFX9-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x04,0xf0,0x00,0x00,0x00,0x00]
266; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
267; GFX9-NEXT:    ; return to shader part epilog
268;
269; GFX10-LABEL: load_mip_3d:
270; GFX10:       ; %bb.0: ; %main_body
271; GFX10-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x10,0x1f,0x04,0xf0,0x00,0x00,0x00,0x40]
272; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
273; GFX10-NEXT:    ; return to shader part epilog
274;
275; GFX11-LABEL: load_mip_3d:
276; GFX11:       ; %bb.0: ; %main_body
277; GFX11-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x88,0x0f,0x05,0xf0,0x00,0x00,0x00,0x00]
278; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
279; GFX11-NEXT:    ; return to shader part epilog
280main_body:
281  %s = extractelement <2 x i16> %coords_lo, i32 0
282  %t = extractelement <2 x i16> %coords_lo, i32 1
283  %r = extractelement <2 x i16> %coords_hi, i32 0
284  %mip = extractelement <2 x i16> %coords_hi, i32 1
285  %v = call <4 x float> @llvm.amdgcn.image.load.mip.3d.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %r, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
286  ret <4 x float> %v
287}
288
289define amdgpu_ps <4 x float> @load_mip_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
290; GFX9-LABEL: load_mip_cube:
291; GFX9:       ; %bb.0: ; %main_body
292; GFX9-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x04,0xf0,0x00,0x00,0x00,0x00]
293; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
294; GFX9-NEXT:    ; return to shader part epilog
295;
296; GFX10-LABEL: load_mip_cube:
297; GFX10:       ; %bb.0: ; %main_body
298; GFX10-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x18,0x1f,0x04,0xf0,0x00,0x00,0x00,0x40]
299; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
300; GFX10-NEXT:    ; return to shader part epilog
301;
302; GFX11-LABEL: load_mip_cube:
303; GFX11:       ; %bb.0: ; %main_body
304; GFX11-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x8c,0x0f,0x05,0xf0,0x00,0x00,0x00,0x00]
305; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
306; GFX11-NEXT:    ; return to shader part epilog
307main_body:
308  %s = extractelement <2 x i16> %coords_lo, i32 0
309  %t = extractelement <2 x i16> %coords_lo, i32 1
310  %slice = extractelement <2 x i16> %coords_hi, i32 0
311  %mip = extractelement <2 x i16> %coords_hi, i32 1
312  %v = call <4 x float> @llvm.amdgcn.image.load.mip.cube.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
313  ret <4 x float> %v
314}
315
316define amdgpu_ps <4 x float> @load_mip_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
317; GFX9-LABEL: load_mip_1darray:
318; GFX9:       ; %bb.0: ; %main_body
319; GFX9-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x04,0xf0,0x00,0x00,0x00,0x00]
320; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
321; GFX9-NEXT:    ; return to shader part epilog
322;
323; GFX10-LABEL: load_mip_1darray:
324; GFX10:       ; %bb.0: ; %main_body
325; GFX10-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x20,0x1f,0x04,0xf0,0x00,0x00,0x00,0x40]
326; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
327; GFX10-NEXT:    ; return to shader part epilog
328;
329; GFX11-LABEL: load_mip_1darray:
330; GFX11:       ; %bb.0: ; %main_body
331; GFX11-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x90,0x0f,0x05,0xf0,0x00,0x00,0x00,0x00]
332; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
333; GFX11-NEXT:    ; return to shader part epilog
334main_body:
335  %s = extractelement <2 x i16> %coords_lo, i32 0
336  %slice = extractelement <2 x i16> %coords_lo, i32 1
337  %mip = extractelement <2 x i16> %coords_hi, i32 0
338  %v = call <4 x float> @llvm.amdgcn.image.load.mip.1darray.v4f32.i16(i32 15, i16 %s, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
339  ret <4 x float> %v
340}
341
342define amdgpu_ps <4 x float> @load_mip_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
343; GFX9-LABEL: load_mip_2darray:
344; GFX9:       ; %bb.0: ; %main_body
345; GFX9-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x04,0xf0,0x00,0x00,0x00,0x00]
346; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
347; GFX9-NEXT:    ; return to shader part epilog
348;
349; GFX10-LABEL: load_mip_2darray:
350; GFX10:       ; %bb.0: ; %main_body
351; GFX10-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x28,0x1f,0x04,0xf0,0x00,0x00,0x00,0x40]
352; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
353; GFX10-NEXT:    ; return to shader part epilog
354;
355; GFX11-LABEL: load_mip_2darray:
356; GFX11:       ; %bb.0: ; %main_body
357; GFX11-NEXT:    image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x94,0x0f,0x05,0xf0,0x00,0x00,0x00,0x00]
358; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
359; GFX11-NEXT:    ; return to shader part epilog
360main_body:
361  %s = extractelement <2 x i16> %coords_lo, i32 0
362  %t = extractelement <2 x i16> %coords_lo, i32 1
363  %slice = extractelement <2 x i16> %coords_hi, i32 0
364  %mip = extractelement <2 x i16> %coords_hi, i32 1
365  %v = call <4 x float> @llvm.amdgcn.image.load.mip.2darray.v4f32.i16(i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
366  ret <4 x float> %v
367}
368
369define amdgpu_ps void @store_1d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
370; GFX9-LABEL: store_1d:
371; GFX9:       ; %bb.0: ; %main_body
372; GFX9-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x20,0xf0,0x04,0x00,0x00,0x00]
373; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
374;
375; GFX10-LABEL: store_1d:
376; GFX10:       ; %bb.0: ; %main_body
377; GFX10-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x1f,0x20,0xf0,0x04,0x00,0x00,0x40]
378; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
379;
380; GFX11-LABEL: store_1d:
381; GFX11:       ; %bb.0: ; %main_body
382; GFX11-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x0f,0x19,0xf0,0x04,0x00,0x00,0x00]
383; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
384; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
385main_body:
386  %s = extractelement <2 x i16> %coords, i32 0
387  call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
388  ret void
389}
390
391define amdgpu_ps void @store_2d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
392; GFX9-LABEL: store_2d:
393; GFX9:       ; %bb.0: ; %main_body
394; GFX9-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x20,0xf0,0x04,0x00,0x00,0x00]
395; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
396;
397; GFX10-LABEL: store_2d:
398; GFX10:       ; %bb.0: ; %main_body
399; GFX10-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x08,0x1f,0x20,0xf0,0x04,0x00,0x00,0x40]
400; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
401;
402; GFX11-LABEL: store_2d:
403; GFX11:       ; %bb.0: ; %main_body
404; GFX11-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x84,0x0f,0x19,0xf0,0x04,0x00,0x00,0x00]
405; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
406; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
407main_body:
408  %s = extractelement <2 x i16> %coords, i32 0
409  %t = extractelement <2 x i16> %coords, i32 1
410  call void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, <8 x i32> %rsrc, i32 0, i32 0)
411  ret void
412}
413
414define amdgpu_ps void @store_3d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
415; GFX9-LABEL: store_3d:
416; GFX9:       ; %bb.0: ; %main_body
417; GFX9-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x20,0xf0,0x04,0x00,0x00,0x00]
418; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
419;
420; GFX10-LABEL: store_3d:
421; GFX10:       ; %bb.0: ; %main_body
422; GFX10-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x10,0x1f,0x20,0xf0,0x04,0x00,0x00,0x40]
423; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
424;
425; GFX11-LABEL: store_3d:
426; GFX11:       ; %bb.0: ; %main_body
427; GFX11-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x88,0x0f,0x19,0xf0,0x04,0x00,0x00,0x00]
428; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
429; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
430main_body:
431  %s = extractelement <2 x i16> %coords_lo, i32 0
432  %t = extractelement <2 x i16> %coords_lo, i32 1
433  %r = extractelement <2 x i16> %coords_hi, i32 0
434  call void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %r, <8 x i32> %rsrc, i32 0, i32 0)
435  ret void
436}
437
438define amdgpu_ps void @store_cube(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
439; GFX9-LABEL: store_cube:
440; GFX9:       ; %bb.0: ; %main_body
441; GFX9-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x20,0xf0,0x04,0x00,0x00,0x00]
442; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
443;
444; GFX10-LABEL: store_cube:
445; GFX10:       ; %bb.0: ; %main_body
446; GFX10-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x18,0x1f,0x20,0xf0,0x04,0x00,0x00,0x40]
447; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
448;
449; GFX11-LABEL: store_cube:
450; GFX11:       ; %bb.0: ; %main_body
451; GFX11-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x8c,0x0f,0x19,0xf0,0x04,0x00,0x00,0x00]
452; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
453; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
454main_body:
455  %s = extractelement <2 x i16> %coords_lo, i32 0
456  %t = extractelement <2 x i16> %coords_lo, i32 1
457  %slice = extractelement <2 x i16> %coords_hi, i32 0
458  call void @llvm.amdgcn.image.store.cube.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
459  ret void
460}
461
462define amdgpu_ps void @store_1darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
463; GFX9-LABEL: store_1darray:
464; GFX9:       ; %bb.0: ; %main_body
465; GFX9-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x20,0xf0,0x04,0x00,0x00,0x00]
466; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
467;
468; GFX10-LABEL: store_1darray:
469; GFX10:       ; %bb.0: ; %main_body
470; GFX10-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x20,0x1f,0x20,0xf0,0x04,0x00,0x00,0x40]
471; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
472;
473; GFX11-LABEL: store_1darray:
474; GFX11:       ; %bb.0: ; %main_body
475; GFX11-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x90,0x0f,0x19,0xf0,0x04,0x00,0x00,0x00]
476; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
477; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
478main_body:
479  %s = extractelement <2 x i16> %coords, i32 0
480  %slice = extractelement <2 x i16> %coords, i32 1
481  call void @llvm.amdgcn.image.store.1darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
482  ret void
483}
484
485define amdgpu_ps void @store_2darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
486; GFX9-LABEL: store_2darray:
487; GFX9:       ; %bb.0: ; %main_body
488; GFX9-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x20,0xf0,0x04,0x00,0x00,0x00]
489; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
490;
491; GFX10-LABEL: store_2darray:
492; GFX10:       ; %bb.0: ; %main_body
493; GFX10-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x28,0x1f,0x20,0xf0,0x04,0x00,0x00,0x40]
494; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
495;
496; GFX11-LABEL: store_2darray:
497; GFX11:       ; %bb.0: ; %main_body
498; GFX11-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x94,0x0f,0x19,0xf0,0x04,0x00,0x00,0x00]
499; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
500; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
501main_body:
502  %s = extractelement <2 x i16> %coords_lo, i32 0
503  %t = extractelement <2 x i16> %coords_lo, i32 1
504  %slice = extractelement <2 x i16> %coords_hi, i32 0
505  call void @llvm.amdgcn.image.store.2darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
506  ret void
507}
508
509define amdgpu_ps void @store_2dmsaa(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
510; GFX9-LABEL: store_2dmsaa:
511; GFX9:       ; %bb.0: ; %main_body
512; GFX9-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x20,0xf0,0x04,0x00,0x00,0x00]
513; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
514;
515; GFX10-LABEL: store_2dmsaa:
516; GFX10:       ; %bb.0: ; %main_body
517; GFX10-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm a16 ; encoding: [0x30,0x1f,0x20,0xf0,0x04,0x00,0x00,0x40]
518; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
519;
520; GFX11-LABEL: store_2dmsaa:
521; GFX11:       ; %bb.0: ; %main_body
522; GFX11-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm a16 ; encoding: [0x98,0x0f,0x19,0xf0,0x04,0x00,0x00,0x00]
523; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
524; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
525main_body:
526  %s = extractelement <2 x i16> %coords_lo, i32 0
527  %t = extractelement <2 x i16> %coords_lo, i32 1
528  %fragid = extractelement <2 x i16> %coords_hi, i32 0
529  call void @llvm.amdgcn.image.store.2dmsaa.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
530  ret void
531}
532
533define amdgpu_ps void @store_2darraymsaa(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
534; GFX9-LABEL: store_2darraymsaa:
535; GFX9:       ; %bb.0: ; %main_body
536; GFX9-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x20,0xf0,0x04,0x00,0x00,0x00]
537; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
538;
539; GFX10-LABEL: store_2darraymsaa:
540; GFX10:       ; %bb.0: ; %main_body
541; GFX10-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm a16 ; encoding: [0x38,0x1f,0x20,0xf0,0x04,0x00,0x00,0x40]
542; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
543;
544; GFX11-LABEL: store_2darraymsaa:
545; GFX11:       ; %bb.0: ; %main_body
546; GFX11-NEXT:    image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm a16 ; encoding: [0x9c,0x0f,0x19,0xf0,0x04,0x00,0x00,0x00]
547; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
548; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
549main_body:
550  %s = extractelement <2 x i16> %coords_lo, i32 0
551  %t = extractelement <2 x i16> %coords_lo, i32 1
552  %slice = extractelement <2 x i16> %coords_hi, i32 0
553  %fragid = extractelement <2 x i16> %coords_hi, i32 1
554  call void @llvm.amdgcn.image.store.2darraymsaa.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
555  ret void
556}
557
558define amdgpu_ps void @store_mip_1d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
559; GFX9-LABEL: store_mip_1d:
560; GFX9:       ; %bb.0: ; %main_body
561; GFX9-NEXT:    image_store_mip v[0:3], v4, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x24,0xf0,0x04,0x00,0x00,0x00]
562; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
563;
564; GFX10-LABEL: store_mip_1d:
565; GFX10:       ; %bb.0: ; %main_body
566; GFX10-NEXT:    image_store_mip v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x1f,0x24,0xf0,0x04,0x00,0x00,0x40]
567; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
568;
569; GFX11-LABEL: store_mip_1d:
570; GFX11:       ; %bb.0: ; %main_body
571; GFX11-NEXT:    image_store_mip v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x0f,0x1d,0xf0,0x04,0x00,0x00,0x00]
572; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
573; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
574main_body:
575  %s = extractelement <2 x i16> %coords, i32 0
576  %mip = extractelement <2 x i16> %coords, i32 1
577  call void @llvm.amdgcn.image.store.mip.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
578  ret void
579}
580
581define amdgpu_ps void @store_mip_2d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
582; GFX9-LABEL: store_mip_2d:
583; GFX9:       ; %bb.0: ; %main_body
584; GFX9-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x24,0xf0,0x04,0x00,0x00,0x00]
585; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
586;
587; GFX10-LABEL: store_mip_2d:
588; GFX10:       ; %bb.0: ; %main_body
589; GFX10-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x08,0x1f,0x24,0xf0,0x04,0x00,0x00,0x40]
590; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
591;
592; GFX11-LABEL: store_mip_2d:
593; GFX11:       ; %bb.0: ; %main_body
594; GFX11-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x84,0x0f,0x1d,0xf0,0x04,0x00,0x00,0x00]
595; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
596; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
597main_body:
598  %s = extractelement <2 x i16> %coords_lo, i32 0
599  %t = extractelement <2 x i16> %coords_lo, i32 1
600  %mip = extractelement <2 x i16> %coords_hi, i32 0
601  call void @llvm.amdgcn.image.store.mip.2d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
602  ret void
603}
604
605define amdgpu_ps void @store_mip_3d(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
606; GFX9-LABEL: store_mip_3d:
607; GFX9:       ; %bb.0: ; %main_body
608; GFX9-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x24,0xf0,0x04,0x00,0x00,0x00]
609; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
610;
611; GFX10-LABEL: store_mip_3d:
612; GFX10:       ; %bb.0: ; %main_body
613; GFX10-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x10,0x1f,0x24,0xf0,0x04,0x00,0x00,0x40]
614; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
615;
616; GFX11-LABEL: store_mip_3d:
617; GFX11:       ; %bb.0: ; %main_body
618; GFX11-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x88,0x0f,0x1d,0xf0,0x04,0x00,0x00,0x00]
619; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
620; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
621main_body:
622  %s = extractelement <2 x i16> %coords_lo, i32 0
623  %t = extractelement <2 x i16> %coords_lo, i32 1
624  %r = extractelement <2 x i16> %coords_hi, i32 0
625  %mip = extractelement <2 x i16> %coords_hi, i32 1
626  call void @llvm.amdgcn.image.store.mip.3d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %r, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
627  ret void
628}
629
630define amdgpu_ps void @store_mip_cube(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
631; GFX9-LABEL: store_mip_cube:
632; GFX9:       ; %bb.0: ; %main_body
633; GFX9-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x24,0xf0,0x04,0x00,0x00,0x00]
634; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
635;
636; GFX10-LABEL: store_mip_cube:
637; GFX10:       ; %bb.0: ; %main_body
638; GFX10-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x18,0x1f,0x24,0xf0,0x04,0x00,0x00,0x40]
639; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
640;
641; GFX11-LABEL: store_mip_cube:
642; GFX11:       ; %bb.0: ; %main_body
643; GFX11-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x8c,0x0f,0x1d,0xf0,0x04,0x00,0x00,0x00]
644; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
645; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
646main_body:
647  %s = extractelement <2 x i16> %coords_lo, i32 0
648  %t = extractelement <2 x i16> %coords_lo, i32 1
649  %slice = extractelement <2 x i16> %coords_hi, i32 0
650  %mip = extractelement <2 x i16> %coords_hi, i32 1
651  call void @llvm.amdgcn.image.store.mip.cube.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
652  ret void
653}
654
655define amdgpu_ps void @store_mip_1darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
656; GFX9-LABEL: store_mip_1darray:
657; GFX9:       ; %bb.0: ; %main_body
658; GFX9-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x24,0xf0,0x04,0x00,0x00,0x00]
659; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
660;
661; GFX10-LABEL: store_mip_1darray:
662; GFX10:       ; %bb.0: ; %main_body
663; GFX10-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x20,0x1f,0x24,0xf0,0x04,0x00,0x00,0x40]
664; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
665;
666; GFX11-LABEL: store_mip_1darray:
667; GFX11:       ; %bb.0: ; %main_body
668; GFX11-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x90,0x0f,0x1d,0xf0,0x04,0x00,0x00,0x00]
669; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
670; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
671main_body:
672  %s = extractelement <2 x i16> %coords_lo, i32 0
673  %slice = extractelement <2 x i16> %coords_lo, i32 1
674  %mip = extractelement <2 x i16> %coords_hi, i32 0
675  call void @llvm.amdgcn.image.store.mip.1darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
676  ret void
677}
678
679define amdgpu_ps void @store_mip_2darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords_lo, <2 x i16> %coords_hi) {
680; GFX9-LABEL: store_mip_2darray:
681; GFX9:       ; %bb.0: ; %main_body
682; GFX9-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x24,0xf0,0x04,0x00,0x00,0x00]
683; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
684;
685; GFX10-LABEL: store_mip_2darray:
686; GFX10:       ; %bb.0: ; %main_body
687; GFX10-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x28,0x1f,0x24,0xf0,0x04,0x00,0x00,0x40]
688; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
689;
690; GFX11-LABEL: store_mip_2darray:
691; GFX11:       ; %bb.0: ; %main_body
692; GFX11-NEXT:    image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x94,0x0f,0x1d,0xf0,0x04,0x00,0x00,0x00]
693; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
694; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
695main_body:
696  %s = extractelement <2 x i16> %coords_lo, i32 0
697  %t = extractelement <2 x i16> %coords_lo, i32 1
698  %slice = extractelement <2 x i16> %coords_hi, i32 0
699  %mip = extractelement <2 x i16> %coords_hi, i32 1
700  call void @llvm.amdgcn.image.store.mip.2darray.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, i16 %t, i16 %slice, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
701  ret void
702}
703
704define amdgpu_ps <4 x float> @getresinfo_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
705; GFX9-LABEL: getresinfo_1d:
706; GFX9:       ; %bb.0: ; %main_body
707; GFX9-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x38,0xf0,0x00,0x00,0x00,0x00]
708; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
709; GFX9-NEXT:    ; return to shader part epilog
710;
711; GFX10-LABEL: getresinfo_1d:
712; GFX10:       ; %bb.0: ; %main_body
713; GFX10-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x1f,0x38,0xf0,0x00,0x00,0x00,0x40]
714; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
715; GFX10-NEXT:    ; return to shader part epilog
716;
717; GFX11-LABEL: getresinfo_1d:
718; GFX11:       ; %bb.0: ; %main_body
719; GFX11-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x0f,0x5d,0xf0,0x00,0x00,0x00,0x00]
720; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
721; GFX11-NEXT:    ; return to shader part epilog
722main_body:
723  %mip = extractelement <2 x i16> %coords, i32 0
724  %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
725  ret <4 x float> %v
726}
727
728define amdgpu_ps <4 x float> @getresinfo_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
729; GFX9-LABEL: getresinfo_2d:
730; GFX9:       ; %bb.0: ; %main_body
731; GFX9-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x38,0xf0,0x00,0x00,0x00,0x00]
732; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
733; GFX9-NEXT:    ; return to shader part epilog
734;
735; GFX10-LABEL: getresinfo_2d:
736; GFX10:       ; %bb.0: ; %main_body
737; GFX10-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x08,0x1f,0x38,0xf0,0x00,0x00,0x00,0x40]
738; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
739; GFX10-NEXT:    ; return to shader part epilog
740;
741; GFX11-LABEL: getresinfo_2d:
742; GFX11:       ; %bb.0: ; %main_body
743; GFX11-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16 ; encoding: [0x84,0x0f,0x5d,0xf0,0x00,0x00,0x00,0x00]
744; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
745; GFX11-NEXT:    ; return to shader part epilog
746main_body:
747  %mip = extractelement <2 x i16> %coords, i32 0
748  %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
749  ret <4 x float> %v
750}
751
752define amdgpu_ps <4 x float> @getresinfo_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
753; GFX9-LABEL: getresinfo_3d:
754; GFX9:       ; %bb.0: ; %main_body
755; GFX9-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x38,0xf0,0x00,0x00,0x00,0x00]
756; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
757; GFX9-NEXT:    ; return to shader part epilog
758;
759; GFX10-LABEL: getresinfo_3d:
760; GFX10:       ; %bb.0: ; %main_body
761; GFX10-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x10,0x1f,0x38,0xf0,0x00,0x00,0x00,0x40]
762; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
763; GFX10-NEXT:    ; return to shader part epilog
764;
765; GFX11-LABEL: getresinfo_3d:
766; GFX11:       ; %bb.0: ; %main_body
767; GFX11-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16 ; encoding: [0x88,0x0f,0x5d,0xf0,0x00,0x00,0x00,0x00]
768; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
769; GFX11-NEXT:    ; return to shader part epilog
770main_body:
771  %mip = extractelement <2 x i16> %coords, i32 0
772  %v = call <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
773  ret <4 x float> %v
774}
775
776define amdgpu_ps <4 x float> @getresinfo_cube(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
777; GFX9-LABEL: getresinfo_cube:
778; GFX9:       ; %bb.0: ; %main_body
779; GFX9-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x38,0xf0,0x00,0x00,0x00,0x00]
780; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
781; GFX9-NEXT:    ; return to shader part epilog
782;
783; GFX10-LABEL: getresinfo_cube:
784; GFX10:       ; %bb.0: ; %main_body
785; GFX10-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x18,0x1f,0x38,0xf0,0x00,0x00,0x00,0x40]
786; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
787; GFX10-NEXT:    ; return to shader part epilog
788;
789; GFX11-LABEL: getresinfo_cube:
790; GFX11:       ; %bb.0: ; %main_body
791; GFX11-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm a16 ; encoding: [0x8c,0x0f,0x5d,0xf0,0x00,0x00,0x00,0x00]
792; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
793; GFX11-NEXT:    ; return to shader part epilog
794main_body:
795  %mip = extractelement <2 x i16> %coords, i32 0
796  %v = call <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
797  ret <4 x float> %v
798}
799
800define amdgpu_ps <4 x float> @getresinfo_1darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
801; GFX9-LABEL: getresinfo_1darray:
802; GFX9:       ; %bb.0: ; %main_body
803; GFX9-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x38,0xf0,0x00,0x00,0x00,0x00]
804; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
805; GFX9-NEXT:    ; return to shader part epilog
806;
807; GFX10-LABEL: getresinfo_1darray:
808; GFX10:       ; %bb.0: ; %main_body
809; GFX10-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x20,0x1f,0x38,0xf0,0x00,0x00,0x00,0x40]
810; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
811; GFX10-NEXT:    ; return to shader part epilog
812;
813; GFX11-LABEL: getresinfo_1darray:
814; GFX11:       ; %bb.0: ; %main_body
815; GFX11-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm a16 ; encoding: [0x90,0x0f,0x5d,0xf0,0x00,0x00,0x00,0x00]
816; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
817; GFX11-NEXT:    ; return to shader part epilog
818main_body:
819  %mip = extractelement <2 x i16> %coords, i32 0
820  %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
821  ret <4 x float> %v
822}
823
824define amdgpu_ps <4 x float> @getresinfo_2darray(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
825; GFX9-LABEL: getresinfo_2darray:
826; GFX9:       ; %bb.0: ; %main_body
827; GFX9-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x38,0xf0,0x00,0x00,0x00,0x00]
828; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
829; GFX9-NEXT:    ; return to shader part epilog
830;
831; GFX10-LABEL: getresinfo_2darray:
832; GFX10:       ; %bb.0: ; %main_body
833; GFX10-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x28,0x1f,0x38,0xf0,0x00,0x00,0x00,0x40]
834; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
835; GFX10-NEXT:    ; return to shader part epilog
836;
837; GFX11-LABEL: getresinfo_2darray:
838; GFX11:       ; %bb.0: ; %main_body
839; GFX11-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm a16 ; encoding: [0x94,0x0f,0x5d,0xf0,0x00,0x00,0x00,0x00]
840; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
841; GFX11-NEXT:    ; return to shader part epilog
842main_body:
843  %mip = extractelement <2 x i16> %coords, i32 0
844  %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
845  ret <4 x float> %v
846}
847
848define amdgpu_ps <4 x float> @getresinfo_2dmsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
849; GFX9-LABEL: getresinfo_2dmsaa:
850; GFX9:       ; %bb.0: ; %main_body
851; GFX9-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x38,0xf0,0x00,0x00,0x00,0x00]
852; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
853; GFX9-NEXT:    ; return to shader part epilog
854;
855; GFX10-LABEL: getresinfo_2dmsaa:
856; GFX10:       ; %bb.0: ; %main_body
857; GFX10-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm a16 ; encoding: [0x30,0x1f,0x38,0xf0,0x00,0x00,0x00,0x40]
858; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
859; GFX10-NEXT:    ; return to shader part epilog
860;
861; GFX11-LABEL: getresinfo_2dmsaa:
862; GFX11:       ; %bb.0: ; %main_body
863; GFX11-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm a16 ; encoding: [0x98,0x0f,0x5d,0xf0,0x00,0x00,0x00,0x00]
864; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
865; GFX11-NEXT:    ; return to shader part epilog
866main_body:
867  %mip = extractelement <2 x i16> %coords, i32 0
868  %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
869  ret <4 x float> %v
870}
871
872define amdgpu_ps <4 x float> @getresinfo_2darraymsaa(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
873; GFX9-LABEL: getresinfo_2darraymsaa:
874; GFX9:       ; %bb.0: ; %main_body
875; GFX9-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm a16 da ; encoding: [0x00,0xdf,0x38,0xf0,0x00,0x00,0x00,0x00]
876; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
877; GFX9-NEXT:    ; return to shader part epilog
878;
879; GFX10-LABEL: getresinfo_2darraymsaa:
880; GFX10:       ; %bb.0: ; %main_body
881; GFX10-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm a16 ; encoding: [0x38,0x1f,0x38,0xf0,0x00,0x00,0x00,0x40]
882; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
883; GFX10-NEXT:    ; return to shader part epilog
884;
885; GFX11-LABEL: getresinfo_2darraymsaa:
886; GFX11:       ; %bb.0: ; %main_body
887; GFX11-NEXT:    image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm a16 ; encoding: [0x9c,0x0f,0x5d,0xf0,0x00,0x00,0x00,0x00]
888; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
889; GFX11-NEXT:    ; return to shader part epilog
890main_body:
891  %mip = extractelement <2 x i16> %coords, i32 0
892  %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i16(i32 15, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
893  ret <4 x float> %v
894}
895
896define amdgpu_ps float @load_1d_V1(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
897; GFX9-LABEL: load_1d_V1:
898; GFX9:       ; %bb.0: ; %main_body
899; GFX9-NEXT:    image_load v0, v0, s[0:7] dmask:0x8 unorm a16 ; encoding: [0x00,0x98,0x00,0xf0,0x00,0x00,0x00,0x00]
900; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
901; GFX9-NEXT:    ; return to shader part epilog
902;
903; GFX10-LABEL: load_1d_V1:
904; GFX10:       ; %bb.0: ; %main_body
905; GFX10-NEXT:    image_load v0, v0, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x18,0x00,0xf0,0x00,0x00,0x00,0x40]
906; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
907; GFX10-NEXT:    ; return to shader part epilog
908;
909; GFX11-LABEL: load_1d_V1:
910; GFX11:       ; %bb.0: ; %main_body
911; GFX11-NEXT:    image_load v0, v0, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x08,0x01,0xf0,0x00,0x00,0x00,0x00]
912; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
913; GFX11-NEXT:    ; return to shader part epilog
914main_body:
915  %s = extractelement <2 x i16> %coords, i32 0
916  %v = call float @llvm.amdgcn.image.load.1d.f32.i16(i32 8, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
917  ret float %v
918}
919
920define amdgpu_ps <2 x float> @load_1d_V2(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
921; GFX9-LABEL: load_1d_V2:
922; GFX9:       ; %bb.0: ; %main_body
923; GFX9-NEXT:    image_load v[0:1], v0, s[0:7] dmask:0x9 unorm a16 ; encoding: [0x00,0x99,0x00,0xf0,0x00,0x00,0x00,0x00]
924; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
925; GFX9-NEXT:    ; return to shader part epilog
926;
927; GFX10-LABEL: load_1d_V2:
928; GFX10:       ; %bb.0: ; %main_body
929; GFX10-NEXT:    image_load v[0:1], v0, s[0:7] dmask:0x9 dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x19,0x00,0xf0,0x00,0x00,0x00,0x40]
930; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
931; GFX10-NEXT:    ; return to shader part epilog
932;
933; GFX11-LABEL: load_1d_V2:
934; GFX11:       ; %bb.0: ; %main_body
935; GFX11-NEXT:    image_load v[0:1], v0, s[0:7] dmask:0x9 dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x09,0x01,0xf0,0x00,0x00,0x00,0x00]
936; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
937; GFX11-NEXT:    ; return to shader part epilog
938main_body:
939  %s = extractelement <2 x i16> %coords, i32 0
940  %v = call <2 x float> @llvm.amdgcn.image.load.1d.v2f32.i16(i32 9, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
941  ret <2 x float> %v
942}
943
944define amdgpu_ps void @store_1d_V1(<8 x i32> inreg %rsrc, float %vdata, <2 x i16> %coords) {
945; GFX9-LABEL: store_1d_V1:
946; GFX9:       ; %bb.0: ; %main_body
947; GFX9-NEXT:    image_store v0, v1, s[0:7] dmask:0x2 unorm a16 ; encoding: [0x00,0x92,0x20,0xf0,0x01,0x00,0x00,0x00]
948; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
949;
950; GFX10-LABEL: store_1d_V1:
951; GFX10:       ; %bb.0: ; %main_body
952; GFX10-NEXT:    image_store v0, v1, s[0:7] dmask:0x2 dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x12,0x20,0xf0,0x01,0x00,0x00,0x40]
953; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
954;
955; GFX11-LABEL: store_1d_V1:
956; GFX11:       ; %bb.0: ; %main_body
957; GFX11-NEXT:    image_store v0, v1, s[0:7] dmask:0x2 dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x02,0x19,0xf0,0x01,0x00,0x00,0x00]
958; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
959; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
960main_body:
961  %s = extractelement <2 x i16> %coords, i32 0
962  call void @llvm.amdgcn.image.store.1d.f32.i16(float %vdata, i32 2, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
963  ret void
964}
965
966define amdgpu_ps void @store_1d_V2(<8 x i32> inreg %rsrc, <2 x float> %vdata, <2 x i16> %coords) {
967; GFX9-LABEL: store_1d_V2:
968; GFX9:       ; %bb.0: ; %main_body
969; GFX9-NEXT:    image_store v[0:1], v2, s[0:7] dmask:0xc unorm a16 ; encoding: [0x00,0x9c,0x20,0xf0,0x02,0x00,0x00,0x00]
970; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
971;
972; GFX10-LABEL: store_1d_V2:
973; GFX10:       ; %bb.0: ; %main_body
974; GFX10-NEXT:    image_store v[0:1], v2, s[0:7] dmask:0xc dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x00,0x1c,0x20,0xf0,0x02,0x00,0x00,0x40]
975; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
976;
977; GFX11-LABEL: store_1d_V2:
978; GFX11:       ; %bb.0: ; %main_body
979; GFX11-NEXT:    image_store v[0:1], v2, s[0:7] dmask:0xc dim:SQ_RSRC_IMG_1D unorm a16 ; encoding: [0x80,0x0c,0x19,0xf0,0x02,0x00,0x00,0x00]
980; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
981; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
982main_body:
983  %s = extractelement <2 x i16> %coords, i32 0
984  call void @llvm.amdgcn.image.store.1d.v2f32.i16(<2 x float> %vdata, i32 12, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
985  ret void
986}
987
988define amdgpu_ps <4 x float> @load_1d_glc(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
989; GFX9-LABEL: load_1d_glc:
990; GFX9:       ; %bb.0: ; %main_body
991; GFX9-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc a16 ; encoding: [0x00,0xbf,0x00,0xf0,0x00,0x00,0x00,0x00]
992; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
993; GFX9-NEXT:    ; return to shader part epilog
994;
995; GFX10-LABEL: load_1d_glc:
996; GFX10:       ; %bb.0: ; %main_body
997; GFX10-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc a16 ; encoding: [0x00,0x3f,0x00,0xf0,0x00,0x00,0x00,0x40]
998; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
999; GFX10-NEXT:    ; return to shader part epilog
1000;
1001; GFX11-LABEL: load_1d_glc:
1002; GFX11:       ; %bb.0: ; %main_body
1003; GFX11-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc a16 ; encoding: [0x80,0x4f,0x01,0xf0,0x00,0x00,0x00,0x00]
1004; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
1005; GFX11-NEXT:    ; return to shader part epilog
1006main_body:
1007  %s = extractelement <2 x i16> %coords, i32 0
1008  %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 1)
1009  ret <4 x float> %v
1010}
1011
1012define amdgpu_ps <4 x float> @load_1d_slc(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
1013; GFX9-LABEL: load_1d_slc:
1014; GFX9:       ; %bb.0: ; %main_body
1015; GFX9-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf unorm slc a16 ; encoding: [0x00,0x9f,0x00,0xf2,0x00,0x00,0x00,0x00]
1016; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
1017; GFX9-NEXT:    ; return to shader part epilog
1018;
1019; GFX10-LABEL: load_1d_slc:
1020; GFX10:       ; %bb.0: ; %main_body
1021; GFX10-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm slc a16 ; encoding: [0x00,0x1f,0x00,0xf2,0x00,0x00,0x00,0x40]
1022; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1023; GFX10-NEXT:    ; return to shader part epilog
1024;
1025; GFX11-LABEL: load_1d_slc:
1026; GFX11:       ; %bb.0: ; %main_body
1027; GFX11-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm slc a16 ; encoding: [0x80,0x1f,0x01,0xf0,0x00,0x00,0x00,0x00]
1028; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
1029; GFX11-NEXT:    ; return to shader part epilog
1030main_body:
1031  %s = extractelement <2 x i16> %coords, i32 0
1032  %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 2)
1033  ret <4 x float> %v
1034}
1035
1036define amdgpu_ps <4 x float> @load_1d_glc_slc(<8 x i32> inreg %rsrc, <2 x i16> %coords) {
1037; GFX9-LABEL: load_1d_glc_slc:
1038; GFX9:       ; %bb.0: ; %main_body
1039; GFX9-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc slc a16 ; encoding: [0x00,0xbf,0x00,0xf2,0x00,0x00,0x00,0x00]
1040; GFX9-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x0f,0x8c,0xbf]
1041; GFX9-NEXT:    ; return to shader part epilog
1042;
1043; GFX10-LABEL: load_1d_glc_slc:
1044; GFX10:       ; %bb.0: ; %main_body
1045; GFX10-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc slc a16 ; encoding: [0x00,0x3f,0x00,0xf2,0x00,0x00,0x00,0x40]
1046; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1047; GFX10-NEXT:    ; return to shader part epilog
1048;
1049; GFX11-LABEL: load_1d_glc_slc:
1050; GFX11:       ; %bb.0: ; %main_body
1051; GFX11-NEXT:    image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc slc a16 ; encoding: [0x80,0x5f,0x01,0xf0,0x00,0x00,0x00,0x00]
1052; GFX11-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0xf7,0x03,0x89,0xbf]
1053; GFX11-NEXT:    ; return to shader part epilog
1054main_body:
1055  %s = extractelement <2 x i16> %coords, i32 0
1056  %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 3)
1057  ret <4 x float> %v
1058}
1059
1060define amdgpu_ps void @store_1d_glc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
1061; GFX9-LABEL: store_1d_glc:
1062; GFX9:       ; %bb.0: ; %main_body
1063; GFX9-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc a16 ; encoding: [0x00,0xbf,0x20,0xf0,0x04,0x00,0x00,0x00]
1064; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1065;
1066; GFX10-LABEL: store_1d_glc:
1067; GFX10:       ; %bb.0: ; %main_body
1068; GFX10-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc a16 ; encoding: [0x00,0x3f,0x20,0xf0,0x04,0x00,0x00,0x40]
1069; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1070;
1071; GFX11-LABEL: store_1d_glc:
1072; GFX11:       ; %bb.0: ; %main_body
1073; GFX11-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc a16 ; encoding: [0x80,0x4f,0x19,0xf0,0x04,0x00,0x00,0x00]
1074; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
1075; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1076main_body:
1077  %s = extractelement <2 x i16> %coords, i32 0
1078  call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 1)
1079  ret void
1080}
1081
1082define amdgpu_ps void @store_1d_slc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
1083; GFX9-LABEL: store_1d_slc:
1084; GFX9:       ; %bb.0: ; %main_body
1085; GFX9-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf unorm slc a16 ; encoding: [0x00,0x9f,0x20,0xf2,0x04,0x00,0x00,0x00]
1086; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1087;
1088; GFX10-LABEL: store_1d_slc:
1089; GFX10:       ; %bb.0: ; %main_body
1090; GFX10-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm slc a16 ; encoding: [0x00,0x1f,0x20,0xf2,0x04,0x00,0x00,0x40]
1091; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1092;
1093; GFX11-LABEL: store_1d_slc:
1094; GFX11:       ; %bb.0: ; %main_body
1095; GFX11-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm slc a16 ; encoding: [0x80,0x1f,0x19,0xf0,0x04,0x00,0x00,0x00]
1096; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
1097; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1098main_body:
1099  %s = extractelement <2 x i16> %coords, i32 0
1100  call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 2)
1101  ret void
1102}
1103
1104define amdgpu_ps void @store_1d_glc_slc(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) {
1105; GFX9-LABEL: store_1d_glc_slc:
1106; GFX9:       ; %bb.0: ; %main_body
1107; GFX9-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc slc a16 ; encoding: [0x00,0xbf,0x20,0xf2,0x04,0x00,0x00,0x00]
1108; GFX9-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1109;
1110; GFX10-LABEL: store_1d_glc_slc:
1111; GFX10:       ; %bb.0: ; %main_body
1112; GFX10-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc slc a16 ; encoding: [0x00,0x3f,0x20,0xf2,0x04,0x00,0x00,0x40]
1113; GFX10-NEXT:    s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1114;
1115; GFX11-LABEL: store_1d_glc_slc:
1116; GFX11:       ; %bb.0: ; %main_body
1117; GFX11-NEXT:    image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc slc a16 ; encoding: [0x80,0x5f,0x19,0xf0,0x04,0x00,0x00,0x00]
1118; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
1119; GFX11-NEXT:    s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1120main_body:
1121  %s = extractelement <2 x i16> %coords, i32 0
1122  call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %vdata, i32 15, i16 %s, <8 x i32> %rsrc, i32 0, i32 3)
1123  ret void
1124}
1125
1126define amdgpu_ps <4 x float> @getresinfo_dmask0(<8 x i32> inreg %rsrc, <4 x float> %vdata, <2 x i16> %coords) #0 {
1127; GFX9-LABEL: getresinfo_dmask0:
1128; GFX9:       ; %bb.0: ; %main_body
1129; GFX9-NEXT:    ; return to shader part epilog
1130;
1131; GFX10-LABEL: getresinfo_dmask0:
1132; GFX10:       ; %bb.0: ; %main_body
1133; GFX10-NEXT:    ; return to shader part epilog
1134;
1135; GFX11-LABEL: getresinfo_dmask0:
1136; GFX11:       ; %bb.0: ; %main_body
1137; GFX11-NEXT:    ; return to shader part epilog
1138main_body:
1139  %mip = extractelement <2 x i16> %coords, i32 0
1140  %r = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32 0, i16 %mip, <8 x i32> %rsrc, i32 0, i32 0)
1141  ret <4 x float> %r
1142}
1143
1144declare <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #1
1145declare <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1
1146declare <4 x float> @llvm.amdgcn.image.load.3d.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
1147declare <4 x float> @llvm.amdgcn.image.load.cube.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
1148declare <4 x float> @llvm.amdgcn.image.load.1darray.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1
1149declare <4 x float> @llvm.amdgcn.image.load.2darray.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
1150declare <4 x float> @llvm.amdgcn.image.load.2dmsaa.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
1151declare <4 x float> @llvm.amdgcn.image.load.2darraymsaa.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1
1152
1153declare <4 x float> @llvm.amdgcn.image.load.mip.1d.v4f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1
1154declare <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
1155declare <4 x float> @llvm.amdgcn.image.load.mip.3d.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1
1156declare <4 x float> @llvm.amdgcn.image.load.mip.cube.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1
1157declare <4 x float> @llvm.amdgcn.image.load.mip.1darray.v4f32.i16(i32, i16, i16, i16, <8 x i32>, i32, i32) #1
1158declare <4 x float> @llvm.amdgcn.image.load.mip.2darray.v4f32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #1
1159
1160declare void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float>, i32, i16, <8 x i32>, i32, i32) #0
1161declare void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0
1162declare void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
1163declare void @llvm.amdgcn.image.store.cube.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
1164declare void @llvm.amdgcn.image.store.1darray.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0
1165declare void @llvm.amdgcn.image.store.2darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
1166declare void @llvm.amdgcn.image.store.2dmsaa.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
1167declare void @llvm.amdgcn.image.store.2darraymsaa.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0
1168
1169declare void @llvm.amdgcn.image.store.mip.1d.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #0
1170declare void @llvm.amdgcn.image.store.mip.2d.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
1171declare void @llvm.amdgcn.image.store.mip.3d.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0
1172declare void @llvm.amdgcn.image.store.mip.cube.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0
1173declare void @llvm.amdgcn.image.store.mip.1darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #0
1174declare void @llvm.amdgcn.image.store.mip.2darray.v4f32.i16(<4 x float>, i32, i16, i16, i16, i16, <8 x i32>, i32, i32) #0
1175
1176declare <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
1177declare <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
1178declare <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
1179declare <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
1180declare <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
1181declare <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
1182declare <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
1183declare <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i16(i32, i16, <8 x i32>, i32, i32) #2
1184
1185declare float @llvm.amdgcn.image.load.1d.f32.i16(i32, i16, <8 x i32>, i32, i32) #1
1186declare float @llvm.amdgcn.image.load.2d.f32.i16(i32, i16, i16, <8 x i32>, i32, i32) #1
1187declare <2 x float> @llvm.amdgcn.image.load.1d.v2f32.i16(i32, i16, <8 x i32>, i32, i32) #1
1188declare void @llvm.amdgcn.image.store.1d.f32.i16(float, i32, i16, <8 x i32>, i32, i32) #0
1189declare void @llvm.amdgcn.image.store.1d.v2f32.i16(<2 x float>, i32, i16, <8 x i32>, i32, i32) #0
1190
1191attributes #0 = { nounwind }
1192attributes #1 = { nounwind readonly }
1193attributes #2 = { nounwind readnone }
1194