1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX9 %s
3; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10 %s
4
5define amdgpu_ps <4 x float> @sample_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s) {
6; GFX9-LABEL: sample_1d:
7; GFX9:       ; %bb.0: ; %main_body
8; GFX9-NEXT:    s_mov_b64 s[12:13], exec
9; GFX9-NEXT:    s_wqm_b64 exec, exec
10; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
11; GFX9-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
12; GFX9-NEXT:    s_waitcnt vmcnt(0)
13; GFX9-NEXT:    ; return to shader part epilog
14;
15; GFX10-LABEL: sample_1d:
16; GFX10:       ; %bb.0: ; %main_body
17; GFX10-NEXT:    s_mov_b32 s12, exec_lo
18; GFX10-NEXT:    ; implicit-def: $vcc_hi
19; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
20; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
21; GFX10-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
22; GFX10-NEXT:    s_waitcnt vmcnt(0)
23; GFX10-NEXT:    ; return to shader part epilog
24main_body:
25  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f16(i32 15, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
26  ret <4 x float> %v
27}
28
29define amdgpu_ps <4 x float> @sample_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t) {
30; GFX9-LABEL: sample_2d:
31; GFX9:       ; %bb.0: ; %main_body
32; GFX9-NEXT:    s_mov_b64 s[12:13], exec
33; GFX9-NEXT:    s_wqm_b64 exec, exec
34; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
35; GFX9-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
36; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
37; GFX9-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
38; GFX9-NEXT:    s_waitcnt vmcnt(0)
39; GFX9-NEXT:    ; return to shader part epilog
40;
41; GFX10-LABEL: sample_2d:
42; GFX10:       ; %bb.0: ; %main_body
43; GFX10-NEXT:    s_mov_b32 s12, exec_lo
44; GFX10-NEXT:    ; implicit-def: $vcc_hi
45; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
46; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
47; GFX10-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
48; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
49; GFX10-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
50; GFX10-NEXT:    s_waitcnt vmcnt(0)
51; GFX10-NEXT:    ; return to shader part epilog
52main_body:
53  %v = call <4 x float> @llvm.amdgcn.image.sample.2d.v4f32.f16(i32 15, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
54  ret <4 x float> %v
55}
56
57define amdgpu_ps <4 x float> @sample_3d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %r) {
58; GFX9-LABEL: sample_3d:
59; GFX9:       ; %bb.0: ; %main_body
60; GFX9-NEXT:    s_mov_b64 s[12:13], exec
61; GFX9-NEXT:    s_wqm_b64 exec, exec
62; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
63; GFX9-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
64; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
65; GFX9-NEXT:    image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16
66; GFX9-NEXT:    s_waitcnt vmcnt(0)
67; GFX9-NEXT:    ; return to shader part epilog
68;
69; GFX10-LABEL: sample_3d:
70; GFX10:       ; %bb.0: ; %main_body
71; GFX10-NEXT:    s_mov_b32 s12, exec_lo
72; GFX10-NEXT:    ; implicit-def: $vcc_hi
73; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
74; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
75; GFX10-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
76; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
77; GFX10-NEXT:    image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D a16
78; GFX10-NEXT:    s_waitcnt vmcnt(0)
79; GFX10-NEXT:    ; return to shader part epilog
80main_body:
81  %v = call <4 x float> @llvm.amdgcn.image.sample.3d.v4f32.f16(i32 15, half %s, half %t, half %r, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
82  ret <4 x float> %v
83}
84
85define amdgpu_ps <4 x float> @sample_cube(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %face) {
86; GFX9-LABEL: sample_cube:
87; GFX9:       ; %bb.0: ; %main_body
88; GFX9-NEXT:    s_mov_b64 s[12:13], exec
89; GFX9-NEXT:    s_wqm_b64 exec, exec
90; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
91; GFX9-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
92; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
93; GFX9-NEXT:    image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16 da
94; GFX9-NEXT:    s_waitcnt vmcnt(0)
95; GFX9-NEXT:    ; return to shader part epilog
96;
97; GFX10-LABEL: sample_cube:
98; GFX10:       ; %bb.0: ; %main_body
99; GFX10-NEXT:    s_mov_b32 s12, exec_lo
100; GFX10-NEXT:    ; implicit-def: $vcc_hi
101; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
102; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
103; GFX10-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
104; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
105; GFX10-NEXT:    image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_CUBE a16
106; GFX10-NEXT:    s_waitcnt vmcnt(0)
107; GFX10-NEXT:    ; return to shader part epilog
108main_body:
109  %v = call <4 x float> @llvm.amdgcn.image.sample.cube.v4f32.f16(i32 15, half %s, half %t, half %face, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
110  ret <4 x float> %v
111}
112
113define amdgpu_ps <4 x float> @sample_1darray(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %slice) {
114; GFX9-LABEL: sample_1darray:
115; GFX9:       ; %bb.0: ; %main_body
116; GFX9-NEXT:    s_mov_b64 s[12:13], exec
117; GFX9-NEXT:    s_wqm_b64 exec, exec
118; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
119; GFX9-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
120; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
121; GFX9-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16 da
122; GFX9-NEXT:    s_waitcnt vmcnt(0)
123; GFX9-NEXT:    ; return to shader part epilog
124;
125; GFX10-LABEL: sample_1darray:
126; GFX10:       ; %bb.0: ; %main_body
127; GFX10-NEXT:    s_mov_b32 s12, exec_lo
128; GFX10-NEXT:    ; implicit-def: $vcc_hi
129; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
130; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
131; GFX10-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
132; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
133; GFX10-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY a16
134; GFX10-NEXT:    s_waitcnt vmcnt(0)
135; GFX10-NEXT:    ; return to shader part epilog
136main_body:
137  %v = call <4 x float> @llvm.amdgcn.image.sample.1darray.v4f32.f16(i32 15, half %s, half %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
138  ret <4 x float> %v
139}
140
141define amdgpu_ps <4 x float> @sample_2darray(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %slice) {
142; GFX9-LABEL: sample_2darray:
143; GFX9:       ; %bb.0: ; %main_body
144; GFX9-NEXT:    s_mov_b64 s[12:13], exec
145; GFX9-NEXT:    s_wqm_b64 exec, exec
146; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
147; GFX9-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
148; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
149; GFX9-NEXT:    image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16 da
150; GFX9-NEXT:    s_waitcnt vmcnt(0)
151; GFX9-NEXT:    ; return to shader part epilog
152;
153; GFX10-LABEL: sample_2darray:
154; GFX10:       ; %bb.0: ; %main_body
155; GFX10-NEXT:    s_mov_b32 s12, exec_lo
156; GFX10-NEXT:    ; implicit-def: $vcc_hi
157; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
158; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
159; GFX10-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
160; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
161; GFX10-NEXT:    image_sample v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY a16
162; GFX10-NEXT:    s_waitcnt vmcnt(0)
163; GFX10-NEXT:    ; return to shader part epilog
164main_body:
165  %v = call <4 x float> @llvm.amdgcn.image.sample.2darray.v4f32.f16(i32 15, half %s, half %t, half %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
166  ret <4 x float> %v
167}
168
169define amdgpu_ps <4 x float> @sample_c_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s) {
170; GFX9-LABEL: sample_c_1d:
171; GFX9:       ; %bb.0: ; %main_body
172; GFX9-NEXT:    s_mov_b64 s[12:13], exec
173; GFX9-NEXT:    s_wqm_b64 exec, exec
174; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
175; GFX9-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
176; GFX9-NEXT:    s_waitcnt vmcnt(0)
177; GFX9-NEXT:    ; return to shader part epilog
178;
179; GFX10-LABEL: sample_c_1d:
180; GFX10:       ; %bb.0: ; %main_body
181; GFX10-NEXT:    s_mov_b32 s12, exec_lo
182; GFX10-NEXT:    ; implicit-def: $vcc_hi
183; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
184; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
185; GFX10-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
186; GFX10-NEXT:    s_waitcnt vmcnt(0)
187; GFX10-NEXT:    ; return to shader part epilog
188main_body:
189  %v = call <4 x float> @llvm.amdgcn.image.sample.c.1d.v4f32.f16(i32 15, float %zcompare, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
190  ret <4 x float> %v
191}
192
193define amdgpu_ps <4 x float> @sample_c_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t) {
194; GFX9-LABEL: sample_c_2d:
195; GFX9:       ; %bb.0: ; %main_body
196; GFX9-NEXT:    s_mov_b64 s[12:13], exec
197; GFX9-NEXT:    s_wqm_b64 exec, exec
198; GFX9-NEXT:    v_and_b32_e32 v1, 0xffff, v1
199; GFX9-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
200; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
201; GFX9-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
202; GFX9-NEXT:    s_waitcnt vmcnt(0)
203; GFX9-NEXT:    ; return to shader part epilog
204;
205; GFX10-LABEL: sample_c_2d:
206; GFX10:       ; %bb.0: ; %main_body
207; GFX10-NEXT:    s_mov_b32 s12, exec_lo
208; GFX10-NEXT:    ; implicit-def: $vcc_hi
209; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
210; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
211; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
212; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
213; GFX10-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
214; GFX10-NEXT:    s_waitcnt vmcnt(0)
215; GFX10-NEXT:    ; return to shader part epilog
216main_body:
217  %v = call <4 x float> @llvm.amdgcn.image.sample.c.2d.v4f32.f16(i32 15, float %zcompare, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
218  ret <4 x float> %v
219}
220
221define amdgpu_ps <4 x float> @sample_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %clamp) {
222; GFX9-LABEL: sample_cl_1d:
223; GFX9:       ; %bb.0: ; %main_body
224; GFX9-NEXT:    s_mov_b64 s[12:13], exec
225; GFX9-NEXT:    s_wqm_b64 exec, exec
226; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
227; GFX9-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
228; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
229; GFX9-NEXT:    image_sample_cl v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
230; GFX9-NEXT:    s_waitcnt vmcnt(0)
231; GFX9-NEXT:    ; return to shader part epilog
232;
233; GFX10-LABEL: sample_cl_1d:
234; GFX10:       ; %bb.0: ; %main_body
235; GFX10-NEXT:    s_mov_b32 s12, exec_lo
236; GFX10-NEXT:    ; implicit-def: $vcc_hi
237; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
238; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
239; GFX10-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
240; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
241; GFX10-NEXT:    image_sample_cl v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
242; GFX10-NEXT:    s_waitcnt vmcnt(0)
243; GFX10-NEXT:    ; return to shader part epilog
244main_body:
245  %v = call <4 x float> @llvm.amdgcn.image.sample.cl.1d.v4f32.f16(i32 15, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
246  ret <4 x float> %v
247}
248
249define amdgpu_ps <4 x float> @sample_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %clamp) {
250; GFX9-LABEL: sample_cl_2d:
251; GFX9:       ; %bb.0: ; %main_body
252; GFX9-NEXT:    s_mov_b64 s[12:13], exec
253; GFX9-NEXT:    s_wqm_b64 exec, exec
254; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
255; GFX9-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
256; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
257; GFX9-NEXT:    image_sample_cl v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16
258; GFX9-NEXT:    s_waitcnt vmcnt(0)
259; GFX9-NEXT:    ; return to shader part epilog
260;
261; GFX10-LABEL: sample_cl_2d:
262; GFX10:       ; %bb.0: ; %main_body
263; GFX10-NEXT:    s_mov_b32 s12, exec_lo
264; GFX10-NEXT:    ; implicit-def: $vcc_hi
265; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
266; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
267; GFX10-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
268; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
269; GFX10-NEXT:    image_sample_cl v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
270; GFX10-NEXT:    s_waitcnt vmcnt(0)
271; GFX10-NEXT:    ; return to shader part epilog
272main_body:
273  %v = call <4 x float> @llvm.amdgcn.image.sample.cl.2d.v4f32.f16(i32 15, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
274  ret <4 x float> %v
275}
276
277define amdgpu_ps <4 x float> @sample_c_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %clamp) {
278; GFX9-LABEL: sample_c_cl_1d:
279; GFX9:       ; %bb.0: ; %main_body
280; GFX9-NEXT:    s_mov_b64 s[12:13], exec
281; GFX9-NEXT:    s_wqm_b64 exec, exec
282; GFX9-NEXT:    v_and_b32_e32 v1, 0xffff, v1
283; GFX9-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
284; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
285; GFX9-NEXT:    image_sample_c_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
286; GFX9-NEXT:    s_waitcnt vmcnt(0)
287; GFX9-NEXT:    ; return to shader part epilog
288;
289; GFX10-LABEL: sample_c_cl_1d:
290; GFX10:       ; %bb.0: ; %main_body
291; GFX10-NEXT:    s_mov_b32 s12, exec_lo
292; GFX10-NEXT:    ; implicit-def: $vcc_hi
293; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
294; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
295; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
296; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
297; GFX10-NEXT:    image_sample_c_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
298; GFX10-NEXT:    s_waitcnt vmcnt(0)
299; GFX10-NEXT:    ; return to shader part epilog
300main_body:
301  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cl.1d.v4f32.f16(i32 15, float %zcompare, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
302  ret <4 x float> %v
303}
304
305define amdgpu_ps <4 x float> @sample_c_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t, half %clamp) {
306; GFX9-LABEL: sample_c_cl_2d:
307; GFX9:       ; %bb.0: ; %main_body
308; GFX9-NEXT:    s_mov_b64 s[12:13], exec
309; GFX9-NEXT:    s_wqm_b64 exec, exec
310; GFX9-NEXT:    v_mov_b32_e32 v5, v3
311; GFX9-NEXT:    v_mov_b32_e32 v3, v0
312; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v1
313; GFX9-NEXT:    v_lshl_or_b32 v4, v2, 16, v0
314; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
315; GFX9-NEXT:    image_sample_c_cl v[0:3], v[3:5], s[0:7], s[8:11] dmask:0xf a16
316; GFX9-NEXT:    s_waitcnt vmcnt(0)
317; GFX9-NEXT:    ; return to shader part epilog
318;
319; GFX10-LABEL: sample_c_cl_2d:
320; GFX10:       ; %bb.0: ; %main_body
321; GFX10-NEXT:    s_mov_b32 s12, exec_lo
322; GFX10-NEXT:    ; implicit-def: $vcc_hi
323; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
324; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
325; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
326; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
327; GFX10-NEXT:    image_sample_c_cl v[0:3], [v0, v1, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
328; GFX10-NEXT:    s_waitcnt vmcnt(0)
329; GFX10-NEXT:    ; return to shader part epilog
330main_body:
331  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cl.2d.v4f32.f16(i32 15, float %zcompare, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
332  ret <4 x float> %v
333}
334
335define amdgpu_ps <4 x float> @sample_b_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, half %s) {
336; GFX9-LABEL: sample_b_1d:
337; GFX9:       ; %bb.0: ; %main_body
338; GFX9-NEXT:    s_mov_b64 s[12:13], exec
339; GFX9-NEXT:    s_wqm_b64 exec, exec
340; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
341; GFX9-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
342; GFX9-NEXT:    s_waitcnt vmcnt(0)
343; GFX9-NEXT:    ; return to shader part epilog
344;
345; GFX10-LABEL: sample_b_1d:
346; GFX10:       ; %bb.0: ; %main_body
347; GFX10-NEXT:    s_mov_b32 s12, exec_lo
348; GFX10-NEXT:    ; implicit-def: $vcc_hi
349; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
350; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
351; GFX10-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
352; GFX10-NEXT:    s_waitcnt vmcnt(0)
353; GFX10-NEXT:    ; return to shader part epilog
354main_body:
355  %v = call <4 x float> @llvm.amdgcn.image.sample.b.1d.v4f32.f32.f16(i32 15, float %bias, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
356  ret <4 x float> %v
357}
358
359define amdgpu_ps <4 x float> @sample_b_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, half %s, half %t) {
360; GFX9-LABEL: sample_b_2d:
361; GFX9:       ; %bb.0: ; %main_body
362; GFX9-NEXT:    s_mov_b64 s[12:13], exec
363; GFX9-NEXT:    s_wqm_b64 exec, exec
364; GFX9-NEXT:    v_and_b32_e32 v1, 0xffff, v1
365; GFX9-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
366; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
367; GFX9-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
368; GFX9-NEXT:    s_waitcnt vmcnt(0)
369; GFX9-NEXT:    ; return to shader part epilog
370;
371; GFX10-LABEL: sample_b_2d:
372; GFX10:       ; %bb.0: ; %main_body
373; GFX10-NEXT:    s_mov_b32 s12, exec_lo
374; GFX10-NEXT:    ; implicit-def: $vcc_hi
375; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
376; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
377; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
378; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
379; GFX10-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
380; GFX10-NEXT:    s_waitcnt vmcnt(0)
381; GFX10-NEXT:    ; return to shader part epilog
382main_body:
383  %v = call <4 x float> @llvm.amdgcn.image.sample.b.2d.v4f32.f32.f16(i32 15, float %bias, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
384  ret <4 x float> %v
385}
386
387define amdgpu_ps <4 x float> @sample_c_b_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, half %s) {
388; GFX9-LABEL: sample_c_b_1d:
389; GFX9:       ; %bb.0: ; %main_body
390; GFX9-NEXT:    s_mov_b64 s[12:13], exec
391; GFX9-NEXT:    s_wqm_b64 exec, exec
392; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
393; GFX9-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
394; GFX9-NEXT:    s_waitcnt vmcnt(0)
395; GFX9-NEXT:    ; return to shader part epilog
396;
397; GFX10-LABEL: sample_c_b_1d:
398; GFX10:       ; %bb.0: ; %main_body
399; GFX10-NEXT:    s_mov_b32 s12, exec_lo
400; GFX10-NEXT:    ; implicit-def: $vcc_hi
401; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
402; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
403; GFX10-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
404; GFX10-NEXT:    s_waitcnt vmcnt(0)
405; GFX10-NEXT:    ; return to shader part epilog
406main_body:
407  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.1d.v4f32.f32.f16(i32 15, float %bias, float %zcompare, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
408  ret <4 x float> %v
409}
410
411define amdgpu_ps <4 x float> @sample_c_b_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, half %s, half %t) {
412; GFX9-LABEL: sample_c_b_2d:
413; GFX9:       ; %bb.0: ; %main_body
414; GFX9-NEXT:    s_mov_b64 s[12:13], exec
415; GFX9-NEXT:    s_wqm_b64 exec, exec
416; GFX9-NEXT:    v_and_b32_e32 v2, 0xffff, v2
417; GFX9-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
418; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
419; GFX9-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
420; GFX9-NEXT:    s_waitcnt vmcnt(0)
421; GFX9-NEXT:    ; return to shader part epilog
422;
423; GFX10-LABEL: sample_c_b_2d:
424; GFX10:       ; %bb.0: ; %main_body
425; GFX10-NEXT:    s_mov_b32 s12, exec_lo
426; GFX10-NEXT:    ; implicit-def: $vcc_hi
427; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
428; GFX10-NEXT:    v_and_b32_e32 v2, 0xffff, v2
429; GFX10-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
430; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
431; GFX10-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
432; GFX10-NEXT:    s_waitcnt vmcnt(0)
433; GFX10-NEXT:    ; return to shader part epilog
434main_body:
435  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.2d.v4f32.f32.f16(i32 15, float %bias, float %zcompare, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
436  ret <4 x float> %v
437}
438
439define amdgpu_ps <4 x float> @sample_b_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, half %s, half %clamp) {
440; GFX9-LABEL: sample_b_cl_1d:
441; GFX9:       ; %bb.0: ; %main_body
442; GFX9-NEXT:    s_mov_b64 s[12:13], exec
443; GFX9-NEXT:    s_wqm_b64 exec, exec
444; GFX9-NEXT:    v_and_b32_e32 v1, 0xffff, v1
445; GFX9-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
446; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
447; GFX9-NEXT:    image_sample_b_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
448; GFX9-NEXT:    s_waitcnt vmcnt(0)
449; GFX9-NEXT:    ; return to shader part epilog
450;
451; GFX10-LABEL: sample_b_cl_1d:
452; GFX10:       ; %bb.0: ; %main_body
453; GFX10-NEXT:    s_mov_b32 s12, exec_lo
454; GFX10-NEXT:    ; implicit-def: $vcc_hi
455; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
456; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
457; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
458; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
459; GFX10-NEXT:    image_sample_b_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
460; GFX10-NEXT:    s_waitcnt vmcnt(0)
461; GFX10-NEXT:    ; return to shader part epilog
462main_body:
463  %v = call <4 x float> @llvm.amdgcn.image.sample.b.cl.1d.v4f32.f32.f16(i32 15, float %bias, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
464  ret <4 x float> %v
465}
466
467define amdgpu_ps <4 x float> @sample_b_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, half %s, half %t, half %clamp) {
468; GFX9-LABEL: sample_b_cl_2d:
469; GFX9:       ; %bb.0: ; %main_body
470; GFX9-NEXT:    s_mov_b64 s[12:13], exec
471; GFX9-NEXT:    s_wqm_b64 exec, exec
472; GFX9-NEXT:    v_mov_b32_e32 v5, v3
473; GFX9-NEXT:    v_mov_b32_e32 v3, v0
474; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v1
475; GFX9-NEXT:    v_lshl_or_b32 v4, v2, 16, v0
476; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
477; GFX9-NEXT:    image_sample_b_cl v[0:3], v[3:5], s[0:7], s[8:11] dmask:0xf a16
478; GFX9-NEXT:    s_waitcnt vmcnt(0)
479; GFX9-NEXT:    ; return to shader part epilog
480;
481; GFX10-LABEL: sample_b_cl_2d:
482; GFX10:       ; %bb.0: ; %main_body
483; GFX10-NEXT:    s_mov_b32 s12, exec_lo
484; GFX10-NEXT:    ; implicit-def: $vcc_hi
485; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
486; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
487; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
488; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
489; GFX10-NEXT:    image_sample_b_cl v[0:3], [v0, v1, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
490; GFX10-NEXT:    s_waitcnt vmcnt(0)
491; GFX10-NEXT:    ; return to shader part epilog
492main_body:
493  %v = call <4 x float> @llvm.amdgcn.image.sample.b.cl.2d.v4f32.f32.f16(i32 15, float %bias, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
494  ret <4 x float> %v
495}
496
497define amdgpu_ps <4 x float> @sample_c_b_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, half %s, half %clamp) {
498; GFX9-LABEL: sample_c_b_cl_1d:
499; GFX9:       ; %bb.0: ; %main_body
500; GFX9-NEXT:    s_mov_b64 s[12:13], exec
501; GFX9-NEXT:    s_wqm_b64 exec, exec
502; GFX9-NEXT:    v_and_b32_e32 v2, 0xffff, v2
503; GFX9-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
504; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
505; GFX9-NEXT:    image_sample_c_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
506; GFX9-NEXT:    s_waitcnt vmcnt(0)
507; GFX9-NEXT:    ; return to shader part epilog
508;
509; GFX10-LABEL: sample_c_b_cl_1d:
510; GFX10:       ; %bb.0: ; %main_body
511; GFX10-NEXT:    s_mov_b32 s12, exec_lo
512; GFX10-NEXT:    ; implicit-def: $vcc_hi
513; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
514; GFX10-NEXT:    v_and_b32_e32 v2, 0xffff, v2
515; GFX10-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
516; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
517; GFX10-NEXT:    image_sample_c_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
518; GFX10-NEXT:    s_waitcnt vmcnt(0)
519; GFX10-NEXT:    ; return to shader part epilog
520main_body:
521  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.cl.1d.v4f32.f32.f16(i32 15, float %bias, float %zcompare, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
522  ret <4 x float> %v
523}
524
525define amdgpu_ps <4 x float> @sample_c_b_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, half %s, half %t, half %clamp) {
526; GFX9-LABEL: sample_c_b_cl_2d:
527; GFX9:       ; %bb.0: ; %main_body
528; GFX9-NEXT:    s_mov_b64 s[12:13], exec
529; GFX9-NEXT:    s_wqm_b64 exec, exec
530; GFX9-NEXT:    v_mov_b32_e32 v7, v4
531; GFX9-NEXT:    v_mov_b32_e32 v4, v0
532; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v2
533; GFX9-NEXT:    v_mov_b32_e32 v5, v1
534; GFX9-NEXT:    v_lshl_or_b32 v6, v3, 16, v0
535; GFX9-NEXT:    s_and_b64 exec, exec, s[12:13]
536; GFX9-NEXT:    image_sample_c_b_cl v[0:3], v[4:7], s[0:7], s[8:11] dmask:0xf a16
537; GFX9-NEXT:    s_waitcnt vmcnt(0)
538; GFX9-NEXT:    ; return to shader part epilog
539;
540; GFX10-LABEL: sample_c_b_cl_2d:
541; GFX10:       ; %bb.0: ; %main_body
542; GFX10-NEXT:    s_mov_b32 s12, exec_lo
543; GFX10-NEXT:    ; implicit-def: $vcc_hi
544; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo
545; GFX10-NEXT:    v_and_b32_e32 v2, 0xffff, v2
546; GFX10-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
547; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12
548; GFX10-NEXT:    image_sample_c_b_cl v[0:3], [v0, v1, v2, v4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
549; GFX10-NEXT:    s_waitcnt vmcnt(0)
550; GFX10-NEXT:    ; return to shader part epilog
551main_body:
552  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.cl.2d.v4f32.f32.f16(i32 15, float %bias, float %zcompare, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
553  ret <4 x float> %v
554}
555
556define amdgpu_ps <4 x float> @sample_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s) {
557; GFX9-LABEL: sample_d_1d:
558; GFX9:       ; %bb.0: ; %main_body
559; GFX9-NEXT:    image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
560; GFX9-NEXT:    s_waitcnt vmcnt(0)
561; GFX9-NEXT:    ; return to shader part epilog
562;
563; GFX10-LABEL: sample_d_1d:
564; GFX10:       ; %bb.0: ; %main_body
565; GFX10-NEXT:    image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
566; GFX10-NEXT:    ; implicit-def: $vcc_hi
567; GFX10-NEXT:    s_waitcnt vmcnt(0)
568; GFX10-NEXT:    ; return to shader part epilog
569main_body:
570  %v = call <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f16.f16(i32 15, half %dsdh, half %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
571  ret <4 x float> %v
572}
573
574define amdgpu_ps <4 x float> @sample_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t) {
575; GFX9-LABEL: sample_d_2d:
576; GFX9:       ; %bb.0: ; %main_body
577; GFX9-NEXT:    v_mov_b32_e32 v6, 0xffff
578; GFX9-NEXT:    v_and_b32_e32 v4, v6, v4
579; GFX9-NEXT:    v_and_b32_e32 v2, v6, v2
580; GFX9-NEXT:    v_and_b32_e32 v0, v6, v0
581; GFX9-NEXT:    v_lshl_or_b32 v3, v3, 16, v2
582; GFX9-NEXT:    v_lshl_or_b32 v4, v5, 16, v4
583; GFX9-NEXT:    v_lshl_or_b32 v2, v1, 16, v0
584; GFX9-NEXT:    image_sample_d v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf a16
585; GFX9-NEXT:    s_waitcnt vmcnt(0)
586; GFX9-NEXT:    ; return to shader part epilog
587;
588; GFX10-LABEL: sample_d_2d:
589; GFX10:       ; %bb.0: ; %main_body
590; GFX10-NEXT:    v_mov_b32_e32 v7, 0xffff
591; GFX10-NEXT:    ; implicit-def: $vcc_hi
592; GFX10-NEXT:    v_and_b32_e32 v4, v7, v4
593; GFX10-NEXT:    v_and_b32_e32 v2, v7, v2
594; GFX10-NEXT:    v_and_b32_e32 v0, v7, v0
595; GFX10-NEXT:    v_lshl_or_b32 v4, v5, 16, v4
596; GFX10-NEXT:    v_lshl_or_b32 v3, v3, 16, v2
597; GFX10-NEXT:    v_lshl_or_b32 v2, v1, 16, v0
598; GFX10-NEXT:    image_sample_d v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
599; GFX10-NEXT:    s_waitcnt vmcnt(0)
600; GFX10-NEXT:    ; return to shader part epilog
601main_body:
602  %v = call <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f16.f16(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
603  ret <4 x float> %v
604}
605
606define amdgpu_ps <4 x float> @sample_d_3d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %drdh, half %dsdv, half %dtdv, half %drdv, half %s, half %t, half %r) {
607; GFX9-LABEL: sample_d_3d:
608; GFX9:       ; %bb.0: ; %main_body
609; GFX9-NEXT:    v_mov_b32_e32 v12, v8
610; GFX9-NEXT:    v_mov_b32_e32 v8, v2
611; GFX9-NEXT:    v_mov_b32_e32 v2, 0xffff
612; GFX9-NEXT:    v_mov_b32_e32 v10, v5
613; GFX9-NEXT:    v_and_b32_e32 v5, v2, v6
614; GFX9-NEXT:    v_and_b32_e32 v3, v2, v3
615; GFX9-NEXT:    v_and_b32_e32 v0, v2, v0
616; GFX9-NEXT:    v_lshl_or_b32 v11, v7, 16, v5
617; GFX9-NEXT:    v_lshl_or_b32 v9, v4, 16, v3
618; GFX9-NEXT:    v_lshl_or_b32 v7, v1, 16, v0
619; GFX9-NEXT:    image_sample_d v[0:3], v[7:14], s[0:7], s[8:11] dmask:0xf a16
620; GFX9-NEXT:    s_waitcnt vmcnt(0)
621; GFX9-NEXT:    ; return to shader part epilog
622;
623; GFX10-LABEL: sample_d_3d:
624; GFX10:       ; %bb.0: ; %main_body
625; GFX10-NEXT:    v_mov_b32_e32 v9, 0xffff
626; GFX10-NEXT:    ; implicit-def: $vcc_hi
627; GFX10-NEXT:    v_and_b32_e32 v6, v9, v6
628; GFX10-NEXT:    v_and_b32_e32 v3, v9, v3
629; GFX10-NEXT:    v_and_b32_e32 v0, v9, v0
630; GFX10-NEXT:    v_lshl_or_b32 v6, v7, 16, v6
631; GFX10-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
632; GFX10-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
633; GFX10-NEXT:    image_sample_d v[0:3], [v0, v2, v3, v5, v6, v8], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D a16
634; GFX10-NEXT:    s_waitcnt vmcnt(0)
635; GFX10-NEXT:    ; return to shader part epilog
636main_body:
637  %v = call <4 x float> @llvm.amdgcn.image.sample.d.3d.v4f32.f16.f16(i32 15, half %dsdh, half %dtdh, half %drdh, half %dsdv, half %dtdv, half %drdv, half %s, half %t, half %r, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
638  ret <4 x float> %v
639}
640
641define amdgpu_ps <4 x float> @sample_c_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, half %s) {
642; GFX9-LABEL: sample_c_d_1d:
643; GFX9:       ; %bb.0: ; %main_body
644; GFX9-NEXT:    image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
645; GFX9-NEXT:    s_waitcnt vmcnt(0)
646; GFX9-NEXT:    ; return to shader part epilog
647;
648; GFX10-LABEL: sample_c_d_1d:
649; GFX10:       ; %bb.0: ; %main_body
650; GFX10-NEXT:    image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
651; GFX10-NEXT:    ; implicit-def: $vcc_hi
652; GFX10-NEXT:    s_waitcnt vmcnt(0)
653; GFX10-NEXT:    ; return to shader part epilog
654main_body:
655  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
656  ret <4 x float> %v
657}
658
659define amdgpu_ps <4 x float> @sample_c_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t) {
660; GFX9-LABEL: sample_c_d_2d:
661; GFX9:       ; %bb.0: ; %main_body
662; GFX9-NEXT:    v_mov_b32_e32 v9, 0xffff
663; GFX9-NEXT:    v_mov_b32_e32 v8, v2
664; GFX9-NEXT:    v_mov_b32_e32 v7, v3
665; GFX9-NEXT:    v_and_b32_e32 v2, v9, v5
666; GFX9-NEXT:    v_and_b32_e32 v1, v9, v1
667; GFX9-NEXT:    v_lshl_or_b32 v3, v6, 16, v2
668; GFX9-NEXT:    v_and_b32_e32 v2, v9, v7
669; GFX9-NEXT:    v_lshl_or_b32 v2, v4, 16, v2
670; GFX9-NEXT:    v_lshl_or_b32 v1, v8, 16, v1
671; GFX9-NEXT:    image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
672; GFX9-NEXT:    s_waitcnt vmcnt(0)
673; GFX9-NEXT:    ; return to shader part epilog
674;
675; GFX10-LABEL: sample_c_d_2d:
676; GFX10:       ; %bb.0: ; %main_body
677; GFX10-NEXT:    v_mov_b32_e32 v10, 0xffff
678; GFX10-NEXT:    ; implicit-def: $vcc_hi
679; GFX10-NEXT:    v_and_b32_e32 v5, v10, v5
680; GFX10-NEXT:    v_and_b32_e32 v3, v10, v3
681; GFX10-NEXT:    v_and_b32_e32 v1, v10, v1
682; GFX10-NEXT:    v_lshl_or_b32 v5, v6, 16, v5
683; GFX10-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
684; GFX10-NEXT:    v_lshl_or_b32 v2, v2, 16, v1
685; GFX10-NEXT:    image_sample_c_d v[0:3], [v0, v2, v3, v5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
686; GFX10-NEXT:    s_waitcnt vmcnt(0)
687; GFX10-NEXT:    ; return to shader part epilog
688main_body:
689  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
690  ret <4 x float> %v
691}
692
693define amdgpu_ps <4 x float> @sample_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s, half %clamp) {
694; GFX9-LABEL: sample_d_cl_1d:
695; GFX9:       ; %bb.0: ; %main_body
696; GFX9-NEXT:    v_and_b32_e32 v2, 0xffff, v2
697; GFX9-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
698; GFX9-NEXT:    image_sample_d_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
699; GFX9-NEXT:    s_waitcnt vmcnt(0)
700; GFX9-NEXT:    ; return to shader part epilog
701;
702; GFX10-LABEL: sample_d_cl_1d:
703; GFX10:       ; %bb.0: ; %main_body
704; GFX10-NEXT:    v_and_b32_e32 v2, 0xffff, v2
705; GFX10-NEXT:    ; implicit-def: $vcc_hi
706; GFX10-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
707; GFX10-NEXT:    image_sample_d_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
708; GFX10-NEXT:    s_waitcnt vmcnt(0)
709; GFX10-NEXT:    ; return to shader part epilog
710main_body:
711  %v = call <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f16.f16(i32 15, half %dsdh, half %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
712  ret <4 x float> %v
713}
714
715define amdgpu_ps <4 x float> @sample_d_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp) {
716; GFX9-LABEL: sample_d_cl_2d:
717; GFX9:       ; %bb.0: ; %main_body
718; GFX9-NEXT:    v_mov_b32_e32 v7, 0xffff
719; GFX9-NEXT:    v_and_b32_e32 v4, v7, v4
720; GFX9-NEXT:    v_and_b32_e32 v2, v7, v2
721; GFX9-NEXT:    v_and_b32_e32 v0, v7, v0
722; GFX9-NEXT:    v_lshl_or_b32 v5, v5, 16, v4
723; GFX9-NEXT:    v_lshl_or_b32 v4, v3, 16, v2
724; GFX9-NEXT:    v_lshl_or_b32 v3, v1, 16, v0
725; GFX9-NEXT:    image_sample_d_cl v[0:3], v[3:6], s[0:7], s[8:11] dmask:0xf a16
726; GFX9-NEXT:    s_waitcnt vmcnt(0)
727; GFX9-NEXT:    ; return to shader part epilog
728;
729; GFX10-LABEL: sample_d_cl_2d:
730; GFX10:       ; %bb.0: ; %main_body
731; GFX10-NEXT:    v_mov_b32_e32 v7, 0xffff
732; GFX10-NEXT:    ; implicit-def: $vcc_hi
733; GFX10-NEXT:    v_and_b32_e32 v4, v7, v4
734; GFX10-NEXT:    v_and_b32_e32 v2, v7, v2
735; GFX10-NEXT:    v_and_b32_e32 v0, v7, v0
736; GFX10-NEXT:    v_lshl_or_b32 v4, v5, 16, v4
737; GFX10-NEXT:    v_lshl_or_b32 v5, v3, 16, v2
738; GFX10-NEXT:    v_lshl_or_b32 v3, v1, 16, v0
739; GFX10-NEXT:    image_sample_d_cl v[0:3], [v3, v5, v4, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
740; GFX10-NEXT:    s_waitcnt vmcnt(0)
741; GFX10-NEXT:    ; return to shader part epilog
742main_body:
743  %v = call <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f16.f16(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
744  ret <4 x float> %v
745}
746
747define amdgpu_ps <4 x float> @sample_c_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, half %s, half %clamp) {
748; GFX9-LABEL: sample_c_d_cl_1d:
749; GFX9:       ; %bb.0: ; %main_body
750; GFX9-NEXT:    v_and_b32_e32 v3, 0xffff, v3
751; GFX9-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
752; GFX9-NEXT:    image_sample_c_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
753; GFX9-NEXT:    s_waitcnt vmcnt(0)
754; GFX9-NEXT:    ; return to shader part epilog
755;
756; GFX10-LABEL: sample_c_d_cl_1d:
757; GFX10:       ; %bb.0: ; %main_body
758; GFX10-NEXT:    v_and_b32_e32 v3, 0xffff, v3
759; GFX10-NEXT:    ; implicit-def: $vcc_hi
760; GFX10-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
761; GFX10-NEXT:    image_sample_c_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
762; GFX10-NEXT:    s_waitcnt vmcnt(0)
763; GFX10-NEXT:    ; return to shader part epilog
764main_body:
765  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
766  ret <4 x float> %v
767}
768
769define amdgpu_ps <4 x float> @sample_c_d_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp) {
770; GFX9-LABEL: sample_c_d_cl_2d:
771; GFX9:       ; %bb.0: ; %main_body
772; GFX9-NEXT:    v_mov_b32_e32 v11, v7
773; GFX9-NEXT:    v_mov_b32_e32 v7, v0
774; GFX9-NEXT:    v_mov_b32_e32 v0, 0xffff
775; GFX9-NEXT:    v_and_b32_e32 v5, v0, v5
776; GFX9-NEXT:    v_and_b32_e32 v3, v0, v3
777; GFX9-NEXT:    v_and_b32_e32 v0, v0, v1
778; GFX9-NEXT:    v_lshl_or_b32 v10, v6, 16, v5
779; GFX9-NEXT:    v_lshl_or_b32 v9, v4, 16, v3
780; GFX9-NEXT:    v_lshl_or_b32 v8, v2, 16, v0
781; GFX9-NEXT:    image_sample_c_d_cl v[0:3], v[7:14], s[0:7], s[8:11] dmask:0xf a16
782; GFX9-NEXT:    s_waitcnt vmcnt(0)
783; GFX9-NEXT:    ; return to shader part epilog
784;
785; GFX10-LABEL: sample_c_d_cl_2d:
786; GFX10:       ; %bb.0: ; %main_body
787; GFX10-NEXT:    v_mov_b32_e32 v8, 0xffff
788; GFX10-NEXT:    ; implicit-def: $vcc_hi
789; GFX10-NEXT:    v_and_b32_e32 v5, v8, v5
790; GFX10-NEXT:    v_and_b32_e32 v3, v8, v3
791; GFX10-NEXT:    v_and_b32_e32 v1, v8, v1
792; GFX10-NEXT:    v_lshl_or_b32 v5, v6, 16, v5
793; GFX10-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
794; GFX10-NEXT:    v_lshl_or_b32 v2, v2, 16, v1
795; GFX10-NEXT:    image_sample_c_d_cl v[0:3], [v0, v2, v3, v5, v7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
796; GFX10-NEXT:    s_waitcnt vmcnt(0)
797; GFX10-NEXT:    ; return to shader part epilog
798main_body:
799  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
800  ret <4 x float> %v
801}
802
803define amdgpu_ps <4 x float> @sample_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s) {
804; GFX9-LABEL: sample_cd_1d:
805; GFX9:       ; %bb.0: ; %main_body
806; GFX9-NEXT:    image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
807; GFX9-NEXT:    s_waitcnt vmcnt(0)
808; GFX9-NEXT:    ; return to shader part epilog
809;
810; GFX10-LABEL: sample_cd_1d:
811; GFX10:       ; %bb.0: ; %main_body
812; GFX10-NEXT:    image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
813; GFX10-NEXT:    ; implicit-def: $vcc_hi
814; GFX10-NEXT:    s_waitcnt vmcnt(0)
815; GFX10-NEXT:    ; return to shader part epilog
816main_body:
817  %v = call <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f16.f16(i32 15, half %dsdh, half %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
818  ret <4 x float> %v
819}
820
821define amdgpu_ps <4 x float> @sample_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t) {
822; GFX9-LABEL: sample_cd_2d:
823; GFX9:       ; %bb.0: ; %main_body
824; GFX9-NEXT:    v_mov_b32_e32 v6, 0xffff
825; GFX9-NEXT:    v_and_b32_e32 v4, v6, v4
826; GFX9-NEXT:    v_and_b32_e32 v2, v6, v2
827; GFX9-NEXT:    v_and_b32_e32 v0, v6, v0
828; GFX9-NEXT:    v_lshl_or_b32 v3, v3, 16, v2
829; GFX9-NEXT:    v_lshl_or_b32 v4, v5, 16, v4
830; GFX9-NEXT:    v_lshl_or_b32 v2, v1, 16, v0
831; GFX9-NEXT:    image_sample_cd v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf a16
832; GFX9-NEXT:    s_waitcnt vmcnt(0)
833; GFX9-NEXT:    ; return to shader part epilog
834;
835; GFX10-LABEL: sample_cd_2d:
836; GFX10:       ; %bb.0: ; %main_body
837; GFX10-NEXT:    v_mov_b32_e32 v7, 0xffff
838; GFX10-NEXT:    ; implicit-def: $vcc_hi
839; GFX10-NEXT:    v_and_b32_e32 v4, v7, v4
840; GFX10-NEXT:    v_and_b32_e32 v2, v7, v2
841; GFX10-NEXT:    v_and_b32_e32 v0, v7, v0
842; GFX10-NEXT:    v_lshl_or_b32 v4, v5, 16, v4
843; GFX10-NEXT:    v_lshl_or_b32 v3, v3, 16, v2
844; GFX10-NEXT:    v_lshl_or_b32 v2, v1, 16, v0
845; GFX10-NEXT:    image_sample_cd v[0:3], v[2:4], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
846; GFX10-NEXT:    s_waitcnt vmcnt(0)
847; GFX10-NEXT:    ; return to shader part epilog
848main_body:
849  %v = call <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f16.f16(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
850  ret <4 x float> %v
851}
852
853define amdgpu_ps <4 x float> @sample_c_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, half %s) {
854; GFX9-LABEL: sample_c_cd_1d:
855; GFX9:       ; %bb.0: ; %main_body
856; GFX9-NEXT:    image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
857; GFX9-NEXT:    s_waitcnt vmcnt(0)
858; GFX9-NEXT:    ; return to shader part epilog
859;
860; GFX10-LABEL: sample_c_cd_1d:
861; GFX10:       ; %bb.0: ; %main_body
862; GFX10-NEXT:    image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
863; GFX10-NEXT:    ; implicit-def: $vcc_hi
864; GFX10-NEXT:    s_waitcnt vmcnt(0)
865; GFX10-NEXT:    ; return to shader part epilog
866main_body:
867  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dsdv, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
868  ret <4 x float> %v
869}
870
871define amdgpu_ps <4 x float> @sample_c_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t) {
872; GFX9-LABEL: sample_c_cd_2d:
873; GFX9:       ; %bb.0: ; %main_body
874; GFX9-NEXT:    v_mov_b32_e32 v9, 0xffff
875; GFX9-NEXT:    v_mov_b32_e32 v8, v2
876; GFX9-NEXT:    v_mov_b32_e32 v7, v3
877; GFX9-NEXT:    v_and_b32_e32 v2, v9, v5
878; GFX9-NEXT:    v_and_b32_e32 v1, v9, v1
879; GFX9-NEXT:    v_lshl_or_b32 v3, v6, 16, v2
880; GFX9-NEXT:    v_and_b32_e32 v2, v9, v7
881; GFX9-NEXT:    v_lshl_or_b32 v2, v4, 16, v2
882; GFX9-NEXT:    v_lshl_or_b32 v1, v8, 16, v1
883; GFX9-NEXT:    image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
884; GFX9-NEXT:    s_waitcnt vmcnt(0)
885; GFX9-NEXT:    ; return to shader part epilog
886;
887; GFX10-LABEL: sample_c_cd_2d:
888; GFX10:       ; %bb.0: ; %main_body
889; GFX10-NEXT:    v_mov_b32_e32 v10, 0xffff
890; GFX10-NEXT:    ; implicit-def: $vcc_hi
891; GFX10-NEXT:    v_and_b32_e32 v5, v10, v5
892; GFX10-NEXT:    v_and_b32_e32 v3, v10, v3
893; GFX10-NEXT:    v_and_b32_e32 v1, v10, v1
894; GFX10-NEXT:    v_lshl_or_b32 v5, v6, 16, v5
895; GFX10-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
896; GFX10-NEXT:    v_lshl_or_b32 v2, v2, 16, v1
897; GFX10-NEXT:    image_sample_c_cd v[0:3], [v0, v2, v3, v5], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
898; GFX10-NEXT:    s_waitcnt vmcnt(0)
899; GFX10-NEXT:    ; return to shader part epilog
900main_body:
901  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
902  ret <4 x float> %v
903}
904
905define amdgpu_ps <4 x float> @sample_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dsdv, half %s, half %clamp) {
906; GFX9-LABEL: sample_cd_cl_1d:
907; GFX9:       ; %bb.0: ; %main_body
908; GFX9-NEXT:    v_and_b32_e32 v2, 0xffff, v2
909; GFX9-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
910; GFX9-NEXT:    image_sample_cd_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf a16
911; GFX9-NEXT:    s_waitcnt vmcnt(0)
912; GFX9-NEXT:    ; return to shader part epilog
913;
914; GFX10-LABEL: sample_cd_cl_1d:
915; GFX10:       ; %bb.0: ; %main_body
916; GFX10-NEXT:    v_and_b32_e32 v2, 0xffff, v2
917; GFX10-NEXT:    ; implicit-def: $vcc_hi
918; GFX10-NEXT:    v_lshl_or_b32 v2, v3, 16, v2
919; GFX10-NEXT:    image_sample_cd_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
920; GFX10-NEXT:    s_waitcnt vmcnt(0)
921; GFX10-NEXT:    ; return to shader part epilog
922main_body:
923  %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f16.f16(i32 15, half %dsdh, half %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
924  ret <4 x float> %v
925}
926
927define amdgpu_ps <4 x float> @sample_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp) {
928; GFX9-LABEL: sample_cd_cl_2d:
929; GFX9:       ; %bb.0: ; %main_body
930; GFX9-NEXT:    v_mov_b32_e32 v7, 0xffff
931; GFX9-NEXT:    v_and_b32_e32 v4, v7, v4
932; GFX9-NEXT:    v_and_b32_e32 v2, v7, v2
933; GFX9-NEXT:    v_and_b32_e32 v0, v7, v0
934; GFX9-NEXT:    v_lshl_or_b32 v5, v5, 16, v4
935; GFX9-NEXT:    v_lshl_or_b32 v4, v3, 16, v2
936; GFX9-NEXT:    v_lshl_or_b32 v3, v1, 16, v0
937; GFX9-NEXT:    image_sample_cd_cl v[0:3], v[3:6], s[0:7], s[8:11] dmask:0xf a16
938; GFX9-NEXT:    s_waitcnt vmcnt(0)
939; GFX9-NEXT:    ; return to shader part epilog
940;
941; GFX10-LABEL: sample_cd_cl_2d:
942; GFX10:       ; %bb.0: ; %main_body
943; GFX10-NEXT:    v_mov_b32_e32 v7, 0xffff
944; GFX10-NEXT:    ; implicit-def: $vcc_hi
945; GFX10-NEXT:    v_and_b32_e32 v4, v7, v4
946; GFX10-NEXT:    v_and_b32_e32 v2, v7, v2
947; GFX10-NEXT:    v_and_b32_e32 v0, v7, v0
948; GFX10-NEXT:    v_lshl_or_b32 v4, v5, 16, v4
949; GFX10-NEXT:    v_lshl_or_b32 v5, v3, 16, v2
950; GFX10-NEXT:    v_lshl_or_b32 v3, v1, 16, v0
951; GFX10-NEXT:    image_sample_cd_cl v[0:3], [v3, v5, v4, v6], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
952; GFX10-NEXT:    s_waitcnt vmcnt(0)
953; GFX10-NEXT:    ; return to shader part epilog
954main_body:
955  %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f16.f16(i32 15, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
956  ret <4 x float> %v
957}
958
959define amdgpu_ps <4 x float> @sample_c_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dsdv, half %s, half %clamp) {
960; GFX9-LABEL: sample_c_cd_cl_1d:
961; GFX9:       ; %bb.0: ; %main_body
962; GFX9-NEXT:    v_and_b32_e32 v3, 0xffff, v3
963; GFX9-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
964; GFX9-NEXT:    image_sample_c_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf a16
965; GFX9-NEXT:    s_waitcnt vmcnt(0)
966; GFX9-NEXT:    ; return to shader part epilog
967;
968; GFX10-LABEL: sample_c_cd_cl_1d:
969; GFX10:       ; %bb.0: ; %main_body
970; GFX10-NEXT:    v_and_b32_e32 v3, 0xffff, v3
971; GFX10-NEXT:    ; implicit-def: $vcc_hi
972; GFX10-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
973; GFX10-NEXT:    image_sample_c_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
974; GFX10-NEXT:    s_waitcnt vmcnt(0)
975; GFX10-NEXT:    ; return to shader part epilog
976main_body:
977  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dsdv, half %s, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
978  ret <4 x float> %v
979}
980
981define amdgpu_ps <4 x float> @sample_c_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp) {
982; GFX9-LABEL: sample_c_cd_cl_2d:
983; GFX9:       ; %bb.0: ; %main_body
984; GFX9-NEXT:    v_mov_b32_e32 v11, v7
985; GFX9-NEXT:    v_mov_b32_e32 v7, v0
986; GFX9-NEXT:    v_mov_b32_e32 v0, 0xffff
987; GFX9-NEXT:    v_and_b32_e32 v5, v0, v5
988; GFX9-NEXT:    v_and_b32_e32 v3, v0, v3
989; GFX9-NEXT:    v_and_b32_e32 v0, v0, v1
990; GFX9-NEXT:    v_lshl_or_b32 v10, v6, 16, v5
991; GFX9-NEXT:    v_lshl_or_b32 v9, v4, 16, v3
992; GFX9-NEXT:    v_lshl_or_b32 v8, v2, 16, v0
993; GFX9-NEXT:    image_sample_c_cd_cl v[0:3], v[7:14], s[0:7], s[8:11] dmask:0xf a16
994; GFX9-NEXT:    s_waitcnt vmcnt(0)
995; GFX9-NEXT:    ; return to shader part epilog
996;
997; GFX10-LABEL: sample_c_cd_cl_2d:
998; GFX10:       ; %bb.0: ; %main_body
999; GFX10-NEXT:    v_mov_b32_e32 v8, 0xffff
1000; GFX10-NEXT:    ; implicit-def: $vcc_hi
1001; GFX10-NEXT:    v_and_b32_e32 v5, v8, v5
1002; GFX10-NEXT:    v_and_b32_e32 v3, v8, v3
1003; GFX10-NEXT:    v_and_b32_e32 v1, v8, v1
1004; GFX10-NEXT:    v_lshl_or_b32 v5, v6, 16, v5
1005; GFX10-NEXT:    v_lshl_or_b32 v3, v4, 16, v3
1006; GFX10-NEXT:    v_lshl_or_b32 v2, v2, 16, v1
1007; GFX10-NEXT:    image_sample_c_cd_cl v[0:3], [v0, v2, v3, v5, v7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
1008; GFX10-NEXT:    s_waitcnt vmcnt(0)
1009; GFX10-NEXT:    ; return to shader part epilog
1010main_body:
1011  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f16(i32 15, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1012  ret <4 x float> %v
1013}
1014
1015define amdgpu_ps <4 x float> @sample_l_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %lod) {
1016; GFX9-LABEL: sample_l_1d:
1017; GFX9:       ; %bb.0: ; %main_body
1018; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
1019; GFX9-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
1020; GFX9-NEXT:    image_sample_l v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
1021; GFX9-NEXT:    s_waitcnt vmcnt(0)
1022; GFX9-NEXT:    ; return to shader part epilog
1023;
1024; GFX10-LABEL: sample_l_1d:
1025; GFX10:       ; %bb.0: ; %main_body
1026; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
1027; GFX10-NEXT:    ; implicit-def: $vcc_hi
1028; GFX10-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
1029; GFX10-NEXT:    image_sample_l v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
1030; GFX10-NEXT:    s_waitcnt vmcnt(0)
1031; GFX10-NEXT:    ; return to shader part epilog
1032main_body:
1033  %v = call <4 x float> @llvm.amdgcn.image.sample.l.1d.v4f32.f16(i32 15, half %s, half %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1034  ret <4 x float> %v
1035}
1036
1037define amdgpu_ps <4 x float> @sample_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t, half %lod) {
1038; GFX9-LABEL: sample_l_2d:
1039; GFX9:       ; %bb.0: ; %main_body
1040; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
1041; GFX9-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
1042; GFX9-NEXT:    image_sample_l v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf a16
1043; GFX9-NEXT:    s_waitcnt vmcnt(0)
1044; GFX9-NEXT:    ; return to shader part epilog
1045;
1046; GFX10-LABEL: sample_l_2d:
1047; GFX10:       ; %bb.0: ; %main_body
1048; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
1049; GFX10-NEXT:    ; implicit-def: $vcc_hi
1050; GFX10-NEXT:    v_lshl_or_b32 v1, v1, 16, v0
1051; GFX10-NEXT:    image_sample_l v[0:3], v[1:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
1052; GFX10-NEXT:    s_waitcnt vmcnt(0)
1053; GFX10-NEXT:    ; return to shader part epilog
1054main_body:
1055  %v = call <4 x float> @llvm.amdgcn.image.sample.l.2d.v4f32.f16(i32 15, half %s, half %t, half %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1056  ret <4 x float> %v
1057}
1058
1059define amdgpu_ps <4 x float> @sample_c_l_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %lod) {
1060; GFX9-LABEL: sample_c_l_1d:
1061; GFX9:       ; %bb.0: ; %main_body
1062; GFX9-NEXT:    v_and_b32_e32 v1, 0xffff, v1
1063; GFX9-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
1064; GFX9-NEXT:    image_sample_c_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
1065; GFX9-NEXT:    s_waitcnt vmcnt(0)
1066; GFX9-NEXT:    ; return to shader part epilog
1067;
1068; GFX10-LABEL: sample_c_l_1d:
1069; GFX10:       ; %bb.0: ; %main_body
1070; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
1071; GFX10-NEXT:    ; implicit-def: $vcc_hi
1072; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
1073; GFX10-NEXT:    image_sample_c_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
1074; GFX10-NEXT:    s_waitcnt vmcnt(0)
1075; GFX10-NEXT:    ; return to shader part epilog
1076main_body:
1077  %v = call <4 x float> @llvm.amdgcn.image.sample.c.l.1d.v4f32.f16(i32 15, float %zcompare, half %s, half %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1078  ret <4 x float> %v
1079}
1080
1081define amdgpu_ps <4 x float> @sample_c_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t, half %lod) {
1082; GFX9-LABEL: sample_c_l_2d:
1083; GFX9:       ; %bb.0: ; %main_body
1084; GFX9-NEXT:    v_mov_b32_e32 v5, v3
1085; GFX9-NEXT:    v_mov_b32_e32 v3, v0
1086; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v1
1087; GFX9-NEXT:    v_lshl_or_b32 v4, v2, 16, v0
1088; GFX9-NEXT:    image_sample_c_l v[0:3], v[3:5], s[0:7], s[8:11] dmask:0xf a16
1089; GFX9-NEXT:    s_waitcnt vmcnt(0)
1090; GFX9-NEXT:    ; return to shader part epilog
1091;
1092; GFX10-LABEL: sample_c_l_2d:
1093; GFX10:       ; %bb.0: ; %main_body
1094; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
1095; GFX10-NEXT:    ; implicit-def: $vcc_hi
1096; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
1097; GFX10-NEXT:    image_sample_c_l v[0:3], [v0, v1, v3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
1098; GFX10-NEXT:    s_waitcnt vmcnt(0)
1099; GFX10-NEXT:    ; return to shader part epilog
1100main_body:
1101  %v = call <4 x float> @llvm.amdgcn.image.sample.c.l.2d.v4f32.f16(i32 15, float %zcompare, half %s, half %t, half %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1102  ret <4 x float> %v
1103}
1104
1105define amdgpu_ps <4 x float> @sample_lz_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s) {
1106; GFX9-LABEL: sample_lz_1d:
1107; GFX9:       ; %bb.0: ; %main_body
1108; GFX9-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
1109; GFX9-NEXT:    s_waitcnt vmcnt(0)
1110; GFX9-NEXT:    ; return to shader part epilog
1111;
1112; GFX10-LABEL: sample_lz_1d:
1113; GFX10:       ; %bb.0: ; %main_body
1114; GFX10-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
1115; GFX10-NEXT:    ; implicit-def: $vcc_hi
1116; GFX10-NEXT:    s_waitcnt vmcnt(0)
1117; GFX10-NEXT:    ; return to shader part epilog
1118main_body:
1119  %v = call <4 x float> @llvm.amdgcn.image.sample.lz.1d.v4f32.f16(i32 15, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1120  ret <4 x float> %v
1121}
1122
1123define amdgpu_ps <4 x float> @sample_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, half %s, half %t) {
1124; GFX9-LABEL: sample_lz_2d:
1125; GFX9:       ; %bb.0: ; %main_body
1126; GFX9-NEXT:    v_and_b32_e32 v0, 0xffff, v0
1127; GFX9-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
1128; GFX9-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf a16
1129; GFX9-NEXT:    s_waitcnt vmcnt(0)
1130; GFX9-NEXT:    ; return to shader part epilog
1131;
1132; GFX10-LABEL: sample_lz_2d:
1133; GFX10:       ; %bb.0: ; %main_body
1134; GFX10-NEXT:    v_and_b32_e32 v0, 0xffff, v0
1135; GFX10-NEXT:    ; implicit-def: $vcc_hi
1136; GFX10-NEXT:    v_lshl_or_b32 v0, v1, 16, v0
1137; GFX10-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
1138; GFX10-NEXT:    s_waitcnt vmcnt(0)
1139; GFX10-NEXT:    ; return to shader part epilog
1140main_body:
1141  %v = call <4 x float> @llvm.amdgcn.image.sample.lz.2d.v4f32.f16(i32 15, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1142  ret <4 x float> %v
1143}
1144
1145define amdgpu_ps <4 x float> @sample_c_lz_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s) {
1146; GFX9-LABEL: sample_c_lz_1d:
1147; GFX9:       ; %bb.0: ; %main_body
1148; GFX9-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
1149; GFX9-NEXT:    s_waitcnt vmcnt(0)
1150; GFX9-NEXT:    ; return to shader part epilog
1151;
1152; GFX10-LABEL: sample_c_lz_1d:
1153; GFX10:       ; %bb.0: ; %main_body
1154; GFX10-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D a16
1155; GFX10-NEXT:    ; implicit-def: $vcc_hi
1156; GFX10-NEXT:    s_waitcnt vmcnt(0)
1157; GFX10-NEXT:    ; return to shader part epilog
1158main_body:
1159  %v = call <4 x float> @llvm.amdgcn.image.sample.c.lz.1d.v4f32.f16(i32 15, float %zcompare, half %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1160  ret <4 x float> %v
1161}
1162
1163define amdgpu_ps <4 x float> @sample_c_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, half %s, half %t) {
1164; GFX9-LABEL: sample_c_lz_2d:
1165; GFX9:       ; %bb.0: ; %main_body
1166; GFX9-NEXT:    v_and_b32_e32 v1, 0xffff, v1
1167; GFX9-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
1168; GFX9-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf a16
1169; GFX9-NEXT:    s_waitcnt vmcnt(0)
1170; GFX9-NEXT:    ; return to shader part epilog
1171;
1172; GFX10-LABEL: sample_c_lz_2d:
1173; GFX10:       ; %bb.0: ; %main_body
1174; GFX10-NEXT:    v_and_b32_e32 v1, 0xffff, v1
1175; GFX10-NEXT:    ; implicit-def: $vcc_hi
1176; GFX10-NEXT:    v_lshl_or_b32 v1, v2, 16, v1
1177; GFX10-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D a16
1178; GFX10-NEXT:    s_waitcnt vmcnt(0)
1179; GFX10-NEXT:    ; return to shader part epilog
1180main_body:
1181  %v = call <4 x float> @llvm.amdgcn.image.sample.c.lz.2d.v4f32.f16(i32 15, float %zcompare, half %s, half %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1182  ret <4 x float> %v
1183}
1184
1185define amdgpu_ps float @sample_c_d_o_2darray_V1(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %slice) {
1186; GFX9-LABEL: sample_c_d_o_2darray_V1:
1187; GFX9:       ; %bb.0: ; %main_body
1188; GFX9-NEXT:    v_mov_b32_e32 v13, v8
1189; GFX9-NEXT:    v_mov_b32_e32 v8, v0
1190; GFX9-NEXT:    v_mov_b32_e32 v0, 0xffff
1191; GFX9-NEXT:    v_mov_b32_e32 v9, v1
1192; GFX9-NEXT:    v_and_b32_e32 v1, v0, v6
1193; GFX9-NEXT:    v_lshl_or_b32 v12, v7, 16, v1
1194; GFX9-NEXT:    v_and_b32_e32 v1, v0, v4
1195; GFX9-NEXT:    v_and_b32_e32 v0, v0, v2
1196; GFX9-NEXT:    v_lshl_or_b32 v11, v5, 16, v1
1197; GFX9-NEXT:    v_lshl_or_b32 v10, v3, 16, v0
1198; GFX9-NEXT:    image_sample_c_d_o v0, v[8:15], s[0:7], s[8:11] dmask:0x4 a16 da
1199; GFX9-NEXT:    s_waitcnt vmcnt(0)
1200; GFX9-NEXT:    ; return to shader part epilog
1201;
1202; GFX10-LABEL: sample_c_d_o_2darray_V1:
1203; GFX10:       ; %bb.0: ; %main_body
1204; GFX10-NEXT:    v_mov_b32_e32 v9, 0xffff
1205; GFX10-NEXT:    ; implicit-def: $vcc_hi
1206; GFX10-NEXT:    v_and_b32_e32 v6, v9, v6
1207; GFX10-NEXT:    v_and_b32_e32 v4, v9, v4
1208; GFX10-NEXT:    v_and_b32_e32 v2, v9, v2
1209; GFX10-NEXT:    v_lshl_or_b32 v6, v7, 16, v6
1210; GFX10-NEXT:    v_lshl_or_b32 v4, v5, 16, v4
1211; GFX10-NEXT:    v_lshl_or_b32 v3, v3, 16, v2
1212; GFX10-NEXT:    image_sample_c_d_o v0, [v0, v1, v3, v4, v6, v8], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY a16
1213; GFX10-NEXT:    s_waitcnt vmcnt(0)
1214; GFX10-NEXT:    ; return to shader part epilog
1215main_body:
1216  %v = call float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f16.f16(i32 4, i32 %offset, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1217  ret float %v
1218}
1219
1220define amdgpu_ps <2 x float> @sample_c_d_o_2darray_V2(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %slice) {
1221; GFX9-LABEL: sample_c_d_o_2darray_V2:
1222; GFX9:       ; %bb.0: ; %main_body
1223; GFX9-NEXT:    v_mov_b32_e32 v13, v8
1224; GFX9-NEXT:    v_mov_b32_e32 v8, v0
1225; GFX9-NEXT:    v_mov_b32_e32 v0, 0xffff
1226; GFX9-NEXT:    v_mov_b32_e32 v9, v1
1227; GFX9-NEXT:    v_and_b32_e32 v1, v0, v6
1228; GFX9-NEXT:    v_lshl_or_b32 v12, v7, 16, v1
1229; GFX9-NEXT:    v_and_b32_e32 v1, v0, v4
1230; GFX9-NEXT:    v_and_b32_e32 v0, v0, v2
1231; GFX9-NEXT:    v_lshl_or_b32 v11, v5, 16, v1
1232; GFX9-NEXT:    v_lshl_or_b32 v10, v3, 16, v0
1233; GFX9-NEXT:    image_sample_c_d_o v[0:1], v[8:15], s[0:7], s[8:11] dmask:0x6 a16 da
1234; GFX9-NEXT:    s_waitcnt vmcnt(0)
1235; GFX9-NEXT:    ; return to shader part epilog
1236;
1237; GFX10-LABEL: sample_c_d_o_2darray_V2:
1238; GFX10:       ; %bb.0: ; %main_body
1239; GFX10-NEXT:    v_mov_b32_e32 v9, 0xffff
1240; GFX10-NEXT:    ; implicit-def: $vcc_hi
1241; GFX10-NEXT:    v_and_b32_e32 v6, v9, v6
1242; GFX10-NEXT:    v_and_b32_e32 v4, v9, v4
1243; GFX10-NEXT:    v_and_b32_e32 v2, v9, v2
1244; GFX10-NEXT:    v_lshl_or_b32 v6, v7, 16, v6
1245; GFX10-NEXT:    v_lshl_or_b32 v4, v5, 16, v4
1246; GFX10-NEXT:    v_lshl_or_b32 v3, v3, 16, v2
1247; GFX10-NEXT:    image_sample_c_d_o v[0:1], [v0, v1, v3, v4, v6, v8], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY a16
1248; GFX10-NEXT:    s_waitcnt vmcnt(0)
1249; GFX10-NEXT:    ; return to shader part epilog
1250main_body:
1251  %v = call <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f32.f16(i32 6, i32 %offset, float %zcompare, half %dsdh, half %dtdh, half %dsdv, half %dtdv, half %s, half %t, half %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1252  ret <2 x float> %v
1253}
1254
1255declare <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f16(i32, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1256declare <8 x float> @llvm.amdgcn.image.sample.1d.v8f32.f16(i32, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1257declare <4 x float> @llvm.amdgcn.image.sample.2d.v4f32.f16(i32, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1258declare <4 x float> @llvm.amdgcn.image.sample.3d.v4f32.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1259declare <4 x float> @llvm.amdgcn.image.sample.cube.v4f32.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1260declare <4 x float> @llvm.amdgcn.image.sample.1darray.v4f32.f16(i32, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1261declare <4 x float> @llvm.amdgcn.image.sample.2darray.v4f32.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1262
1263declare <4 x float> @llvm.amdgcn.image.sample.c.1d.v4f32.f16(i32, float, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1264declare <4 x float> @llvm.amdgcn.image.sample.c.2d.v4f32.f16(i32, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1265declare <4 x float> @llvm.amdgcn.image.sample.cl.1d.v4f32.f16(i32, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1266declare <4 x float> @llvm.amdgcn.image.sample.cl.2d.v4f32.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1267declare <4 x float> @llvm.amdgcn.image.sample.c.cl.1d.v4f32.f16(i32, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1268declare <4 x float> @llvm.amdgcn.image.sample.c.cl.2d.v4f32.f16(i32, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1269
1270declare <4 x float> @llvm.amdgcn.image.sample.b.1d.v4f32.f32.f16(i32, float, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1271declare <4 x float> @llvm.amdgcn.image.sample.b.2d.v4f32.f32.f16(i32, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1272declare <4 x float> @llvm.amdgcn.image.sample.c.b.1d.v4f32.f32.f16(i32, float, float, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1273declare <4 x float> @llvm.amdgcn.image.sample.c.b.2d.v4f32.f32.f16(i32, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1274declare <4 x float> @llvm.amdgcn.image.sample.b.cl.1d.v4f32.f32.f16(i32, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1275declare <4 x float> @llvm.amdgcn.image.sample.b.cl.2d.v4f32.f32.f16(i32, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1276declare <4 x float> @llvm.amdgcn.image.sample.c.b.cl.1d.v4f32.f32.f16(i32, float, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1277declare <4 x float> @llvm.amdgcn.image.sample.c.b.cl.2d.v4f32.f32.f16(i32, float, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1278
1279declare <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f16.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1280declare <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f16.f16(i32, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1281declare <4 x float> @llvm.amdgcn.image.sample.d.3d.v4f32.f16.f16(i32, half, half, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1282declare <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f32.f16(i32, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1283declare <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f32.f16(i32, float, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1284declare <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f16.f16(i32, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1285declare <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f16.f16(i32, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1286declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f32.f16(i32, float, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1287declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f32.f16(i32, float, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1288
1289declare <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f16.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1290declare <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f16.f16(i32, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1291declare <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f16(i32, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1292declare <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f16(i32, float, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1293declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f16.f16(i32, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1294declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f16.f16(i32, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1295declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f16(i32, float, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1296declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f16(i32, float, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1297
1298declare <4 x float> @llvm.amdgcn.image.sample.l.1d.v4f32.f16(i32, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1299declare <4 x float> @llvm.amdgcn.image.sample.l.2d.v4f32.f16(i32, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1300declare <4 x float> @llvm.amdgcn.image.sample.c.l.1d.v4f32.f16(i32, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1301declare <4 x float> @llvm.amdgcn.image.sample.c.l.2d.v4f32.f16(i32, float, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1302
1303declare <4 x float> @llvm.amdgcn.image.sample.lz.1d.v4f32.f16(i32, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1304declare <4 x float> @llvm.amdgcn.image.sample.lz.2d.v4f32.f16(i32, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1305declare <4 x float> @llvm.amdgcn.image.sample.c.lz.1d.v4f32.f16(i32, float, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1306declare <4 x float> @llvm.amdgcn.image.sample.c.lz.2d.v4f32.f16(i32, float, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1307
1308declare float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f16.f16(i32, i32, float, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1309declare <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f32.f16(i32, i32, float, half, half, half, half, half, half, half, <8 x i32>, <4 x i32>, i1, i32, i32) #1
1310
1311attributes #0 = { nounwind }
1312attributes #1 = { nounwind readonly }
1313attributes #2 = { nounwind readnone }
1314