1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefixes=VERDE %s
3; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX6789 %s
4; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -show-mc-encoding < %s | FileCheck -check-prefixes=GFX10 %s
5
6define amdgpu_ps <4 x float> @sample_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
7; VERDE-LABEL: sample_1d:
8; VERDE:       ; %bb.0: ; %main_body
9; VERDE-NEXT:    s_mov_b64 s[12:13], exec
10; VERDE-NEXT:    s_wqm_b64 exec, exec
11; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
12; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf
13; VERDE-NEXT:    s_waitcnt vmcnt(0)
14; VERDE-NEXT:    ; return to shader part epilog
15;
16; GFX6789-LABEL: sample_1d:
17; GFX6789:       ; %bb.0: ; %main_body
18; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
19; GFX6789-NEXT:    s_wqm_b64 exec, exec
20; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
21; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf
22; GFX6789-NEXT:    s_waitcnt vmcnt(0)
23; GFX6789-NEXT:    ; return to shader part epilog
24;
25; GFX10-LABEL: sample_1d:
26; GFX10:       ; %bb.0: ; %main_body
27; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
28; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
29; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
30; GFX10-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0x80,0xf0,0x00,0x00,0x40,0x00]
31; GFX10-NEXT:    ; implicit-def: $vcc_hi
32; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
33; GFX10-NEXT:    ; return to shader part epilog
34main_body:
35  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
36  ret <4 x float> %v
37}
38
39define amdgpu_ps <4 x float> @sample_1d_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 addrspace(1)* inreg %out, float %s) {
40; VERDE-LABEL: sample_1d_tfe:
41; VERDE:       ; %bb.0: ; %main_body
42; VERDE-NEXT:    s_mov_b64 s[14:15], exec
43; VERDE-NEXT:    s_wqm_b64 exec, exec
44; VERDE-NEXT:    v_mov_b32_e32 v5, v0
45; VERDE-NEXT:    v_mov_b32_e32 v0, 0
46; VERDE-NEXT:    v_mov_b32_e32 v1, v0
47; VERDE-NEXT:    v_mov_b32_e32 v2, v0
48; VERDE-NEXT:    v_mov_b32_e32 v3, v0
49; VERDE-NEXT:    v_mov_b32_e32 v4, v0
50; VERDE-NEXT:    s_and_b64 exec, exec, s[14:15]
51; VERDE-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf tfe
52; VERDE-NEXT:    s_mov_b32 s15, 0xf000
53; VERDE-NEXT:    s_mov_b32 s14, -1
54; VERDE-NEXT:    s_waitcnt vmcnt(0)
55; VERDE-NEXT:    buffer_store_dword v4, off, s[12:15], 0
56; VERDE-NEXT:    s_waitcnt vmcnt(0) expcnt(0)
57; VERDE-NEXT:    ; return to shader part epilog
58;
59; GFX6789-LABEL: sample_1d_tfe:
60; GFX6789:       ; %bb.0: ; %main_body
61; GFX6789-NEXT:    s_mov_b64 s[14:15], exec
62; GFX6789-NEXT:    s_wqm_b64 exec, exec
63; GFX6789-NEXT:    v_mov_b32_e32 v6, 0
64; GFX6789-NEXT:    v_mov_b32_e32 v5, v0
65; GFX6789-NEXT:    v_mov_b32_e32 v7, v6
66; GFX6789-NEXT:    v_mov_b32_e32 v8, v6
67; GFX6789-NEXT:    v_mov_b32_e32 v9, v6
68; GFX6789-NEXT:    v_mov_b32_e32 v10, v6
69; GFX6789-NEXT:    v_mov_b32_e32 v0, v6
70; GFX6789-NEXT:    v_mov_b32_e32 v1, v7
71; GFX6789-NEXT:    v_mov_b32_e32 v2, v8
72; GFX6789-NEXT:    v_mov_b32_e32 v3, v9
73; GFX6789-NEXT:    v_mov_b32_e32 v4, v10
74; GFX6789-NEXT:    s_and_b64 exec, exec, s[14:15]
75; GFX6789-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf tfe
76; GFX6789-NEXT:    s_waitcnt vmcnt(0)
77; GFX6789-NEXT:    global_store_dword v6, v4, s[12:13]
78; GFX6789-NEXT:    s_waitcnt vmcnt(0)
79; GFX6789-NEXT:    ; return to shader part epilog
80;
81; GFX10-LABEL: sample_1d_tfe:
82; GFX10:       ; %bb.0: ; %main_body
83; GFX10-NEXT:    s_mov_b32 s28, exec_lo ; encoding: [0x7e,0x03,0x9c,0xbe]
84; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
85; GFX10-NEXT:    v_mov_b32_e32 v6, 0 ; encoding: [0x80,0x02,0x0c,0x7e]
86; GFX10-NEXT:    v_mov_b32_e32 v5, v0 ; encoding: [0x00,0x03,0x0a,0x7e]
87; GFX10-NEXT:    v_mov_b32_e32 v7, v6 ; encoding: [0x06,0x03,0x0e,0x7e]
88; GFX10-NEXT:    v_mov_b32_e32 v8, v6 ; encoding: [0x06,0x03,0x10,0x7e]
89; GFX10-NEXT:    v_mov_b32_e32 v9, v6 ; encoding: [0x06,0x03,0x12,0x7e]
90; GFX10-NEXT:    v_mov_b32_e32 v10, v6 ; encoding: [0x06,0x03,0x14,0x7e]
91; GFX10-NEXT:    v_mov_b32_e32 v0, v6 ; encoding: [0x06,0x03,0x00,0x7e]
92; GFX10-NEXT:    v_mov_b32_e32 v1, v7 ; encoding: [0x07,0x03,0x02,0x7e]
93; GFX10-NEXT:    v_mov_b32_e32 v2, v8 ; encoding: [0x08,0x03,0x04,0x7e]
94; GFX10-NEXT:    v_mov_b32_e32 v3, v9 ; encoding: [0x09,0x03,0x06,0x7e]
95; GFX10-NEXT:    v_mov_b32_e32 v4, v10 ; encoding: [0x0a,0x03,0x08,0x7e]
96; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s28 ; encoding: [0x7e,0x1c,0x7e,0x87]
97; GFX10-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D tfe ; encoding: [0x00,0x0f,0x81,0xf0,0x05,0x00,0x40,0x00]
98; GFX10-NEXT:    ; implicit-def: $vcc_hi
99; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
100; GFX10-NEXT:    global_store_dword v6, v4, s[12:13] ; encoding: [0x00,0x80,0x70,0xdc,0x06,0x04,0x0c,0x00]
101; GFX10-NEXT:    s_waitcnt_vscnt null, 0x0 ; encoding: [0x00,0x00,0xfd,0xbb]
102; GFX10-NEXT:    ; return to shader part epilog
103main_body:
104  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
105  %v.vec = extractvalue {<4 x float>, i32} %v, 0
106  %v.err = extractvalue {<4 x float>, i32} %v, 1
107  store i32 %v.err, i32 addrspace(1)* %out, align 4
108  ret <4 x float> %v.vec
109}
110
111define amdgpu_ps <2 x float> @sample_1d_tfe_adjust_writemask_1(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 addrspace(1)* inreg %out, float %s) {
112; VERDE-LABEL: sample_1d_tfe_adjust_writemask_1:
113; VERDE:       ; %bb.0: ; %main_body
114; VERDE-NEXT:    s_mov_b64 s[12:13], exec
115; VERDE-NEXT:    s_wqm_b64 exec, exec
116; VERDE-NEXT:    v_mov_b32_e32 v2, v0
117; VERDE-NEXT:    v_mov_b32_e32 v0, 0
118; VERDE-NEXT:    v_mov_b32_e32 v1, v0
119; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
120; VERDE-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x1 tfe
121; VERDE-NEXT:    s_waitcnt vmcnt(0)
122; VERDE-NEXT:    ; return to shader part epilog
123;
124; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_1:
125; GFX6789:       ; %bb.0: ; %main_body
126; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
127; GFX6789-NEXT:    s_wqm_b64 exec, exec
128; GFX6789-NEXT:    v_mov_b32_e32 v2, v0
129; GFX6789-NEXT:    v_mov_b32_e32 v0, 0
130; GFX6789-NEXT:    v_mov_b32_e32 v1, v0
131; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
132; GFX6789-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x1 tfe
133; GFX6789-NEXT:    s_waitcnt vmcnt(0)
134; GFX6789-NEXT:    ; return to shader part epilog
135;
136; GFX10-LABEL: sample_1d_tfe_adjust_writemask_1:
137; GFX10:       ; %bb.0: ; %main_body
138; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
139; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
140; GFX10-NEXT:    v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e]
141; GFX10-NEXT:    v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]
142; GFX10-NEXT:    v_mov_b32_e32 v1, v0 ; encoding: [0x00,0x03,0x02,0x7e]
143; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
144; GFX10-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_1D tfe ; encoding: [0x00,0x01,0x81,0xf0,0x02,0x00,0x40,0x00]
145; GFX10-NEXT:    ; implicit-def: $vcc_hi
146; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
147; GFX10-NEXT:    ; return to shader part epilog
148main_body:
149  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
150  %res.vec = extractvalue {<4 x float>,i32} %v, 0
151  %res.f = extractelement <4 x float> %res.vec, i32 0
152  %res.err = extractvalue {<4 x float>,i32} %v, 1
153  %res.errf = bitcast i32 %res.err to float
154  %res.tmp = insertelement <2 x float> undef, float %res.f, i32 0
155  %res = insertelement <2 x float> %res.tmp, float %res.errf, i32 1
156  ret <2 x float> %res
157}
158
159define amdgpu_ps <2 x float> @sample_1d_tfe_adjust_writemask_2(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
160; VERDE-LABEL: sample_1d_tfe_adjust_writemask_2:
161; VERDE:       ; %bb.0: ; %main_body
162; VERDE-NEXT:    s_mov_b64 s[12:13], exec
163; VERDE-NEXT:    s_wqm_b64 exec, exec
164; VERDE-NEXT:    v_mov_b32_e32 v2, v0
165; VERDE-NEXT:    v_mov_b32_e32 v0, 0
166; VERDE-NEXT:    v_mov_b32_e32 v1, v0
167; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
168; VERDE-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x2 tfe
169; VERDE-NEXT:    s_waitcnt vmcnt(0)
170; VERDE-NEXT:    ; return to shader part epilog
171;
172; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_2:
173; GFX6789:       ; %bb.0: ; %main_body
174; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
175; GFX6789-NEXT:    s_wqm_b64 exec, exec
176; GFX6789-NEXT:    v_mov_b32_e32 v2, v0
177; GFX6789-NEXT:    v_mov_b32_e32 v0, 0
178; GFX6789-NEXT:    v_mov_b32_e32 v1, v0
179; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
180; GFX6789-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x2 tfe
181; GFX6789-NEXT:    s_waitcnt vmcnt(0)
182; GFX6789-NEXT:    ; return to shader part epilog
183;
184; GFX10-LABEL: sample_1d_tfe_adjust_writemask_2:
185; GFX10:       ; %bb.0: ; %main_body
186; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
187; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
188; GFX10-NEXT:    v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e]
189; GFX10-NEXT:    v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]
190; GFX10-NEXT:    v_mov_b32_e32 v1, v0 ; encoding: [0x00,0x03,0x02,0x7e]
191; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
192; GFX10-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x2 dim:SQ_RSRC_IMG_1D tfe ; encoding: [0x00,0x02,0x81,0xf0,0x02,0x00,0x40,0x00]
193; GFX10-NEXT:    ; implicit-def: $vcc_hi
194; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
195; GFX10-NEXT:    ; return to shader part epilog
196main_body:
197  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
198  %res.vec = extractvalue {<4 x float>,i32} %v, 0
199  %res.f = extractelement <4 x float> %res.vec, i32 1
200  %res.err = extractvalue {<4 x float>,i32} %v, 1
201  %res.errf = bitcast i32 %res.err to float
202  %res.tmp = insertelement <2 x float> undef, float %res.f, i32 0
203  %res = insertelement <2 x float> %res.tmp, float %res.errf, i32 1
204  ret <2 x float> %res
205}
206
207define amdgpu_ps <2 x float> @sample_1d_tfe_adjust_writemask_3(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
208; VERDE-LABEL: sample_1d_tfe_adjust_writemask_3:
209; VERDE:       ; %bb.0: ; %main_body
210; VERDE-NEXT:    s_mov_b64 s[12:13], exec
211; VERDE-NEXT:    s_wqm_b64 exec, exec
212; VERDE-NEXT:    v_mov_b32_e32 v2, v0
213; VERDE-NEXT:    v_mov_b32_e32 v0, 0
214; VERDE-NEXT:    v_mov_b32_e32 v1, v0
215; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
216; VERDE-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x4 tfe
217; VERDE-NEXT:    s_waitcnt vmcnt(0)
218; VERDE-NEXT:    ; return to shader part epilog
219;
220; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_3:
221; GFX6789:       ; %bb.0: ; %main_body
222; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
223; GFX6789-NEXT:    s_wqm_b64 exec, exec
224; GFX6789-NEXT:    v_mov_b32_e32 v2, v0
225; GFX6789-NEXT:    v_mov_b32_e32 v0, 0
226; GFX6789-NEXT:    v_mov_b32_e32 v1, v0
227; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
228; GFX6789-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x4 tfe
229; GFX6789-NEXT:    s_waitcnt vmcnt(0)
230; GFX6789-NEXT:    ; return to shader part epilog
231;
232; GFX10-LABEL: sample_1d_tfe_adjust_writemask_3:
233; GFX10:       ; %bb.0: ; %main_body
234; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
235; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
236; GFX10-NEXT:    v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e]
237; GFX10-NEXT:    v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]
238; GFX10-NEXT:    v_mov_b32_e32 v1, v0 ; encoding: [0x00,0x03,0x02,0x7e]
239; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
240; GFX10-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_1D tfe ; encoding: [0x00,0x04,0x81,0xf0,0x02,0x00,0x40,0x00]
241; GFX10-NEXT:    ; implicit-def: $vcc_hi
242; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
243; GFX10-NEXT:    ; return to shader part epilog
244main_body:
245  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
246  %res.vec = extractvalue {<4 x float>,i32} %v, 0
247  %res.f = extractelement <4 x float> %res.vec, i32 2
248  %res.err = extractvalue {<4 x float>,i32} %v, 1
249  %res.errf = bitcast i32 %res.err to float
250  %res.tmp = insertelement <2 x float> undef, float %res.f, i32 0
251  %res = insertelement <2 x float> %res.tmp, float %res.errf, i32 1
252  ret <2 x float> %res
253}
254
255define amdgpu_ps <2 x float> @sample_1d_tfe_adjust_writemask_4(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
256; VERDE-LABEL: sample_1d_tfe_adjust_writemask_4:
257; VERDE:       ; %bb.0: ; %main_body
258; VERDE-NEXT:    s_mov_b64 s[12:13], exec
259; VERDE-NEXT:    s_wqm_b64 exec, exec
260; VERDE-NEXT:    v_mov_b32_e32 v2, v0
261; VERDE-NEXT:    v_mov_b32_e32 v0, 0
262; VERDE-NEXT:    v_mov_b32_e32 v1, v0
263; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
264; VERDE-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x8 tfe
265; VERDE-NEXT:    s_waitcnt vmcnt(0)
266; VERDE-NEXT:    ; return to shader part epilog
267;
268; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_4:
269; GFX6789:       ; %bb.0: ; %main_body
270; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
271; GFX6789-NEXT:    s_wqm_b64 exec, exec
272; GFX6789-NEXT:    v_mov_b32_e32 v2, v0
273; GFX6789-NEXT:    v_mov_b32_e32 v0, 0
274; GFX6789-NEXT:    v_mov_b32_e32 v1, v0
275; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
276; GFX6789-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x8 tfe
277; GFX6789-NEXT:    s_waitcnt vmcnt(0)
278; GFX6789-NEXT:    ; return to shader part epilog
279;
280; GFX10-LABEL: sample_1d_tfe_adjust_writemask_4:
281; GFX10:       ; %bb.0: ; %main_body
282; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
283; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
284; GFX10-NEXT:    v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e]
285; GFX10-NEXT:    v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]
286; GFX10-NEXT:    v_mov_b32_e32 v1, v0 ; encoding: [0x00,0x03,0x02,0x7e]
287; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
288; GFX10-NEXT:    image_sample v[0:1], v2, s[0:7], s[8:11] dmask:0x8 dim:SQ_RSRC_IMG_1D tfe ; encoding: [0x00,0x08,0x81,0xf0,0x02,0x00,0x40,0x00]
289; GFX10-NEXT:    ; implicit-def: $vcc_hi
290; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
291; GFX10-NEXT:    ; return to shader part epilog
292main_body:
293  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
294  %res.vec = extractvalue {<4 x float>,i32} %v, 0
295  %res.f = extractelement <4 x float> %res.vec, i32 3
296  %res.err = extractvalue {<4 x float>,i32} %v, 1
297  %res.errf = bitcast i32 %res.err to float
298  %res.tmp = insertelement <2 x float> undef, float %res.f, i32 0
299  %res = insertelement <2 x float> %res.tmp, float %res.errf, i32 1
300  ret <2 x float> %res
301}
302
303define amdgpu_ps <4 x float> @sample_1d_tfe_adjust_writemask_12(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
304; VERDE-LABEL: sample_1d_tfe_adjust_writemask_12:
305; VERDE:       ; %bb.0: ; %main_body
306; VERDE-NEXT:    s_mov_b64 s[12:13], exec
307; VERDE-NEXT:    s_wqm_b64 exec, exec
308; VERDE-NEXT:    v_mov_b32_e32 v3, v0
309; VERDE-NEXT:    v_mov_b32_e32 v0, 0
310; VERDE-NEXT:    v_mov_b32_e32 v1, v0
311; VERDE-NEXT:    v_mov_b32_e32 v2, v0
312; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
313; VERDE-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0x3 tfe
314; VERDE-NEXT:    s_waitcnt vmcnt(0)
315; VERDE-NEXT:    ; return to shader part epilog
316;
317; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_12:
318; GFX6789:       ; %bb.0: ; %main_body
319; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
320; GFX6789-NEXT:    s_wqm_b64 exec, exec
321; GFX6789-NEXT:    v_mov_b32_e32 v3, v0
322; GFX6789-NEXT:    v_mov_b32_e32 v0, 0
323; GFX6789-NEXT:    v_mov_b32_e32 v1, v0
324; GFX6789-NEXT:    v_mov_b32_e32 v2, v0
325; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
326; GFX6789-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0x3 tfe
327; GFX6789-NEXT:    s_waitcnt vmcnt(0)
328; GFX6789-NEXT:    ; return to shader part epilog
329;
330; GFX10-LABEL: sample_1d_tfe_adjust_writemask_12:
331; GFX10:       ; %bb.0: ; %main_body
332; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
333; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
334; GFX10-NEXT:    v_mov_b32_e32 v3, v0 ; encoding: [0x00,0x03,0x06,0x7e]
335; GFX10-NEXT:    v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]
336; GFX10-NEXT:    v_mov_b32_e32 v1, v0 ; encoding: [0x00,0x03,0x02,0x7e]
337; GFX10-NEXT:    v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e]
338; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
339; GFX10-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D tfe ; encoding: [0x00,0x03,0x81,0xf0,0x03,0x00,0x40,0x00]
340; GFX10-NEXT:    ; implicit-def: $vcc_hi
341; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
342; GFX10-NEXT:    ; return to shader part epilog
343main_body:
344  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
345  %res.vec = extractvalue {<4 x float>,i32} %v, 0
346  %res.f1 = extractelement <4 x float> %res.vec, i32 0
347  %res.f2 = extractelement <4 x float> %res.vec, i32 1
348  %res.err = extractvalue {<4 x float>,i32} %v, 1
349  %res.errf = bitcast i32 %res.err to float
350  %res.tmp1 = insertelement <4 x float> undef, float %res.f1, i32 0
351  %res.tmp2 = insertelement <4 x float> %res.tmp1, float %res.f2, i32 1
352  %res = insertelement <4 x float> %res.tmp2, float %res.errf, i32 2
353  ret <4 x float> %res
354}
355
356define amdgpu_ps <4 x float> @sample_1d_tfe_adjust_writemask_24(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
357; VERDE-LABEL: sample_1d_tfe_adjust_writemask_24:
358; VERDE:       ; %bb.0: ; %main_body
359; VERDE-NEXT:    s_mov_b64 s[12:13], exec
360; VERDE-NEXT:    s_wqm_b64 exec, exec
361; VERDE-NEXT:    v_mov_b32_e32 v3, v0
362; VERDE-NEXT:    v_mov_b32_e32 v0, 0
363; VERDE-NEXT:    v_mov_b32_e32 v1, v0
364; VERDE-NEXT:    v_mov_b32_e32 v2, v0
365; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
366; VERDE-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0xa tfe
367; VERDE-NEXT:    s_waitcnt vmcnt(0)
368; VERDE-NEXT:    ; return to shader part epilog
369;
370; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_24:
371; GFX6789:       ; %bb.0: ; %main_body
372; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
373; GFX6789-NEXT:    s_wqm_b64 exec, exec
374; GFX6789-NEXT:    v_mov_b32_e32 v3, v0
375; GFX6789-NEXT:    v_mov_b32_e32 v0, 0
376; GFX6789-NEXT:    v_mov_b32_e32 v1, v0
377; GFX6789-NEXT:    v_mov_b32_e32 v2, v0
378; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
379; GFX6789-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0xa tfe
380; GFX6789-NEXT:    s_waitcnt vmcnt(0)
381; GFX6789-NEXT:    ; return to shader part epilog
382;
383; GFX10-LABEL: sample_1d_tfe_adjust_writemask_24:
384; GFX10:       ; %bb.0: ; %main_body
385; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
386; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
387; GFX10-NEXT:    v_mov_b32_e32 v3, v0 ; encoding: [0x00,0x03,0x06,0x7e]
388; GFX10-NEXT:    v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]
389; GFX10-NEXT:    v_mov_b32_e32 v1, v0 ; encoding: [0x00,0x03,0x02,0x7e]
390; GFX10-NEXT:    v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e]
391; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
392; GFX10-NEXT:    image_sample v[0:2], v3, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D tfe ; encoding: [0x00,0x0a,0x81,0xf0,0x03,0x00,0x40,0x00]
393; GFX10-NEXT:    ; implicit-def: $vcc_hi
394; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
395; GFX10-NEXT:    ; return to shader part epilog
396main_body:
397  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
398  %res.vec = extractvalue {<4 x float>,i32} %v, 0
399  %res.f1 = extractelement <4 x float> %res.vec, i32 1
400  %res.f2 = extractelement <4 x float> %res.vec, i32 3
401  %res.err = extractvalue {<4 x float>,i32} %v, 1
402  %res.errf = bitcast i32 %res.err to float
403  %res.tmp1 = insertelement <4 x float> undef, float %res.f1, i32 0
404  %res.tmp2 = insertelement <4 x float> %res.tmp1, float %res.f2, i32 1
405  %res = insertelement <4 x float> %res.tmp2, float %res.errf, i32 2
406  ret <4 x float> %res
407}
408
409define amdgpu_ps <4 x float> @sample_1d_tfe_adjust_writemask_134(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
410; VERDE-LABEL: sample_1d_tfe_adjust_writemask_134:
411; VERDE:       ; %bb.0: ; %main_body
412; VERDE-NEXT:    s_mov_b64 s[12:13], exec
413; VERDE-NEXT:    s_wqm_b64 exec, exec
414; VERDE-NEXT:    v_mov_b32_e32 v4, v0
415; VERDE-NEXT:    v_mov_b32_e32 v0, 0
416; VERDE-NEXT:    v_mov_b32_e32 v1, v0
417; VERDE-NEXT:    v_mov_b32_e32 v2, v0
418; VERDE-NEXT:    v_mov_b32_e32 v3, v0
419; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
420; VERDE-NEXT:    image_sample v[0:3], v4, s[0:7], s[8:11] dmask:0xd tfe
421; VERDE-NEXT:    s_waitcnt vmcnt(0)
422; VERDE-NEXT:    ; return to shader part epilog
423;
424; GFX6789-LABEL: sample_1d_tfe_adjust_writemask_134:
425; GFX6789:       ; %bb.0: ; %main_body
426; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
427; GFX6789-NEXT:    s_wqm_b64 exec, exec
428; GFX6789-NEXT:    v_mov_b32_e32 v4, v0
429; GFX6789-NEXT:    v_mov_b32_e32 v0, 0
430; GFX6789-NEXT:    v_mov_b32_e32 v1, v0
431; GFX6789-NEXT:    v_mov_b32_e32 v2, v0
432; GFX6789-NEXT:    v_mov_b32_e32 v3, v0
433; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
434; GFX6789-NEXT:    image_sample v[0:3], v4, s[0:7], s[8:11] dmask:0xd tfe
435; GFX6789-NEXT:    s_waitcnt vmcnt(0)
436; GFX6789-NEXT:    ; return to shader part epilog
437;
438; GFX10-LABEL: sample_1d_tfe_adjust_writemask_134:
439; GFX10:       ; %bb.0: ; %main_body
440; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
441; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
442; GFX10-NEXT:    v_mov_b32_e32 v4, v0 ; encoding: [0x00,0x03,0x08,0x7e]
443; GFX10-NEXT:    v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]
444; GFX10-NEXT:    v_mov_b32_e32 v1, v0 ; encoding: [0x00,0x03,0x02,0x7e]
445; GFX10-NEXT:    v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e]
446; GFX10-NEXT:    v_mov_b32_e32 v3, v0 ; encoding: [0x00,0x03,0x06,0x7e]
447; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
448; GFX10-NEXT:    image_sample v[0:3], v4, s[0:7], s[8:11] dmask:0xd dim:SQ_RSRC_IMG_1D tfe ; encoding: [0x00,0x0d,0x81,0xf0,0x04,0x00,0x40,0x00]
449; GFX10-NEXT:    ; implicit-def: $vcc_hi
450; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
451; GFX10-NEXT:    ; return to shader part epilog
452main_body:
453  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
454  %res.vec = extractvalue {<4 x float>,i32} %v, 0
455  %res.f1 = extractelement <4 x float> %res.vec, i32 0
456  %res.f2 = extractelement <4 x float> %res.vec, i32 2
457  %res.f3 = extractelement <4 x float> %res.vec, i32 3
458  %res.err = extractvalue {<4 x float>,i32} %v, 1
459  %res.errf = bitcast i32 %res.err to float
460  %res.tmp1 = insertelement <4 x float> undef, float %res.f1, i32 0
461  %res.tmp2 = insertelement <4 x float> %res.tmp1, float %res.f2, i32 1
462  %res.tmp3 = insertelement <4 x float> %res.tmp2, float %res.f3, i32 2
463  %res = insertelement <4 x float> %res.tmp3, float %res.errf, i32 3
464  ret <4 x float> %res
465}
466
467define amdgpu_ps <4 x float> @sample_1d_lwe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 addrspace(1)* inreg %out, float %s) {
468; VERDE-LABEL: sample_1d_lwe:
469; VERDE:       ; %bb.0: ; %main_body
470; VERDE-NEXT:    s_mov_b64 s[14:15], exec
471; VERDE-NEXT:    s_wqm_b64 exec, exec
472; VERDE-NEXT:    v_mov_b32_e32 v5, v0
473; VERDE-NEXT:    v_mov_b32_e32 v0, 0
474; VERDE-NEXT:    v_mov_b32_e32 v1, v0
475; VERDE-NEXT:    v_mov_b32_e32 v2, v0
476; VERDE-NEXT:    v_mov_b32_e32 v3, v0
477; VERDE-NEXT:    v_mov_b32_e32 v4, v0
478; VERDE-NEXT:    s_and_b64 exec, exec, s[14:15]
479; VERDE-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf lwe
480; VERDE-NEXT:    s_mov_b32 s15, 0xf000
481; VERDE-NEXT:    s_mov_b32 s14, -1
482; VERDE-NEXT:    s_waitcnt vmcnt(0)
483; VERDE-NEXT:    buffer_store_dword v4, off, s[12:15], 0
484; VERDE-NEXT:    s_waitcnt vmcnt(0) expcnt(0)
485; VERDE-NEXT:    ; return to shader part epilog
486;
487; GFX6789-LABEL: sample_1d_lwe:
488; GFX6789:       ; %bb.0: ; %main_body
489; GFX6789-NEXT:    s_mov_b64 s[14:15], exec
490; GFX6789-NEXT:    s_wqm_b64 exec, exec
491; GFX6789-NEXT:    v_mov_b32_e32 v6, 0
492; GFX6789-NEXT:    v_mov_b32_e32 v5, v0
493; GFX6789-NEXT:    v_mov_b32_e32 v7, v6
494; GFX6789-NEXT:    v_mov_b32_e32 v8, v6
495; GFX6789-NEXT:    v_mov_b32_e32 v9, v6
496; GFX6789-NEXT:    v_mov_b32_e32 v10, v6
497; GFX6789-NEXT:    v_mov_b32_e32 v0, v6
498; GFX6789-NEXT:    v_mov_b32_e32 v1, v7
499; GFX6789-NEXT:    v_mov_b32_e32 v2, v8
500; GFX6789-NEXT:    v_mov_b32_e32 v3, v9
501; GFX6789-NEXT:    v_mov_b32_e32 v4, v10
502; GFX6789-NEXT:    s_and_b64 exec, exec, s[14:15]
503; GFX6789-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf lwe
504; GFX6789-NEXT:    s_waitcnt vmcnt(0)
505; GFX6789-NEXT:    global_store_dword v6, v4, s[12:13]
506; GFX6789-NEXT:    s_waitcnt vmcnt(0)
507; GFX6789-NEXT:    ; return to shader part epilog
508;
509; GFX10-LABEL: sample_1d_lwe:
510; GFX10:       ; %bb.0: ; %main_body
511; GFX10-NEXT:    s_mov_b32 s28, exec_lo ; encoding: [0x7e,0x03,0x9c,0xbe]
512; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
513; GFX10-NEXT:    v_mov_b32_e32 v6, 0 ; encoding: [0x80,0x02,0x0c,0x7e]
514; GFX10-NEXT:    v_mov_b32_e32 v5, v0 ; encoding: [0x00,0x03,0x0a,0x7e]
515; GFX10-NEXT:    v_mov_b32_e32 v7, v6 ; encoding: [0x06,0x03,0x0e,0x7e]
516; GFX10-NEXT:    v_mov_b32_e32 v8, v6 ; encoding: [0x06,0x03,0x10,0x7e]
517; GFX10-NEXT:    v_mov_b32_e32 v9, v6 ; encoding: [0x06,0x03,0x12,0x7e]
518; GFX10-NEXT:    v_mov_b32_e32 v10, v6 ; encoding: [0x06,0x03,0x14,0x7e]
519; GFX10-NEXT:    v_mov_b32_e32 v0, v6 ; encoding: [0x06,0x03,0x00,0x7e]
520; GFX10-NEXT:    v_mov_b32_e32 v1, v7 ; encoding: [0x07,0x03,0x02,0x7e]
521; GFX10-NEXT:    v_mov_b32_e32 v2, v8 ; encoding: [0x08,0x03,0x04,0x7e]
522; GFX10-NEXT:    v_mov_b32_e32 v3, v9 ; encoding: [0x09,0x03,0x06,0x7e]
523; GFX10-NEXT:    v_mov_b32_e32 v4, v10 ; encoding: [0x0a,0x03,0x08,0x7e]
524; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s28 ; encoding: [0x7e,0x1c,0x7e,0x87]
525; GFX10-NEXT:    image_sample v[0:4], v5, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D lwe ; encoding: [0x00,0x0f,0x82,0xf0,0x05,0x00,0x40,0x00]
526; GFX10-NEXT:    ; implicit-def: $vcc_hi
527; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
528; GFX10-NEXT:    global_store_dword v6, v4, s[12:13] ; encoding: [0x00,0x80,0x70,0xdc,0x06,0x04,0x0c,0x00]
529; GFX10-NEXT:    s_waitcnt_vscnt null, 0x0 ; encoding: [0x00,0x00,0xfd,0xbb]
530; GFX10-NEXT:    ; return to shader part epilog
531main_body:
532  %v = call {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 2, i32 0)
533  %v.vec = extractvalue {<4 x float>, i32} %v, 0
534  %v.err = extractvalue {<4 x float>, i32} %v, 1
535  store i32 %v.err, i32 addrspace(1)* %out, align 4
536  ret <4 x float> %v.vec
537}
538
539define amdgpu_ps <4 x float> @sample_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t) {
540; VERDE-LABEL: sample_2d:
541; VERDE:       ; %bb.0: ; %main_body
542; VERDE-NEXT:    s_mov_b64 s[12:13], exec
543; VERDE-NEXT:    s_wqm_b64 exec, exec
544; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
545; VERDE-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
546; VERDE-NEXT:    s_waitcnt vmcnt(0)
547; VERDE-NEXT:    ; return to shader part epilog
548;
549; GFX6789-LABEL: sample_2d:
550; GFX6789:       ; %bb.0: ; %main_body
551; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
552; GFX6789-NEXT:    s_wqm_b64 exec, exec
553; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
554; GFX6789-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
555; GFX6789-NEXT:    s_waitcnt vmcnt(0)
556; GFX6789-NEXT:    ; return to shader part epilog
557;
558; GFX10-LABEL: sample_2d:
559; GFX10:       ; %bb.0: ; %main_body
560; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
561; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
562; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
563; GFX10-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0x80,0xf0,0x00,0x00,0x40,0x00]
564; GFX10-NEXT:    ; implicit-def: $vcc_hi
565; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
566; GFX10-NEXT:    ; return to shader part epilog
567main_body:
568  %v = call <4 x float> @llvm.amdgcn.image.sample.2d.v4f32.f32(i32 15, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
569  ret <4 x float> %v
570}
571
572define amdgpu_ps <4 x float> @sample_3d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %r) {
573; VERDE-LABEL: sample_3d:
574; VERDE:       ; %bb.0: ; %main_body
575; VERDE-NEXT:    s_mov_b64 s[12:13], exec
576; VERDE-NEXT:    s_wqm_b64 exec, exec
577; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
578; VERDE-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
579; VERDE-NEXT:    s_waitcnt vmcnt(0)
580; VERDE-NEXT:    ; return to shader part epilog
581;
582; GFX6789-LABEL: sample_3d:
583; GFX6789:       ; %bb.0: ; %main_body
584; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
585; GFX6789-NEXT:    s_wqm_b64 exec, exec
586; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
587; GFX6789-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
588; GFX6789-NEXT:    s_waitcnt vmcnt(0)
589; GFX6789-NEXT:    ; return to shader part epilog
590;
591; GFX10-LABEL: sample_3d:
592; GFX10:       ; %bb.0: ; %main_body
593; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
594; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
595; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
596; GFX10-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_3D ; encoding: [0x10,0x0f,0x80,0xf0,0x00,0x00,0x40,0x00]
597; GFX10-NEXT:    ; implicit-def: $vcc_hi
598; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
599; GFX10-NEXT:    ; return to shader part epilog
600main_body:
601  %v = call <4 x float> @llvm.amdgcn.image.sample.3d.v4f32.f32(i32 15, float %s, float %t, float %r, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
602  ret <4 x float> %v
603}
604
605define amdgpu_ps <4 x float> @sample_cube(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %face) {
606; VERDE-LABEL: sample_cube:
607; VERDE:       ; %bb.0: ; %main_body
608; VERDE-NEXT:    s_mov_b64 s[12:13], exec
609; VERDE-NEXT:    s_wqm_b64 exec, exec
610; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
611; VERDE-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf da
612; VERDE-NEXT:    s_waitcnt vmcnt(0)
613; VERDE-NEXT:    ; return to shader part epilog
614;
615; GFX6789-LABEL: sample_cube:
616; GFX6789:       ; %bb.0: ; %main_body
617; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
618; GFX6789-NEXT:    s_wqm_b64 exec, exec
619; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
620; GFX6789-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf da
621; GFX6789-NEXT:    s_waitcnt vmcnt(0)
622; GFX6789-NEXT:    ; return to shader part epilog
623;
624; GFX10-LABEL: sample_cube:
625; GFX10:       ; %bb.0: ; %main_body
626; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
627; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
628; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
629; GFX10-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_CUBE ; encoding: [0x18,0x0f,0x80,0xf0,0x00,0x00,0x40,0x00]
630; GFX10-NEXT:    ; implicit-def: $vcc_hi
631; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
632; GFX10-NEXT:    ; return to shader part epilog
633main_body:
634  %v = call <4 x float> @llvm.amdgcn.image.sample.cube.v4f32.f32(i32 15, float %s, float %t, float %face, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
635  ret <4 x float> %v
636}
637
638define amdgpu_ps <4 x float> @sample_1darray(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %slice) {
639; VERDE-LABEL: sample_1darray:
640; VERDE:       ; %bb.0: ; %main_body
641; VERDE-NEXT:    s_mov_b64 s[12:13], exec
642; VERDE-NEXT:    s_wqm_b64 exec, exec
643; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
644; VERDE-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf da
645; VERDE-NEXT:    s_waitcnt vmcnt(0)
646; VERDE-NEXT:    ; return to shader part epilog
647;
648; GFX6789-LABEL: sample_1darray:
649; GFX6789:       ; %bb.0: ; %main_body
650; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
651; GFX6789-NEXT:    s_wqm_b64 exec, exec
652; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
653; GFX6789-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf da
654; GFX6789-NEXT:    s_waitcnt vmcnt(0)
655; GFX6789-NEXT:    ; return to shader part epilog
656;
657; GFX10-LABEL: sample_1darray:
658; GFX10:       ; %bb.0: ; %main_body
659; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
660; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
661; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
662; GFX10-NEXT:    image_sample v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY ; encoding: [0x20,0x0f,0x80,0xf0,0x00,0x00,0x40,0x00]
663; GFX10-NEXT:    ; implicit-def: $vcc_hi
664; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
665; GFX10-NEXT:    ; return to shader part epilog
666main_body:
667  %v = call <4 x float> @llvm.amdgcn.image.sample.1darray.v4f32.f32(i32 15, float %s, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
668  ret <4 x float> %v
669}
670
671define amdgpu_ps <4 x float> @sample_2darray(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %slice) {
672; VERDE-LABEL: sample_2darray:
673; VERDE:       ; %bb.0: ; %main_body
674; VERDE-NEXT:    s_mov_b64 s[12:13], exec
675; VERDE-NEXT:    s_wqm_b64 exec, exec
676; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
677; VERDE-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf da
678; VERDE-NEXT:    s_waitcnt vmcnt(0)
679; VERDE-NEXT:    ; return to shader part epilog
680;
681; GFX6789-LABEL: sample_2darray:
682; GFX6789:       ; %bb.0: ; %main_body
683; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
684; GFX6789-NEXT:    s_wqm_b64 exec, exec
685; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
686; GFX6789-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf da
687; GFX6789-NEXT:    s_waitcnt vmcnt(0)
688; GFX6789-NEXT:    ; return to shader part epilog
689;
690; GFX10-LABEL: sample_2darray:
691; GFX10:       ; %bb.0: ; %main_body
692; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
693; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
694; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
695; GFX10-NEXT:    image_sample v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY ; encoding: [0x28,0x0f,0x80,0xf0,0x00,0x00,0x40,0x00]
696; GFX10-NEXT:    ; implicit-def: $vcc_hi
697; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
698; GFX10-NEXT:    ; return to shader part epilog
699main_body:
700  %v = call <4 x float> @llvm.amdgcn.image.sample.2darray.v4f32.f32(i32 15, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
701  ret <4 x float> %v
702}
703
704define amdgpu_ps <4 x float> @sample_c_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s) {
705; VERDE-LABEL: sample_c_1d:
706; VERDE:       ; %bb.0: ; %main_body
707; VERDE-NEXT:    s_mov_b64 s[12:13], exec
708; VERDE-NEXT:    s_wqm_b64 exec, exec
709; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
710; VERDE-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
711; VERDE-NEXT:    s_waitcnt vmcnt(0)
712; VERDE-NEXT:    ; return to shader part epilog
713;
714; GFX6789-LABEL: sample_c_1d:
715; GFX6789:       ; %bb.0: ; %main_body
716; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
717; GFX6789-NEXT:    s_wqm_b64 exec, exec
718; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
719; GFX6789-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
720; GFX6789-NEXT:    s_waitcnt vmcnt(0)
721; GFX6789-NEXT:    ; return to shader part epilog
722;
723; GFX10-LABEL: sample_c_1d:
724; GFX10:       ; %bb.0: ; %main_body
725; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
726; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
727; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
728; GFX10-NEXT:    image_sample_c v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0xa0,0xf0,0x00,0x00,0x40,0x00]
729; GFX10-NEXT:    ; implicit-def: $vcc_hi
730; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
731; GFX10-NEXT:    ; return to shader part epilog
732main_body:
733  %v = call <4 x float> @llvm.amdgcn.image.sample.c.1d.v4f32.f32(i32 15, float %zcompare, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
734  ret <4 x float> %v
735}
736
737define amdgpu_ps <4 x float> @sample_c_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %t) {
738; VERDE-LABEL: sample_c_2d:
739; VERDE:       ; %bb.0: ; %main_body
740; VERDE-NEXT:    s_mov_b64 s[12:13], exec
741; VERDE-NEXT:    s_wqm_b64 exec, exec
742; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
743; VERDE-NEXT:    image_sample_c v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
744; VERDE-NEXT:    s_waitcnt vmcnt(0)
745; VERDE-NEXT:    ; return to shader part epilog
746;
747; GFX6789-LABEL: sample_c_2d:
748; GFX6789:       ; %bb.0: ; %main_body
749; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
750; GFX6789-NEXT:    s_wqm_b64 exec, exec
751; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
752; GFX6789-NEXT:    image_sample_c v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
753; GFX6789-NEXT:    s_waitcnt vmcnt(0)
754; GFX6789-NEXT:    ; return to shader part epilog
755;
756; GFX10-LABEL: sample_c_2d:
757; GFX10:       ; %bb.0: ; %main_body
758; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
759; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
760; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
761; GFX10-NEXT:    image_sample_c v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xa0,0xf0,0x00,0x00,0x40,0x00]
762; GFX10-NEXT:    ; implicit-def: $vcc_hi
763; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
764; GFX10-NEXT:    ; return to shader part epilog
765main_body:
766  %v = call <4 x float> @llvm.amdgcn.image.sample.c.2d.v4f32.f32(i32 15, float %zcompare, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
767  ret <4 x float> %v
768}
769
770define amdgpu_ps <4 x float> @sample_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %clamp) {
771; VERDE-LABEL: sample_cl_1d:
772; VERDE:       ; %bb.0: ; %main_body
773; VERDE-NEXT:    s_mov_b64 s[12:13], exec
774; VERDE-NEXT:    s_wqm_b64 exec, exec
775; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
776; VERDE-NEXT:    image_sample_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
777; VERDE-NEXT:    s_waitcnt vmcnt(0)
778; VERDE-NEXT:    ; return to shader part epilog
779;
780; GFX6789-LABEL: sample_cl_1d:
781; GFX6789:       ; %bb.0: ; %main_body
782; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
783; GFX6789-NEXT:    s_wqm_b64 exec, exec
784; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
785; GFX6789-NEXT:    image_sample_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
786; GFX6789-NEXT:    s_waitcnt vmcnt(0)
787; GFX6789-NEXT:    ; return to shader part epilog
788;
789; GFX10-LABEL: sample_cl_1d:
790; GFX10:       ; %bb.0: ; %main_body
791; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
792; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
793; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
794; GFX10-NEXT:    image_sample_cl v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0x84,0xf0,0x00,0x00,0x40,0x00]
795; GFX10-NEXT:    ; implicit-def: $vcc_hi
796; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
797; GFX10-NEXT:    ; return to shader part epilog
798main_body:
799  %v = call <4 x float> @llvm.amdgcn.image.sample.cl.1d.v4f32.f32(i32 15, float %s, float %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_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %clamp) {
804; VERDE-LABEL: sample_cl_2d:
805; VERDE:       ; %bb.0: ; %main_body
806; VERDE-NEXT:    s_mov_b64 s[12:13], exec
807; VERDE-NEXT:    s_wqm_b64 exec, exec
808; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
809; VERDE-NEXT:    image_sample_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
810; VERDE-NEXT:    s_waitcnt vmcnt(0)
811; VERDE-NEXT:    ; return to shader part epilog
812;
813; GFX6789-LABEL: sample_cl_2d:
814; GFX6789:       ; %bb.0: ; %main_body
815; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
816; GFX6789-NEXT:    s_wqm_b64 exec, exec
817; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
818; GFX6789-NEXT:    image_sample_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
819; GFX6789-NEXT:    s_waitcnt vmcnt(0)
820; GFX6789-NEXT:    ; return to shader part epilog
821;
822; GFX10-LABEL: sample_cl_2d:
823; GFX10:       ; %bb.0: ; %main_body
824; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
825; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
826; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
827; GFX10-NEXT:    image_sample_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0x84,0xf0,0x00,0x00,0x40,0x00]
828; GFX10-NEXT:    ; implicit-def: $vcc_hi
829; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
830; GFX10-NEXT:    ; return to shader part epilog
831main_body:
832  %v = call <4 x float> @llvm.amdgcn.image.sample.cl.2d.v4f32.f32(i32 15, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
833  ret <4 x float> %v
834}
835
836define amdgpu_ps <4 x float> @sample_c_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %clamp) {
837; VERDE-LABEL: sample_c_cl_1d:
838; VERDE:       ; %bb.0: ; %main_body
839; VERDE-NEXT:    s_mov_b64 s[12:13], exec
840; VERDE-NEXT:    s_wqm_b64 exec, exec
841; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
842; VERDE-NEXT:    image_sample_c_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
843; VERDE-NEXT:    s_waitcnt vmcnt(0)
844; VERDE-NEXT:    ; return to shader part epilog
845;
846; GFX6789-LABEL: sample_c_cl_1d:
847; GFX6789:       ; %bb.0: ; %main_body
848; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
849; GFX6789-NEXT:    s_wqm_b64 exec, exec
850; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
851; GFX6789-NEXT:    image_sample_c_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
852; GFX6789-NEXT:    s_waitcnt vmcnt(0)
853; GFX6789-NEXT:    ; return to shader part epilog
854;
855; GFX10-LABEL: sample_c_cl_1d:
856; GFX10:       ; %bb.0: ; %main_body
857; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
858; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
859; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
860; GFX10-NEXT:    image_sample_c_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0xa4,0xf0,0x00,0x00,0x40,0x00]
861; GFX10-NEXT:    ; implicit-def: $vcc_hi
862; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
863; GFX10-NEXT:    ; return to shader part epilog
864main_body:
865  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cl.1d.v4f32.f32(i32 15, float %zcompare, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
866  ret <4 x float> %v
867}
868
869define amdgpu_ps <4 x float> @sample_c_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %t, float %clamp) {
870; VERDE-LABEL: sample_c_cl_2d:
871; VERDE:       ; %bb.0: ; %main_body
872; VERDE-NEXT:    s_mov_b64 s[12:13], exec
873; VERDE-NEXT:    s_wqm_b64 exec, exec
874; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
875; VERDE-NEXT:    image_sample_c_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
876; VERDE-NEXT:    s_waitcnt vmcnt(0)
877; VERDE-NEXT:    ; return to shader part epilog
878;
879; GFX6789-LABEL: sample_c_cl_2d:
880; GFX6789:       ; %bb.0: ; %main_body
881; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
882; GFX6789-NEXT:    s_wqm_b64 exec, exec
883; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
884; GFX6789-NEXT:    image_sample_c_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
885; GFX6789-NEXT:    s_waitcnt vmcnt(0)
886; GFX6789-NEXT:    ; return to shader part epilog
887;
888; GFX10-LABEL: sample_c_cl_2d:
889; GFX10:       ; %bb.0: ; %main_body
890; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
891; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
892; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
893; GFX10-NEXT:    image_sample_c_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xa4,0xf0,0x00,0x00,0x40,0x00]
894; GFX10-NEXT:    ; implicit-def: $vcc_hi
895; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
896; GFX10-NEXT:    ; return to shader part epilog
897main_body:
898  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cl.2d.v4f32.f32(i32 15, float %zcompare, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
899  ret <4 x float> %v
900}
901
902define amdgpu_ps <4 x float> @sample_b_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s) {
903; VERDE-LABEL: sample_b_1d:
904; VERDE:       ; %bb.0: ; %main_body
905; VERDE-NEXT:    s_mov_b64 s[12:13], exec
906; VERDE-NEXT:    s_wqm_b64 exec, exec
907; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
908; VERDE-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
909; VERDE-NEXT:    s_waitcnt vmcnt(0)
910; VERDE-NEXT:    ; return to shader part epilog
911;
912; GFX6789-LABEL: sample_b_1d:
913; GFX6789:       ; %bb.0: ; %main_body
914; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
915; GFX6789-NEXT:    s_wqm_b64 exec, exec
916; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
917; GFX6789-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
918; GFX6789-NEXT:    s_waitcnt vmcnt(0)
919; GFX6789-NEXT:    ; return to shader part epilog
920;
921; GFX10-LABEL: sample_b_1d:
922; GFX10:       ; %bb.0: ; %main_body
923; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
924; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
925; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
926; GFX10-NEXT:    image_sample_b v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0x94,0xf0,0x00,0x00,0x40,0x00]
927; GFX10-NEXT:    ; implicit-def: $vcc_hi
928; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
929; GFX10-NEXT:    ; return to shader part epilog
930main_body:
931  %v = call <4 x float> @llvm.amdgcn.image.sample.b.1d.v4f32.f32.f32(i32 15, float %bias, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
932  ret <4 x float> %v
933}
934
935define amdgpu_ps <4 x float> @sample_b_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t) {
936; VERDE-LABEL: sample_b_2d:
937; VERDE:       ; %bb.0: ; %main_body
938; VERDE-NEXT:    s_mov_b64 s[12:13], exec
939; VERDE-NEXT:    s_wqm_b64 exec, exec
940; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
941; VERDE-NEXT:    image_sample_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
942; VERDE-NEXT:    s_waitcnt vmcnt(0)
943; VERDE-NEXT:    ; return to shader part epilog
944;
945; GFX6789-LABEL: sample_b_2d:
946; GFX6789:       ; %bb.0: ; %main_body
947; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
948; GFX6789-NEXT:    s_wqm_b64 exec, exec
949; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
950; GFX6789-NEXT:    image_sample_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
951; GFX6789-NEXT:    s_waitcnt vmcnt(0)
952; GFX6789-NEXT:    ; return to shader part epilog
953;
954; GFX10-LABEL: sample_b_2d:
955; GFX10:       ; %bb.0: ; %main_body
956; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
957; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
958; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
959; GFX10-NEXT:    image_sample_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0x94,0xf0,0x00,0x00,0x40,0x00]
960; GFX10-NEXT:    ; implicit-def: $vcc_hi
961; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
962; GFX10-NEXT:    ; return to shader part epilog
963main_body:
964  %v = call <4 x float> @llvm.amdgcn.image.sample.b.2d.v4f32.f32.f32(i32 15, float %bias, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
965  ret <4 x float> %v
966}
967
968define amdgpu_ps <4 x float> @sample_c_b_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, float %s) {
969; VERDE-LABEL: sample_c_b_1d:
970; VERDE:       ; %bb.0: ; %main_body
971; VERDE-NEXT:    s_mov_b64 s[12:13], exec
972; VERDE-NEXT:    s_wqm_b64 exec, exec
973; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
974; VERDE-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
975; VERDE-NEXT:    s_waitcnt vmcnt(0)
976; VERDE-NEXT:    ; return to shader part epilog
977;
978; GFX6789-LABEL: sample_c_b_1d:
979; GFX6789:       ; %bb.0: ; %main_body
980; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
981; GFX6789-NEXT:    s_wqm_b64 exec, exec
982; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
983; GFX6789-NEXT:    image_sample_c_b v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
984; GFX6789-NEXT:    s_waitcnt vmcnt(0)
985; GFX6789-NEXT:    ; return to shader part epilog
986;
987; GFX10-LABEL: sample_c_b_1d:
988; GFX10:       ; %bb.0: ; %main_body
989; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
990; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
991; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
992; 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 ; encoding: [0x00,0x0f,0xb4,0xf0,0x00,0x00,0x40,0x00]
993; GFX10-NEXT:    ; implicit-def: $vcc_hi
994; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
995; GFX10-NEXT:    ; return to shader part epilog
996main_body:
997  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.1d.v4f32.f32.f32(i32 15, float %bias, float %zcompare, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
998  ret <4 x float> %v
999}
1000
1001define amdgpu_ps <4 x float> @sample_c_b_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, float %s, float %t) {
1002; VERDE-LABEL: sample_c_b_2d:
1003; VERDE:       ; %bb.0: ; %main_body
1004; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1005; VERDE-NEXT:    s_wqm_b64 exec, exec
1006; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1007; VERDE-NEXT:    image_sample_c_b v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1008; VERDE-NEXT:    s_waitcnt vmcnt(0)
1009; VERDE-NEXT:    ; return to shader part epilog
1010;
1011; GFX6789-LABEL: sample_c_b_2d:
1012; GFX6789:       ; %bb.0: ; %main_body
1013; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
1014; GFX6789-NEXT:    s_wqm_b64 exec, exec
1015; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
1016; GFX6789-NEXT:    image_sample_c_b v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1017; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1018; GFX6789-NEXT:    ; return to shader part epilog
1019;
1020; GFX10-LABEL: sample_c_b_2d:
1021; GFX10:       ; %bb.0: ; %main_body
1022; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
1023; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
1024; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
1025; GFX10-NEXT:    image_sample_c_b v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xb4,0xf0,0x00,0x00,0x40,0x00]
1026; GFX10-NEXT:    ; implicit-def: $vcc_hi
1027; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1028; GFX10-NEXT:    ; return to shader part epilog
1029main_body:
1030  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.2d.v4f32.f32.f32(i32 15, float %bias, float %zcompare, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1031  ret <4 x float> %v
1032}
1033
1034define amdgpu_ps <4 x float> @sample_b_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %clamp) {
1035; VERDE-LABEL: sample_b_cl_1d:
1036; VERDE:       ; %bb.0: ; %main_body
1037; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1038; VERDE-NEXT:    s_wqm_b64 exec, exec
1039; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1040; VERDE-NEXT:    image_sample_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1041; VERDE-NEXT:    s_waitcnt vmcnt(0)
1042; VERDE-NEXT:    ; return to shader part epilog
1043;
1044; GFX6789-LABEL: sample_b_cl_1d:
1045; GFX6789:       ; %bb.0: ; %main_body
1046; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
1047; GFX6789-NEXT:    s_wqm_b64 exec, exec
1048; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
1049; GFX6789-NEXT:    image_sample_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1050; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1051; GFX6789-NEXT:    ; return to shader part epilog
1052;
1053; GFX10-LABEL: sample_b_cl_1d:
1054; GFX10:       ; %bb.0: ; %main_body
1055; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
1056; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
1057; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
1058; GFX10-NEXT:    image_sample_b_cl v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0x98,0xf0,0x00,0x00,0x40,0x00]
1059; GFX10-NEXT:    ; implicit-def: $vcc_hi
1060; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1061; GFX10-NEXT:    ; return to shader part epilog
1062main_body:
1063  %v = call <4 x float> @llvm.amdgcn.image.sample.b.cl.1d.v4f32.f32.f32(i32 15, float %bias, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1064  ret <4 x float> %v
1065}
1066
1067define amdgpu_ps <4 x float> @sample_b_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %s, float %t, float %clamp) {
1068; VERDE-LABEL: sample_b_cl_2d:
1069; VERDE:       ; %bb.0: ; %main_body
1070; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1071; VERDE-NEXT:    s_wqm_b64 exec, exec
1072; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1073; VERDE-NEXT:    image_sample_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1074; VERDE-NEXT:    s_waitcnt vmcnt(0)
1075; VERDE-NEXT:    ; return to shader part epilog
1076;
1077; GFX6789-LABEL: sample_b_cl_2d:
1078; GFX6789:       ; %bb.0: ; %main_body
1079; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
1080; GFX6789-NEXT:    s_wqm_b64 exec, exec
1081; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
1082; GFX6789-NEXT:    image_sample_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1083; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1084; GFX6789-NEXT:    ; return to shader part epilog
1085;
1086; GFX10-LABEL: sample_b_cl_2d:
1087; GFX10:       ; %bb.0: ; %main_body
1088; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
1089; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
1090; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
1091; GFX10-NEXT:    image_sample_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0x98,0xf0,0x00,0x00,0x40,0x00]
1092; GFX10-NEXT:    ; implicit-def: $vcc_hi
1093; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1094; GFX10-NEXT:    ; return to shader part epilog
1095main_body:
1096  %v = call <4 x float> @llvm.amdgcn.image.sample.b.cl.2d.v4f32.f32.f32(i32 15, float %bias, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1097  ret <4 x float> %v
1098}
1099
1100define amdgpu_ps <4 x float> @sample_c_b_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, float %s, float %clamp) {
1101; VERDE-LABEL: sample_c_b_cl_1d:
1102; VERDE:       ; %bb.0: ; %main_body
1103; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1104; VERDE-NEXT:    s_wqm_b64 exec, exec
1105; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1106; VERDE-NEXT:    image_sample_c_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1107; VERDE-NEXT:    s_waitcnt vmcnt(0)
1108; VERDE-NEXT:    ; return to shader part epilog
1109;
1110; GFX6789-LABEL: sample_c_b_cl_1d:
1111; GFX6789:       ; %bb.0: ; %main_body
1112; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
1113; GFX6789-NEXT:    s_wqm_b64 exec, exec
1114; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
1115; GFX6789-NEXT:    image_sample_c_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1116; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1117; GFX6789-NEXT:    ; return to shader part epilog
1118;
1119; GFX10-LABEL: sample_c_b_cl_1d:
1120; GFX10:       ; %bb.0: ; %main_body
1121; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
1122; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
1123; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
1124; GFX10-NEXT:    image_sample_c_b_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0xb8,0xf0,0x00,0x00,0x40,0x00]
1125; GFX10-NEXT:    ; implicit-def: $vcc_hi
1126; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1127; GFX10-NEXT:    ; return to shader part epilog
1128main_body:
1129  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.cl.1d.v4f32.f32.f32(i32 15, float %bias, float %zcompare, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1130  ret <4 x float> %v
1131}
1132
1133define amdgpu_ps <4 x float> @sample_c_b_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %bias, float %zcompare, float %s, float %t, float %clamp) {
1134; VERDE-LABEL: sample_c_b_cl_2d:
1135; VERDE:       ; %bb.0: ; %main_body
1136; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1137; VERDE-NEXT:    s_wqm_b64 exec, exec
1138; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1139; VERDE-NEXT:    image_sample_c_b_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1140; VERDE-NEXT:    s_waitcnt vmcnt(0)
1141; VERDE-NEXT:    ; return to shader part epilog
1142;
1143; GFX6789-LABEL: sample_c_b_cl_2d:
1144; GFX6789:       ; %bb.0: ; %main_body
1145; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
1146; GFX6789-NEXT:    s_wqm_b64 exec, exec
1147; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
1148; GFX6789-NEXT:    image_sample_c_b_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1149; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1150; GFX6789-NEXT:    ; return to shader part epilog
1151;
1152; GFX10-LABEL: sample_c_b_cl_2d:
1153; GFX10:       ; %bb.0: ; %main_body
1154; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
1155; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
1156; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
1157; GFX10-NEXT:    image_sample_c_b_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xb8,0xf0,0x00,0x00,0x40,0x00]
1158; GFX10-NEXT:    ; implicit-def: $vcc_hi
1159; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1160; GFX10-NEXT:    ; return to shader part epilog
1161main_body:
1162  %v = call <4 x float> @llvm.amdgcn.image.sample.c.b.cl.2d.v4f32.f32.f32(i32 15, float %bias, float %zcompare, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1163  ret <4 x float> %v
1164}
1165
1166define amdgpu_ps <4 x float> @sample_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, float %s) {
1167; VERDE-LABEL: sample_d_1d:
1168; VERDE:       ; %bb.0: ; %main_body
1169; VERDE-NEXT:    image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1170; VERDE-NEXT:    s_waitcnt vmcnt(0)
1171; VERDE-NEXT:    ; return to shader part epilog
1172;
1173; GFX6789-LABEL: sample_d_1d:
1174; GFX6789:       ; %bb.0: ; %main_body
1175; GFX6789-NEXT:    image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1176; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1177; GFX6789-NEXT:    ; return to shader part epilog
1178;
1179; GFX10-LABEL: sample_d_1d:
1180; GFX10:       ; %bb.0: ; %main_body
1181; GFX10-NEXT:    image_sample_d v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0x88,0xf0,0x00,0x00,0x40,0x00]
1182; GFX10-NEXT:    ; implicit-def: $vcc_hi
1183; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1184; GFX10-NEXT:    ; return to shader part epilog
1185main_body:
1186  %v = call <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f32.f32(i32 15, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1187  ret <4 x float> %v
1188}
1189
1190define amdgpu_ps <4 x float> @sample_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t) {
1191; VERDE-LABEL: sample_d_2d:
1192; VERDE:       ; %bb.0: ; %main_body
1193; VERDE-NEXT:    image_sample_d v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1194; VERDE-NEXT:    s_waitcnt vmcnt(0)
1195; VERDE-NEXT:    ; return to shader part epilog
1196;
1197; GFX6789-LABEL: sample_d_2d:
1198; GFX6789:       ; %bb.0: ; %main_body
1199; GFX6789-NEXT:    image_sample_d v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1200; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1201; GFX6789-NEXT:    ; return to shader part epilog
1202;
1203; GFX10-LABEL: sample_d_2d:
1204; GFX10:       ; %bb.0: ; %main_body
1205; GFX10-NEXT:    image_sample_d v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0x88,0xf0,0x00,0x00,0x40,0x00]
1206; GFX10-NEXT:    ; implicit-def: $vcc_hi
1207; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1208; GFX10-NEXT:    ; return to shader part epilog
1209main_body:
1210  %v = call <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32.f32(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1211  ret <4 x float> %v
1212}
1213
1214define amdgpu_ps <4 x float> @sample_c_d_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s) {
1215; VERDE-LABEL: sample_c_d_1d:
1216; VERDE:       ; %bb.0: ; %main_body
1217; VERDE-NEXT:    image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1218; VERDE-NEXT:    s_waitcnt vmcnt(0)
1219; VERDE-NEXT:    ; return to shader part epilog
1220;
1221; GFX6789-LABEL: sample_c_d_1d:
1222; GFX6789:       ; %bb.0: ; %main_body
1223; GFX6789-NEXT:    image_sample_c_d v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1224; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1225; GFX6789-NEXT:    ; return to shader part epilog
1226;
1227; GFX10-LABEL: sample_c_d_1d:
1228; GFX10:       ; %bb.0: ; %main_body
1229; 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 ; encoding: [0x00,0x0f,0xa8,0xf0,0x00,0x00,0x40,0x00]
1230; GFX10-NEXT:    ; implicit-def: $vcc_hi
1231; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1232; GFX10-NEXT:    ; return to shader part epilog
1233main_body:
1234  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1235  ret <4 x float> %v
1236}
1237
1238define amdgpu_ps <4 x float> @sample_c_d_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t) {
1239; VERDE-LABEL: sample_c_d_2d:
1240; VERDE:       ; %bb.0: ; %main_body
1241; VERDE-NEXT:    image_sample_c_d v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1242; VERDE-NEXT:    s_waitcnt vmcnt(0)
1243; VERDE-NEXT:    ; return to shader part epilog
1244;
1245; GFX6789-LABEL: sample_c_d_2d:
1246; GFX6789:       ; %bb.0: ; %main_body
1247; GFX6789-NEXT:    image_sample_c_d v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1248; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1249; GFX6789-NEXT:    ; return to shader part epilog
1250;
1251; GFX10-LABEL: sample_c_d_2d:
1252; GFX10:       ; %bb.0: ; %main_body
1253; GFX10-NEXT:    image_sample_c_d v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xa8,0xf0,0x00,0x00,0x40,0x00]
1254; GFX10-NEXT:    ; implicit-def: $vcc_hi
1255; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1256; GFX10-NEXT:    ; return to shader part epilog
1257main_body:
1258  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1259  ret <4 x float> %v
1260}
1261
1262define amdgpu_ps <4 x float> @sample_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, float %s, float %clamp) {
1263; VERDE-LABEL: sample_d_cl_1d:
1264; VERDE:       ; %bb.0: ; %main_body
1265; VERDE-NEXT:    image_sample_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1266; VERDE-NEXT:    s_waitcnt vmcnt(0)
1267; VERDE-NEXT:    ; return to shader part epilog
1268;
1269; GFX6789-LABEL: sample_d_cl_1d:
1270; GFX6789:       ; %bb.0: ; %main_body
1271; GFX6789-NEXT:    image_sample_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1272; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1273; GFX6789-NEXT:    ; return to shader part epilog
1274;
1275; GFX10-LABEL: sample_d_cl_1d:
1276; GFX10:       ; %bb.0: ; %main_body
1277; GFX10-NEXT:    image_sample_d_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0x8c,0xf0,0x00,0x00,0x40,0x00]
1278; GFX10-NEXT:    ; implicit-def: $vcc_hi
1279; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1280; GFX10-NEXT:    ; return to shader part epilog
1281main_body:
1282  %v = call <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f32.f32(i32 15, float %dsdh, float %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1283  ret <4 x float> %v
1284}
1285
1286define amdgpu_ps <4 x float> @sample_d_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp) {
1287; VERDE-LABEL: sample_d_cl_2d:
1288; VERDE:       ; %bb.0: ; %main_body
1289; VERDE-NEXT:    image_sample_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1290; VERDE-NEXT:    s_waitcnt vmcnt(0)
1291; VERDE-NEXT:    ; return to shader part epilog
1292;
1293; GFX6789-LABEL: sample_d_cl_2d:
1294; GFX6789:       ; %bb.0: ; %main_body
1295; GFX6789-NEXT:    image_sample_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1296; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1297; GFX6789-NEXT:    ; return to shader part epilog
1298;
1299; GFX10-LABEL: sample_d_cl_2d:
1300; GFX10:       ; %bb.0: ; %main_body
1301; GFX10-NEXT:    image_sample_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0x8c,0xf0,0x00,0x00,0x40,0x00]
1302; GFX10-NEXT:    ; implicit-def: $vcc_hi
1303; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1304; GFX10-NEXT:    ; return to shader part epilog
1305main_body:
1306  %v = call <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f32.f32(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1307  ret <4 x float> %v
1308}
1309
1310define amdgpu_ps <4 x float> @sample_c_d_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s, float %clamp) {
1311; VERDE-LABEL: sample_c_d_cl_1d:
1312; VERDE:       ; %bb.0: ; %main_body
1313; VERDE-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1314; VERDE-NEXT:    s_waitcnt vmcnt(0)
1315; VERDE-NEXT:    ; return to shader part epilog
1316;
1317; GFX6789-LABEL: sample_c_d_cl_1d:
1318; GFX6789:       ; %bb.0: ; %main_body
1319; GFX6789-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1320; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1321; GFX6789-NEXT:    ; return to shader part epilog
1322;
1323; GFX10-LABEL: sample_c_d_cl_1d:
1324; GFX10:       ; %bb.0: ; %main_body
1325; GFX10-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0xac,0xf0,0x00,0x00,0x40,0x00]
1326; GFX10-NEXT:    ; implicit-def: $vcc_hi
1327; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1328; GFX10-NEXT:    ; return to shader part epilog
1329main_body:
1330  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1331  ret <4 x float> %v
1332}
1333
1334define amdgpu_ps <4 x float> @sample_c_d_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp) {
1335; VERDE-LABEL: sample_c_d_cl_2d:
1336; VERDE:       ; %bb.0: ; %main_body
1337; VERDE-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1338; VERDE-NEXT:    s_waitcnt vmcnt(0)
1339; VERDE-NEXT:    ; return to shader part epilog
1340;
1341; GFX6789-LABEL: sample_c_d_cl_2d:
1342; GFX6789:       ; %bb.0: ; %main_body
1343; GFX6789-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1344; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1345; GFX6789-NEXT:    ; return to shader part epilog
1346;
1347; GFX10-LABEL: sample_c_d_cl_2d:
1348; GFX10:       ; %bb.0: ; %main_body
1349; GFX10-NEXT:    image_sample_c_d_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xac,0xf0,0x00,0x00,0x40,0x00]
1350; GFX10-NEXT:    ; implicit-def: $vcc_hi
1351; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1352; GFX10-NEXT:    ; return to shader part epilog
1353main_body:
1354  %v = call <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1355  ret <4 x float> %v
1356}
1357
1358define amdgpu_ps <4 x float> @sample_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, float %s) {
1359; VERDE-LABEL: sample_cd_1d:
1360; VERDE:       ; %bb.0: ; %main_body
1361; VERDE-NEXT:    image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1362; VERDE-NEXT:    s_waitcnt vmcnt(0)
1363; VERDE-NEXT:    ; return to shader part epilog
1364;
1365; GFX6789-LABEL: sample_cd_1d:
1366; GFX6789:       ; %bb.0: ; %main_body
1367; GFX6789-NEXT:    image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1368; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1369; GFX6789-NEXT:    ; return to shader part epilog
1370;
1371; GFX10-LABEL: sample_cd_1d:
1372; GFX10:       ; %bb.0: ; %main_body
1373; GFX10-NEXT:    image_sample_cd v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0xa0,0xf1,0x00,0x00,0x40,0x00]
1374; GFX10-NEXT:    ; implicit-def: $vcc_hi
1375; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1376; GFX10-NEXT:    ; return to shader part epilog
1377main_body:
1378  %v = call <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f32.f32(i32 15, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1379  ret <4 x float> %v
1380}
1381
1382define amdgpu_ps <4 x float> @sample_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t) {
1383; VERDE-LABEL: sample_cd_2d:
1384; VERDE:       ; %bb.0: ; %main_body
1385; VERDE-NEXT:    image_sample_cd v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1386; VERDE-NEXT:    s_waitcnt vmcnt(0)
1387; VERDE-NEXT:    ; return to shader part epilog
1388;
1389; GFX6789-LABEL: sample_cd_2d:
1390; GFX6789:       ; %bb.0: ; %main_body
1391; GFX6789-NEXT:    image_sample_cd v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1392; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1393; GFX6789-NEXT:    ; return to shader part epilog
1394;
1395; GFX10-LABEL: sample_cd_2d:
1396; GFX10:       ; %bb.0: ; %main_body
1397; GFX10-NEXT:    image_sample_cd v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xa0,0xf1,0x00,0x00,0x40,0x00]
1398; GFX10-NEXT:    ; implicit-def: $vcc_hi
1399; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1400; GFX10-NEXT:    ; return to shader part epilog
1401main_body:
1402  %v = call <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f32.f32(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1403  ret <4 x float> %v
1404}
1405
1406define amdgpu_ps <4 x float> @sample_c_cd_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s) {
1407; VERDE-LABEL: sample_c_cd_1d:
1408; VERDE:       ; %bb.0: ; %main_body
1409; VERDE-NEXT:    image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1410; VERDE-NEXT:    s_waitcnt vmcnt(0)
1411; VERDE-NEXT:    ; return to shader part epilog
1412;
1413; GFX6789-LABEL: sample_c_cd_1d:
1414; GFX6789:       ; %bb.0: ; %main_body
1415; GFX6789-NEXT:    image_sample_c_cd v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1416; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1417; GFX6789-NEXT:    ; return to shader part epilog
1418;
1419; GFX10-LABEL: sample_c_cd_1d:
1420; GFX10:       ; %bb.0: ; %main_body
1421; 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 ; encoding: [0x00,0x0f,0xa8,0xf1,0x00,0x00,0x40,0x00]
1422; GFX10-NEXT:    ; implicit-def: $vcc_hi
1423; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1424; GFX10-NEXT:    ; return to shader part epilog
1425main_body:
1426  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dsdv, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1427  ret <4 x float> %v
1428}
1429
1430define amdgpu_ps <4 x float> @sample_c_cd_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t) {
1431; VERDE-LABEL: sample_c_cd_2d:
1432; VERDE:       ; %bb.0: ; %main_body
1433; VERDE-NEXT:    image_sample_c_cd v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1434; VERDE-NEXT:    s_waitcnt vmcnt(0)
1435; VERDE-NEXT:    ; return to shader part epilog
1436;
1437; GFX6789-LABEL: sample_c_cd_2d:
1438; GFX6789:       ; %bb.0: ; %main_body
1439; GFX6789-NEXT:    image_sample_c_cd v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1440; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1441; GFX6789-NEXT:    ; return to shader part epilog
1442;
1443; GFX10-LABEL: sample_c_cd_2d:
1444; GFX10:       ; %bb.0: ; %main_body
1445; GFX10-NEXT:    image_sample_c_cd v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xa8,0xf1,0x00,0x00,0x40,0x00]
1446; GFX10-NEXT:    ; implicit-def: $vcc_hi
1447; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1448; GFX10-NEXT:    ; return to shader part epilog
1449main_body:
1450  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1451  ret <4 x float> %v
1452}
1453
1454define amdgpu_ps <4 x float> @sample_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dsdv, float %s, float %clamp) {
1455; VERDE-LABEL: sample_cd_cl_1d:
1456; VERDE:       ; %bb.0: ; %main_body
1457; VERDE-NEXT:    image_sample_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1458; VERDE-NEXT:    s_waitcnt vmcnt(0)
1459; VERDE-NEXT:    ; return to shader part epilog
1460;
1461; GFX6789-LABEL: sample_cd_cl_1d:
1462; GFX6789:       ; %bb.0: ; %main_body
1463; GFX6789-NEXT:    image_sample_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1464; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1465; GFX6789-NEXT:    ; return to shader part epilog
1466;
1467; GFX10-LABEL: sample_cd_cl_1d:
1468; GFX10:       ; %bb.0: ; %main_body
1469; GFX10-NEXT:    image_sample_cd_cl v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0xa4,0xf1,0x00,0x00,0x40,0x00]
1470; GFX10-NEXT:    ; implicit-def: $vcc_hi
1471; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1472; GFX10-NEXT:    ; return to shader part epilog
1473main_body:
1474  %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f32.f32(i32 15, float %dsdh, float %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1475  ret <4 x float> %v
1476}
1477
1478define amdgpu_ps <4 x float> @sample_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp) {
1479; VERDE-LABEL: sample_cd_cl_2d:
1480; VERDE:       ; %bb.0: ; %main_body
1481; VERDE-NEXT:    image_sample_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1482; VERDE-NEXT:    s_waitcnt vmcnt(0)
1483; VERDE-NEXT:    ; return to shader part epilog
1484;
1485; GFX6789-LABEL: sample_cd_cl_2d:
1486; GFX6789:       ; %bb.0: ; %main_body
1487; GFX6789-NEXT:    image_sample_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1488; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1489; GFX6789-NEXT:    ; return to shader part epilog
1490;
1491; GFX10-LABEL: sample_cd_cl_2d:
1492; GFX10:       ; %bb.0: ; %main_body
1493; GFX10-NEXT:    image_sample_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xa4,0xf1,0x00,0x00,0x40,0x00]
1494; GFX10-NEXT:    ; implicit-def: $vcc_hi
1495; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1496; GFX10-NEXT:    ; return to shader part epilog
1497main_body:
1498  %v = call <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f32.f32(i32 15, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1499  ret <4 x float> %v
1500}
1501
1502define amdgpu_ps <4 x float> @sample_c_cd_cl_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dsdv, float %s, float %clamp) {
1503; VERDE-LABEL: sample_c_cd_cl_1d:
1504; VERDE:       ; %bb.0: ; %main_body
1505; VERDE-NEXT:    image_sample_c_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1506; VERDE-NEXT:    s_waitcnt vmcnt(0)
1507; VERDE-NEXT:    ; return to shader part epilog
1508;
1509; GFX6789-LABEL: sample_c_cd_cl_1d:
1510; GFX6789:       ; %bb.0: ; %main_body
1511; GFX6789-NEXT:    image_sample_c_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1512; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1513; GFX6789-NEXT:    ; return to shader part epilog
1514;
1515; GFX10-LABEL: sample_c_cd_cl_1d:
1516; GFX10:       ; %bb.0: ; %main_body
1517; GFX10-NEXT:    image_sample_c_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0xac,0xf1,0x00,0x00,0x40,0x00]
1518; GFX10-NEXT:    ; implicit-def: $vcc_hi
1519; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1520; GFX10-NEXT:    ; return to shader part epilog
1521main_body:
1522  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dsdv, float %s, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1523  ret <4 x float> %v
1524}
1525
1526define amdgpu_ps <4 x float> @sample_c_cd_cl_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp) {
1527; VERDE-LABEL: sample_c_cd_cl_2d:
1528; VERDE:       ; %bb.0: ; %main_body
1529; VERDE-NEXT:    image_sample_c_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1530; VERDE-NEXT:    s_waitcnt vmcnt(0)
1531; VERDE-NEXT:    ; return to shader part epilog
1532;
1533; GFX6789-LABEL: sample_c_cd_cl_2d:
1534; GFX6789:       ; %bb.0: ; %main_body
1535; GFX6789-NEXT:    image_sample_c_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf
1536; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1537; GFX6789-NEXT:    ; return to shader part epilog
1538;
1539; GFX10-LABEL: sample_c_cd_cl_2d:
1540; GFX10:       ; %bb.0: ; %main_body
1541; GFX10-NEXT:    image_sample_c_cd_cl v[0:3], v[0:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xac,0xf1,0x00,0x00,0x40,0x00]
1542; GFX10-NEXT:    ; implicit-def: $vcc_hi
1543; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1544; GFX10-NEXT:    ; return to shader part epilog
1545main_body:
1546  %v = call <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f32(i32 15, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %clamp, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1547  ret <4 x float> %v
1548}
1549
1550define amdgpu_ps <4 x float> @sample_l_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %lod) {
1551; VERDE-LABEL: sample_l_1d:
1552; VERDE:       ; %bb.0: ; %main_body
1553; VERDE-NEXT:    image_sample_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
1554; VERDE-NEXT:    s_waitcnt vmcnt(0)
1555; VERDE-NEXT:    ; return to shader part epilog
1556;
1557; GFX6789-LABEL: sample_l_1d:
1558; GFX6789:       ; %bb.0: ; %main_body
1559; GFX6789-NEXT:    image_sample_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
1560; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1561; GFX6789-NEXT:    ; return to shader part epilog
1562;
1563; GFX10-LABEL: sample_l_1d:
1564; GFX10:       ; %bb.0: ; %main_body
1565; GFX10-NEXT:    image_sample_l v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0x90,0xf0,0x00,0x00,0x40,0x00]
1566; GFX10-NEXT:    ; implicit-def: $vcc_hi
1567; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1568; GFX10-NEXT:    ; return to shader part epilog
1569main_body:
1570  %v = call <4 x float> @llvm.amdgcn.image.sample.l.1d.v4f32.f32(i32 15, float %s, float %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1571  ret <4 x float> %v
1572}
1573
1574define amdgpu_ps <4 x float> @sample_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t, float %lod) {
1575; VERDE-LABEL: sample_l_2d:
1576; VERDE:       ; %bb.0: ; %main_body
1577; VERDE-NEXT:    image_sample_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1578; VERDE-NEXT:    s_waitcnt vmcnt(0)
1579; VERDE-NEXT:    ; return to shader part epilog
1580;
1581; GFX6789-LABEL: sample_l_2d:
1582; GFX6789:       ; %bb.0: ; %main_body
1583; GFX6789-NEXT:    image_sample_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1584; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1585; GFX6789-NEXT:    ; return to shader part epilog
1586;
1587; GFX10-LABEL: sample_l_2d:
1588; GFX10:       ; %bb.0: ; %main_body
1589; GFX10-NEXT:    image_sample_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0x90,0xf0,0x00,0x00,0x40,0x00]
1590; GFX10-NEXT:    ; implicit-def: $vcc_hi
1591; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1592; GFX10-NEXT:    ; return to shader part epilog
1593main_body:
1594  %v = call <4 x float> @llvm.amdgcn.image.sample.l.2d.v4f32.f32(i32 15, float %s, float %t, float %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1595  ret <4 x float> %v
1596}
1597
1598define amdgpu_ps <4 x float> @sample_c_l_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %lod) {
1599; VERDE-LABEL: sample_c_l_1d:
1600; VERDE:       ; %bb.0: ; %main_body
1601; VERDE-NEXT:    image_sample_c_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1602; VERDE-NEXT:    s_waitcnt vmcnt(0)
1603; VERDE-NEXT:    ; return to shader part epilog
1604;
1605; GFX6789-LABEL: sample_c_l_1d:
1606; GFX6789:       ; %bb.0: ; %main_body
1607; GFX6789-NEXT:    image_sample_c_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1608; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1609; GFX6789-NEXT:    ; return to shader part epilog
1610;
1611; GFX10-LABEL: sample_c_l_1d:
1612; GFX10:       ; %bb.0: ; %main_body
1613; GFX10-NEXT:    image_sample_c_l v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0xb0,0xf0,0x00,0x00,0x40,0x00]
1614; GFX10-NEXT:    ; implicit-def: $vcc_hi
1615; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1616; GFX10-NEXT:    ; return to shader part epilog
1617main_body:
1618  %v = call <4 x float> @llvm.amdgcn.image.sample.c.l.1d.v4f32.f32(i32 15, float %zcompare, float %s, float %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1619  ret <4 x float> %v
1620}
1621
1622define amdgpu_ps <4 x float> @sample_c_l_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %t, float %lod) {
1623; VERDE-LABEL: sample_c_l_2d:
1624; VERDE:       ; %bb.0: ; %main_body
1625; VERDE-NEXT:    image_sample_c_l v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1626; VERDE-NEXT:    s_waitcnt vmcnt(0)
1627; VERDE-NEXT:    ; return to shader part epilog
1628;
1629; GFX6789-LABEL: sample_c_l_2d:
1630; GFX6789:       ; %bb.0: ; %main_body
1631; GFX6789-NEXT:    image_sample_c_l v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf
1632; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1633; GFX6789-NEXT:    ; return to shader part epilog
1634;
1635; GFX10-LABEL: sample_c_l_2d:
1636; GFX10:       ; %bb.0: ; %main_body
1637; GFX10-NEXT:    image_sample_c_l v[0:3], v[0:3], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xb0,0xf0,0x00,0x00,0x40,0x00]
1638; GFX10-NEXT:    ; implicit-def: $vcc_hi
1639; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1640; GFX10-NEXT:    ; return to shader part epilog
1641main_body:
1642  %v = call <4 x float> @llvm.amdgcn.image.sample.c.l.2d.v4f32.f32(i32 15, float %zcompare, float %s, float %t, float %lod, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1643  ret <4 x float> %v
1644}
1645
1646define amdgpu_ps <4 x float> @sample_lz_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
1647; VERDE-LABEL: sample_lz_1d:
1648; VERDE:       ; %bb.0: ; %main_body
1649; VERDE-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf
1650; VERDE-NEXT:    s_waitcnt vmcnt(0)
1651; VERDE-NEXT:    ; return to shader part epilog
1652;
1653; GFX6789-LABEL: sample_lz_1d:
1654; GFX6789:       ; %bb.0: ; %main_body
1655; GFX6789-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf
1656; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1657; GFX6789-NEXT:    ; return to shader part epilog
1658;
1659; GFX10-LABEL: sample_lz_1d:
1660; GFX10:       ; %bb.0: ; %main_body
1661; GFX10-NEXT:    image_sample_lz v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0f,0x9c,0xf0,0x00,0x00,0x40,0x00]
1662; GFX10-NEXT:    ; implicit-def: $vcc_hi
1663; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1664; GFX10-NEXT:    ; return to shader part epilog
1665main_body:
1666  %v = call <4 x float> @llvm.amdgcn.image.sample.lz.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1667  ret <4 x float> %v
1668}
1669
1670define amdgpu_ps <4 x float> @sample_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s, float %t) {
1671; VERDE-LABEL: sample_lz_2d:
1672; VERDE:       ; %bb.0: ; %main_body
1673; VERDE-NEXT:    image_sample_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
1674; VERDE-NEXT:    s_waitcnt vmcnt(0)
1675; VERDE-NEXT:    ; return to shader part epilog
1676;
1677; GFX6789-LABEL: sample_lz_2d:
1678; GFX6789:       ; %bb.0: ; %main_body
1679; GFX6789-NEXT:    image_sample_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
1680; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1681; GFX6789-NEXT:    ; return to shader part epilog
1682;
1683; GFX10-LABEL: sample_lz_2d:
1684; GFX10:       ; %bb.0: ; %main_body
1685; GFX10-NEXT:    image_sample_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0x9c,0xf0,0x00,0x00,0x40,0x00]
1686; GFX10-NEXT:    ; implicit-def: $vcc_hi
1687; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1688; GFX10-NEXT:    ; return to shader part epilog
1689main_body:
1690  %v = call <4 x float> @llvm.amdgcn.image.sample.lz.2d.v4f32.f32(i32 15, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1691  ret <4 x float> %v
1692}
1693
1694define amdgpu_ps <4 x float> @sample_c_lz_1d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s) {
1695; VERDE-LABEL: sample_c_lz_1d:
1696; VERDE:       ; %bb.0: ; %main_body
1697; VERDE-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
1698; VERDE-NEXT:    s_waitcnt vmcnt(0)
1699; VERDE-NEXT:    ; return to shader part epilog
1700;
1701; GFX6789-LABEL: sample_c_lz_1d:
1702; GFX6789:       ; %bb.0: ; %main_body
1703; GFX6789-NEXT:    image_sample_c_lz v[0:3], v[0:1], s[0:7], s[8:11] dmask:0xf
1704; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1705; GFX6789-NEXT:    ; return to shader part epilog
1706;
1707; GFX10-LABEL: sample_c_lz_1d:
1708; GFX10:       ; %bb.0: ; %main_body
1709; 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 ; encoding: [0x00,0x0f,0xbc,0xf0,0x00,0x00,0x40,0x00]
1710; GFX10-NEXT:    ; implicit-def: $vcc_hi
1711; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1712; GFX10-NEXT:    ; return to shader part epilog
1713main_body:
1714  %v = call <4 x float> @llvm.amdgcn.image.sample.c.lz.1d.v4f32.f32(i32 15, float %zcompare, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1715  ret <4 x float> %v
1716}
1717
1718define amdgpu_ps <4 x float> @sample_c_lz_2d(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %zcompare, float %s, float %t) {
1719; VERDE-LABEL: sample_c_lz_2d:
1720; VERDE:       ; %bb.0: ; %main_body
1721; VERDE-NEXT:    image_sample_c_lz v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1722; VERDE-NEXT:    s_waitcnt vmcnt(0)
1723; VERDE-NEXT:    ; return to shader part epilog
1724;
1725; GFX6789-LABEL: sample_c_lz_2d:
1726; GFX6789:       ; %bb.0: ; %main_body
1727; GFX6789-NEXT:    image_sample_c_lz v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf
1728; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1729; GFX6789-NEXT:    ; return to shader part epilog
1730;
1731; GFX10-LABEL: sample_c_lz_2d:
1732; GFX10:       ; %bb.0: ; %main_body
1733; GFX10-NEXT:    image_sample_c_lz v[0:3], v[0:2], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D ; encoding: [0x08,0x0f,0xbc,0xf0,0x00,0x00,0x40,0x00]
1734; GFX10-NEXT:    ; implicit-def: $vcc_hi
1735; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1736; GFX10-NEXT:    ; return to shader part epilog
1737main_body:
1738  %v = call <4 x float> @llvm.amdgcn.image.sample.c.lz.2d.v4f32.f32(i32 15, float %zcompare, float %s, float %t, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1739  ret <4 x float> %v
1740}
1741
1742define amdgpu_ps float @sample_c_d_o_2darray_V1(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice) {
1743; VERDE-LABEL: sample_c_d_o_2darray_V1:
1744; VERDE:       ; %bb.0: ; %main_body
1745; VERDE-NEXT:    image_sample_c_d_o v0, v[0:15], s[0:7], s[8:11] dmask:0x4 da
1746; VERDE-NEXT:    s_waitcnt vmcnt(0)
1747; VERDE-NEXT:    ; return to shader part epilog
1748;
1749; GFX6789-LABEL: sample_c_d_o_2darray_V1:
1750; GFX6789:       ; %bb.0: ; %main_body
1751; GFX6789-NEXT:    image_sample_c_d_o v0, v[0:15], s[0:7], s[8:11] dmask:0x4 da
1752; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1753; GFX6789-NEXT:    ; return to shader part epilog
1754;
1755; GFX10-LABEL: sample_c_d_o_2darray_V1:
1756; GFX10:       ; %bb.0: ; %main_body
1757; GFX10-NEXT:    image_sample_c_d_o v0, v[0:15], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY ; encoding: [0x28,0x04,0xe8,0xf0,0x00,0x00,0x40,0x00]
1758; GFX10-NEXT:    ; implicit-def: $vcc_hi
1759; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1760; GFX10-NEXT:    ; return to shader part epilog
1761main_body:
1762  %v = call float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f32.f32(i32 4, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1763  ret float %v
1764}
1765
1766define amdgpu_ps float @sample_c_d_o_2darray_V1_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, i32 addrspace(1)* inreg %out) {
1767; VERDE-LABEL: sample_c_d_o_2darray_V1_tfe:
1768; VERDE:       ; %bb.0: ; %main_body
1769; VERDE-NEXT:    v_mov_b32_e32 v9, 0
1770; VERDE-NEXT:    v_mov_b32_e32 v10, v9
1771; VERDE-NEXT:    image_sample_c_d_o v[9:10], v[0:15], s[0:7], s[8:11] dmask:0x4 tfe da
1772; VERDE-NEXT:    s_mov_b32 s15, 0xf000
1773; VERDE-NEXT:    s_mov_b32 s14, -1
1774; VERDE-NEXT:    s_waitcnt vmcnt(0)
1775; VERDE-NEXT:    v_mov_b32_e32 v0, v9
1776; VERDE-NEXT:    buffer_store_dword v10, off, s[12:15], 0
1777; VERDE-NEXT:    s_waitcnt vmcnt(0) expcnt(0)
1778; VERDE-NEXT:    ; return to shader part epilog
1779;
1780; GFX6789-LABEL: sample_c_d_o_2darray_V1_tfe:
1781; GFX6789:       ; %bb.0: ; %main_body
1782; GFX6789-NEXT:    v_mov_b32_e32 v11, 0
1783; GFX6789-NEXT:    v_mov_b32_e32 v12, v11
1784; GFX6789-NEXT:    v_mov_b32_e32 v9, v11
1785; GFX6789-NEXT:    v_mov_b32_e32 v10, v12
1786; GFX6789-NEXT:    image_sample_c_d_o v[9:10], v[0:15], s[0:7], s[8:11] dmask:0x4 tfe da
1787; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1788; GFX6789-NEXT:    v_mov_b32_e32 v0, v9
1789; GFX6789-NEXT:    global_store_dword v11, v10, s[12:13]
1790; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1791; GFX6789-NEXT:    ; return to shader part epilog
1792;
1793; GFX10-LABEL: sample_c_d_o_2darray_V1_tfe:
1794; GFX10:       ; %bb.0: ; %main_body
1795; GFX10-NEXT:    v_mov_b32_e32 v11, 0 ; encoding: [0x80,0x02,0x16,0x7e]
1796; GFX10-NEXT:    v_mov_b32_e32 v9, v1 ; encoding: [0x01,0x03,0x12,0x7e]
1797; GFX10-NEXT:    v_mov_b32_e32 v10, v0 ; encoding: [0x00,0x03,0x14,0x7e]
1798; GFX10-NEXT:    ; implicit-def: $vcc_hi
1799; GFX10-NEXT:    v_mov_b32_e32 v12, v11 ; encoding: [0x0b,0x03,0x18,0x7e]
1800; GFX10-NEXT:    v_mov_b32_e32 v0, v11 ; encoding: [0x0b,0x03,0x00,0x7e]
1801; GFX10-NEXT:    v_mov_b32_e32 v1, v12 ; encoding: [0x0c,0x03,0x02,0x7e]
1802; GFX10-NEXT:    image_sample_c_d_o v[0:1], [v10, v9, v2, v3, v4, v5, v6, v7, v8], s[0:7], s[8:11] dmask:0x4 dim:SQ_RSRC_IMG_2D_ARRAY tfe ; encoding: [0x2c,0x04,0xe9,0xf0,0x0a,0x00,0x40,0x00,0x09,0x02,0x03,0x04,0x05,0x06,0x07,0x08]
1803; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1804; GFX10-NEXT:    global_store_dword v11, v1, s[12:13] ; encoding: [0x00,0x80,0x70,0xdc,0x0b,0x01,0x0c,0x00]
1805; GFX10-NEXT:    s_waitcnt_vscnt null, 0x0 ; encoding: [0x00,0x00,0xfd,0xbb]
1806; GFX10-NEXT:    ; return to shader part epilog
1807main_body:
1808  %v = call {float,i32} @llvm.amdgcn.image.sample.c.d.o.2darray.f32i32.f32.f32(i32 4, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
1809  %v.vec = extractvalue {float, i32} %v, 0
1810  %v.err = extractvalue {float, i32} %v, 1
1811  store i32 %v.err, i32 addrspace(1)* %out, align 4
1812  ret float %v.vec
1813}
1814
1815define 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, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice) {
1816; VERDE-LABEL: sample_c_d_o_2darray_V2:
1817; VERDE:       ; %bb.0: ; %main_body
1818; VERDE-NEXT:    image_sample_c_d_o v[0:1], v[0:15], s[0:7], s[8:11] dmask:0x6 da
1819; VERDE-NEXT:    s_waitcnt vmcnt(0)
1820; VERDE-NEXT:    ; return to shader part epilog
1821;
1822; GFX6789-LABEL: sample_c_d_o_2darray_V2:
1823; GFX6789:       ; %bb.0: ; %main_body
1824; GFX6789-NEXT:    image_sample_c_d_o v[0:1], v[0:15], s[0:7], s[8:11] dmask:0x6 da
1825; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1826; GFX6789-NEXT:    ; return to shader part epilog
1827;
1828; GFX10-LABEL: sample_c_d_o_2darray_V2:
1829; GFX10:       ; %bb.0: ; %main_body
1830; GFX10-NEXT:    image_sample_c_d_o v[0:1], v[0:15], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY ; encoding: [0x28,0x06,0xe8,0xf0,0x00,0x00,0x40,0x00]
1831; GFX10-NEXT:    ; implicit-def: $vcc_hi
1832; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1833; GFX10-NEXT:    ; return to shader part epilog
1834main_body:
1835  %v = call <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f32.f32(i32 6, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
1836  ret <2 x float> %v
1837}
1838
1839define amdgpu_ps <4 x float> @sample_c_d_o_2darray_V2_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice) {
1840; VERDE-LABEL: sample_c_d_o_2darray_V2_tfe:
1841; VERDE:       ; %bb.0: ; %main_body
1842; VERDE-NEXT:    v_mov_b32_e32 v9, 0
1843; VERDE-NEXT:    v_mov_b32_e32 v10, v9
1844; VERDE-NEXT:    v_mov_b32_e32 v11, v9
1845; VERDE-NEXT:    image_sample_c_d_o v[9:11], v[0:15], s[0:7], s[8:11] dmask:0x6 tfe da
1846; VERDE-NEXT:    s_waitcnt vmcnt(0)
1847; VERDE-NEXT:    v_mov_b32_e32 v0, v9
1848; VERDE-NEXT:    v_mov_b32_e32 v1, v10
1849; VERDE-NEXT:    v_mov_b32_e32 v2, v11
1850; VERDE-NEXT:    ; return to shader part epilog
1851;
1852; GFX6789-LABEL: sample_c_d_o_2darray_V2_tfe:
1853; GFX6789:       ; %bb.0: ; %main_body
1854; GFX6789-NEXT:    v_mov_b32_e32 v9, 0
1855; GFX6789-NEXT:    v_mov_b32_e32 v10, v9
1856; GFX6789-NEXT:    v_mov_b32_e32 v11, v9
1857; GFX6789-NEXT:    image_sample_c_d_o v[9:11], v[0:15], s[0:7], s[8:11] dmask:0x6 tfe da
1858; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1859; GFX6789-NEXT:    v_mov_b32_e32 v0, v9
1860; GFX6789-NEXT:    v_mov_b32_e32 v1, v10
1861; GFX6789-NEXT:    v_mov_b32_e32 v2, v11
1862; GFX6789-NEXT:    ; return to shader part epilog
1863;
1864; GFX10-LABEL: sample_c_d_o_2darray_V2_tfe:
1865; GFX10:       ; %bb.0: ; %main_body
1866; GFX10-NEXT:    v_mov_b32_e32 v11, v0 ; encoding: [0x00,0x03,0x16,0x7e]
1867; GFX10-NEXT:    v_mov_b32_e32 v0, 0 ; encoding: [0x80,0x02,0x00,0x7e]
1868; GFX10-NEXT:    v_mov_b32_e32 v9, v2 ; encoding: [0x02,0x03,0x12,0x7e]
1869; GFX10-NEXT:    v_mov_b32_e32 v10, v1 ; encoding: [0x01,0x03,0x14,0x7e]
1870; GFX10-NEXT:    ; implicit-def: $vcc_hi
1871; GFX10-NEXT:    v_mov_b32_e32 v1, v0 ; encoding: [0x00,0x03,0x02,0x7e]
1872; GFX10-NEXT:    v_mov_b32_e32 v2, v0 ; encoding: [0x00,0x03,0x04,0x7e]
1873; GFX10-NEXT:    image_sample_c_d_o v[0:2], [v11, v10, v9, v3, v4, v5, v6, v7, v8], s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_2D_ARRAY tfe ; encoding: [0x2c,0x06,0xe9,0xf0,0x0b,0x00,0x40,0x00,0x0a,0x09,0x03,0x04,0x05,0x06,0x07,0x08]
1874; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1875; GFX10-NEXT:    ; return to shader part epilog
1876main_body:
1877  %v = call {<2 x float>, i32} @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32i32.f32.f32(i32 6, i32 %offset, float %zcompare, float %dsdh, float %dtdh, float %dsdv, float %dtdv, float %s, float %t, float %slice, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 1, i32 0)
1878  %v.vec = extractvalue {<2 x float>, i32} %v, 0
1879  %v.f1 = extractelement <2 x float> %v.vec, i32 0
1880  %v.f2 = extractelement <2 x float> %v.vec, i32 1
1881  %v.err = extractvalue {<2 x float>, i32} %v, 1
1882  %v.errf = bitcast i32 %v.err to float
1883  %res.0 = insertelement <4 x float> undef, float %v.f1, i32 0
1884  %res.1 = insertelement <4 x float> %res.0, float %v.f2, i32 1
1885  %res.2 = insertelement <4 x float> %res.1, float %v.errf, i32 2
1886  ret <4 x float> %res.2
1887}
1888
1889define amdgpu_ps <4 x float> @sample_1d_unorm(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
1890; VERDE-LABEL: sample_1d_unorm:
1891; VERDE:       ; %bb.0: ; %main_body
1892; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1893; VERDE-NEXT:    s_wqm_b64 exec, exec
1894; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1895; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf unorm
1896; VERDE-NEXT:    s_waitcnt vmcnt(0)
1897; VERDE-NEXT:    ; return to shader part epilog
1898;
1899; GFX6789-LABEL: sample_1d_unorm:
1900; GFX6789:       ; %bb.0: ; %main_body
1901; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
1902; GFX6789-NEXT:    s_wqm_b64 exec, exec
1903; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
1904; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf unorm
1905; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1906; GFX6789-NEXT:    ; return to shader part epilog
1907;
1908; GFX10-LABEL: sample_1d_unorm:
1909; GFX10:       ; %bb.0: ; %main_body
1910; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
1911; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
1912; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
1913; GFX10-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D unorm ; encoding: [0x00,0x1f,0x80,0xf0,0x00,0x00,0x40,0x00]
1914; GFX10-NEXT:    ; implicit-def: $vcc_hi
1915; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1916; GFX10-NEXT:    ; return to shader part epilog
1917main_body:
1918  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 1, i32 0, i32 0)
1919  ret <4 x float> %v
1920}
1921
1922define amdgpu_ps <4 x float> @sample_1d_glc(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
1923; VERDE-LABEL: sample_1d_glc:
1924; VERDE:       ; %bb.0: ; %main_body
1925; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1926; VERDE-NEXT:    s_wqm_b64 exec, exec
1927; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1928; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf glc
1929; VERDE-NEXT:    s_waitcnt vmcnt(0)
1930; VERDE-NEXT:    ; return to shader part epilog
1931;
1932; GFX6789-LABEL: sample_1d_glc:
1933; GFX6789:       ; %bb.0: ; %main_body
1934; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
1935; GFX6789-NEXT:    s_wqm_b64 exec, exec
1936; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
1937; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf glc
1938; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1939; GFX6789-NEXT:    ; return to shader part epilog
1940;
1941; GFX10-LABEL: sample_1d_glc:
1942; GFX10:       ; %bb.0: ; %main_body
1943; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
1944; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
1945; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
1946; GFX10-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D glc ; encoding: [0x00,0x2f,0x80,0xf0,0x00,0x00,0x40,0x00]
1947; GFX10-NEXT:    ; implicit-def: $vcc_hi
1948; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1949; GFX10-NEXT:    ; return to shader part epilog
1950main_body:
1951  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 1)
1952  ret <4 x float> %v
1953}
1954
1955define amdgpu_ps <4 x float> @sample_1d_slc(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
1956; VERDE-LABEL: sample_1d_slc:
1957; VERDE:       ; %bb.0: ; %main_body
1958; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1959; VERDE-NEXT:    s_wqm_b64 exec, exec
1960; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1961; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf slc
1962; VERDE-NEXT:    s_waitcnt vmcnt(0)
1963; VERDE-NEXT:    ; return to shader part epilog
1964;
1965; GFX6789-LABEL: sample_1d_slc:
1966; GFX6789:       ; %bb.0: ; %main_body
1967; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
1968; GFX6789-NEXT:    s_wqm_b64 exec, exec
1969; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
1970; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf slc
1971; GFX6789-NEXT:    s_waitcnt vmcnt(0)
1972; GFX6789-NEXT:    ; return to shader part epilog
1973;
1974; GFX10-LABEL: sample_1d_slc:
1975; GFX10:       ; %bb.0: ; %main_body
1976; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
1977; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
1978; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
1979; GFX10-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D slc ; encoding: [0x00,0x0f,0x80,0xf2,0x00,0x00,0x40,0x00]
1980; GFX10-NEXT:    ; implicit-def: $vcc_hi
1981; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
1982; GFX10-NEXT:    ; return to shader part epilog
1983main_body:
1984  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 2)
1985  ret <4 x float> %v
1986}
1987
1988define amdgpu_ps <4 x float> @sample_1d_glc_slc(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
1989; VERDE-LABEL: sample_1d_glc_slc:
1990; VERDE:       ; %bb.0: ; %main_body
1991; VERDE-NEXT:    s_mov_b64 s[12:13], exec
1992; VERDE-NEXT:    s_wqm_b64 exec, exec
1993; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
1994; VERDE-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf glc slc
1995; VERDE-NEXT:    s_waitcnt vmcnt(0)
1996; VERDE-NEXT:    ; return to shader part epilog
1997;
1998; GFX6789-LABEL: sample_1d_glc_slc:
1999; GFX6789:       ; %bb.0: ; %main_body
2000; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2001; GFX6789-NEXT:    s_wqm_b64 exec, exec
2002; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2003; GFX6789-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf glc slc
2004; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2005; GFX6789-NEXT:    ; return to shader part epilog
2006;
2007; GFX10-LABEL: sample_1d_glc_slc:
2008; GFX10:       ; %bb.0: ; %main_body
2009; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2010; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2011; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2012; GFX10-NEXT:    image_sample v[0:3], v0, s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_1D glc slc ; encoding: [0x00,0x2f,0x80,0xf2,0x00,0x00,0x40,0x00]
2013; GFX10-NEXT:    ; implicit-def: $vcc_hi
2014; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2015; GFX10-NEXT:    ; return to shader part epilog
2016main_body:
2017  %v = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 3)
2018  ret <4 x float> %v
2019}
2020
2021define amdgpu_ps float @adjust_writemask_sample_0(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2022; VERDE-LABEL: adjust_writemask_sample_0:
2023; VERDE:       ; %bb.0: ; %main_body
2024; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2025; VERDE-NEXT:    s_wqm_b64 exec, exec
2026; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2027; VERDE-NEXT:    image_sample v0, v0, s[0:7], s[8:11] dmask:0x1
2028; VERDE-NEXT:    s_waitcnt vmcnt(0)
2029; VERDE-NEXT:    ; return to shader part epilog
2030;
2031; GFX6789-LABEL: adjust_writemask_sample_0:
2032; GFX6789:       ; %bb.0: ; %main_body
2033; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2034; GFX6789-NEXT:    s_wqm_b64 exec, exec
2035; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2036; GFX6789-NEXT:    image_sample v0, v0, s[0:7], s[8:11] dmask:0x1
2037; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2038; GFX6789-NEXT:    ; return to shader part epilog
2039;
2040; GFX10-LABEL: adjust_writemask_sample_0:
2041; GFX10:       ; %bb.0: ; %main_body
2042; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2043; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2044; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2045; GFX10-NEXT:    image_sample v0, v0, s[0:7], s[8:11] dmask:0x1 dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x01,0x80,0xf0,0x00,0x00,0x40,0x00]
2046; GFX10-NEXT:    ; implicit-def: $vcc_hi
2047; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2048; GFX10-NEXT:    ; return to shader part epilog
2049main_body:
2050  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2051  %elt0 = extractelement <4 x float> %r, i32 0
2052  ret float %elt0
2053}
2054
2055define amdgpu_ps <2 x float> @adjust_writemask_sample_01(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2056; VERDE-LABEL: adjust_writemask_sample_01:
2057; VERDE:       ; %bb.0: ; %main_body
2058; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2059; VERDE-NEXT:    s_wqm_b64 exec, exec
2060; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2061; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x3
2062; VERDE-NEXT:    s_waitcnt vmcnt(0)
2063; VERDE-NEXT:    ; return to shader part epilog
2064;
2065; GFX6789-LABEL: adjust_writemask_sample_01:
2066; GFX6789:       ; %bb.0: ; %main_body
2067; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2068; GFX6789-NEXT:    s_wqm_b64 exec, exec
2069; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2070; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x3
2071; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2072; GFX6789-NEXT:    ; return to shader part epilog
2073;
2074; GFX10-LABEL: adjust_writemask_sample_01:
2075; GFX10:       ; %bb.0: ; %main_body
2076; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2077; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2078; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2079; GFX10-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x3 dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x03,0x80,0xf0,0x00,0x00,0x40,0x00]
2080; GFX10-NEXT:    ; implicit-def: $vcc_hi
2081; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2082; GFX10-NEXT:    ; return to shader part epilog
2083main_body:
2084  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2085  %out = shufflevector <4 x float> %r, <4 x float> undef, <2 x i32> <i32 0, i32 1>
2086  ret <2 x float> %out
2087}
2088
2089define amdgpu_ps <3 x float> @adjust_writemask_sample_012(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2090; VERDE-LABEL: adjust_writemask_sample_012:
2091; VERDE:       ; %bb.0: ; %main_body
2092; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2093; VERDE-NEXT:    s_wqm_b64 exec, exec
2094; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2095; VERDE-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0x7
2096; VERDE-NEXT:    s_waitcnt vmcnt(0)
2097; VERDE-NEXT:    ; return to shader part epilog
2098;
2099; GFX6789-LABEL: adjust_writemask_sample_012:
2100; GFX6789:       ; %bb.0: ; %main_body
2101; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2102; GFX6789-NEXT:    s_wqm_b64 exec, exec
2103; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2104; GFX6789-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0x7
2105; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2106; GFX6789-NEXT:    ; return to shader part epilog
2107;
2108; GFX10-LABEL: adjust_writemask_sample_012:
2109; GFX10:       ; %bb.0: ; %main_body
2110; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2111; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2112; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2113; GFX10-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0x7 dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x07,0x80,0xf0,0x00,0x00,0x40,0x00]
2114; GFX10-NEXT:    ; implicit-def: $vcc_hi
2115; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2116; GFX10-NEXT:    ; return to shader part epilog
2117main_body:
2118  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2119  %out = shufflevector <4 x float> %r, <4 x float> undef, <3 x i32> <i32 0, i32 1, i32 2>
2120  ret <3 x float> %out
2121}
2122
2123define amdgpu_ps <2 x float> @adjust_writemask_sample_12(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2124; VERDE-LABEL: adjust_writemask_sample_12:
2125; VERDE:       ; %bb.0: ; %main_body
2126; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2127; VERDE-NEXT:    s_wqm_b64 exec, exec
2128; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2129; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6
2130; VERDE-NEXT:    s_waitcnt vmcnt(0)
2131; VERDE-NEXT:    ; return to shader part epilog
2132;
2133; GFX6789-LABEL: adjust_writemask_sample_12:
2134; GFX6789:       ; %bb.0: ; %main_body
2135; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2136; GFX6789-NEXT:    s_wqm_b64 exec, exec
2137; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2138; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6
2139; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2140; GFX6789-NEXT:    ; return to shader part epilog
2141;
2142; GFX10-LABEL: adjust_writemask_sample_12:
2143; GFX10:       ; %bb.0: ; %main_body
2144; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2145; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2146; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2147; GFX10-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x06,0x80,0xf0,0x00,0x00,0x40,0x00]
2148; GFX10-NEXT:    ; implicit-def: $vcc_hi
2149; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2150; GFX10-NEXT:    ; return to shader part epilog
2151main_body:
2152  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2153  %out = shufflevector <4 x float> %r, <4 x float> undef, <2 x i32> <i32 1, i32 2>
2154  ret <2 x float> %out
2155}
2156
2157define amdgpu_ps <2 x float> @adjust_writemask_sample_03(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2158; VERDE-LABEL: adjust_writemask_sample_03:
2159; VERDE:       ; %bb.0: ; %main_body
2160; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2161; VERDE-NEXT:    s_wqm_b64 exec, exec
2162; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2163; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x9
2164; VERDE-NEXT:    s_waitcnt vmcnt(0)
2165; VERDE-NEXT:    ; return to shader part epilog
2166;
2167; GFX6789-LABEL: adjust_writemask_sample_03:
2168; GFX6789:       ; %bb.0: ; %main_body
2169; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2170; GFX6789-NEXT:    s_wqm_b64 exec, exec
2171; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2172; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x9
2173; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2174; GFX6789-NEXT:    ; return to shader part epilog
2175;
2176; GFX10-LABEL: adjust_writemask_sample_03:
2177; GFX10:       ; %bb.0: ; %main_body
2178; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2179; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2180; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2181; GFX10-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x9 dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x09,0x80,0xf0,0x00,0x00,0x40,0x00]
2182; GFX10-NEXT:    ; implicit-def: $vcc_hi
2183; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2184; GFX10-NEXT:    ; return to shader part epilog
2185main_body:
2186  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2187  %out = shufflevector <4 x float> %r, <4 x float> undef, <2 x i32> <i32 0, i32 3>
2188  ret <2 x float> %out
2189}
2190
2191define amdgpu_ps <2 x float> @adjust_writemask_sample_13(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2192; VERDE-LABEL: adjust_writemask_sample_13:
2193; VERDE:       ; %bb.0: ; %main_body
2194; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2195; VERDE-NEXT:    s_wqm_b64 exec, exec
2196; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2197; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa
2198; VERDE-NEXT:    s_waitcnt vmcnt(0)
2199; VERDE-NEXT:    ; return to shader part epilog
2200;
2201; GFX6789-LABEL: adjust_writemask_sample_13:
2202; GFX6789:       ; %bb.0: ; %main_body
2203; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2204; GFX6789-NEXT:    s_wqm_b64 exec, exec
2205; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2206; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa
2207; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2208; GFX6789-NEXT:    ; return to shader part epilog
2209;
2210; GFX10-LABEL: adjust_writemask_sample_13:
2211; GFX10:       ; %bb.0: ; %main_body
2212; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2213; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2214; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2215; GFX10-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0a,0x80,0xf0,0x00,0x00,0x40,0x00]
2216; GFX10-NEXT:    ; implicit-def: $vcc_hi
2217; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2218; GFX10-NEXT:    ; return to shader part epilog
2219main_body:
2220  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2221  %out = shufflevector <4 x float> %r, <4 x float> undef, <2 x i32> <i32 1, i32 3>
2222  ret <2 x float> %out
2223}
2224
2225define amdgpu_ps <3 x float> @adjust_writemask_sample_123(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2226; VERDE-LABEL: adjust_writemask_sample_123:
2227; VERDE:       ; %bb.0: ; %main_body
2228; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2229; VERDE-NEXT:    s_wqm_b64 exec, exec
2230; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2231; VERDE-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0xe
2232; VERDE-NEXT:    s_waitcnt vmcnt(0)
2233; VERDE-NEXT:    ; return to shader part epilog
2234;
2235; GFX6789-LABEL: adjust_writemask_sample_123:
2236; GFX6789:       ; %bb.0: ; %main_body
2237; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2238; GFX6789-NEXT:    s_wqm_b64 exec, exec
2239; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2240; GFX6789-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0xe
2241; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2242; GFX6789-NEXT:    ; return to shader part epilog
2243;
2244; GFX10-LABEL: adjust_writemask_sample_123:
2245; GFX10:       ; %bb.0: ; %main_body
2246; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2247; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2248; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2249; GFX10-NEXT:    image_sample v[0:2], v0, s[0:7], s[8:11] dmask:0xe dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0e,0x80,0xf0,0x00,0x00,0x40,0x00]
2250; GFX10-NEXT:    ; implicit-def: $vcc_hi
2251; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2252; GFX10-NEXT:    ; return to shader part epilog
2253main_body:
2254  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 15, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2255  %out = shufflevector <4 x float> %r, <4 x float> undef, <3 x i32> <i32 1, i32 2, i32 3>
2256  ret <3 x float> %out
2257}
2258
2259define amdgpu_ps <4 x float> @adjust_writemask_sample_none_enabled(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2260; VERDE-LABEL: adjust_writemask_sample_none_enabled:
2261; VERDE:       ; %bb.0: ; %main_body
2262; VERDE-NEXT:    ; return to shader part epilog
2263;
2264; GFX6789-LABEL: adjust_writemask_sample_none_enabled:
2265; GFX6789:       ; %bb.0: ; %main_body
2266; GFX6789-NEXT:    ; return to shader part epilog
2267;
2268; GFX10-LABEL: adjust_writemask_sample_none_enabled:
2269; GFX10:       ; %bb.0: ; %main_body
2270; GFX10-NEXT:    ; implicit-def: $vcc_hi
2271; GFX10-NEXT:    ; return to shader part epilog
2272main_body:
2273  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 0, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2274  ret <4 x float> %r
2275}
2276
2277define amdgpu_ps <2 x float> @adjust_writemask_sample_123_to_12(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2278; VERDE-LABEL: adjust_writemask_sample_123_to_12:
2279; VERDE:       ; %bb.0: ; %main_body
2280; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2281; VERDE-NEXT:    s_wqm_b64 exec, exec
2282; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2283; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6
2284; VERDE-NEXT:    s_waitcnt vmcnt(0)
2285; VERDE-NEXT:    ; return to shader part epilog
2286;
2287; GFX6789-LABEL: adjust_writemask_sample_123_to_12:
2288; GFX6789:       ; %bb.0: ; %main_body
2289; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2290; GFX6789-NEXT:    s_wqm_b64 exec, exec
2291; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2292; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6
2293; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2294; GFX6789-NEXT:    ; return to shader part epilog
2295;
2296; GFX10-LABEL: adjust_writemask_sample_123_to_12:
2297; GFX10:       ; %bb.0: ; %main_body
2298; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2299; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2300; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2301; GFX10-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0x6 dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x06,0x80,0xf0,0x00,0x00,0x40,0x00]
2302; GFX10-NEXT:    ; implicit-def: $vcc_hi
2303; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2304; GFX10-NEXT:    ; return to shader part epilog
2305main_body:
2306  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 14, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2307  %out = shufflevector <4 x float> %r, <4 x float> undef, <2 x i32> <i32 0, i32 1>
2308  ret <2 x float> %out
2309}
2310
2311define amdgpu_ps <2 x float> @adjust_writemask_sample_013_to_13(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, float %s) {
2312; VERDE-LABEL: adjust_writemask_sample_013_to_13:
2313; VERDE:       ; %bb.0: ; %main_body
2314; VERDE-NEXT:    s_mov_b64 s[12:13], exec
2315; VERDE-NEXT:    s_wqm_b64 exec, exec
2316; VERDE-NEXT:    s_and_b64 exec, exec, s[12:13]
2317; VERDE-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa
2318; VERDE-NEXT:    s_waitcnt vmcnt(0)
2319; VERDE-NEXT:    ; return to shader part epilog
2320;
2321; GFX6789-LABEL: adjust_writemask_sample_013_to_13:
2322; GFX6789:       ; %bb.0: ; %main_body
2323; GFX6789-NEXT:    s_mov_b64 s[12:13], exec
2324; GFX6789-NEXT:    s_wqm_b64 exec, exec
2325; GFX6789-NEXT:    s_and_b64 exec, exec, s[12:13]
2326; GFX6789-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa
2327; GFX6789-NEXT:    s_waitcnt vmcnt(0)
2328; GFX6789-NEXT:    ; return to shader part epilog
2329;
2330; GFX10-LABEL: adjust_writemask_sample_013_to_13:
2331; GFX10:       ; %bb.0: ; %main_body
2332; GFX10-NEXT:    s_mov_b32 s12, exec_lo ; encoding: [0x7e,0x03,0x8c,0xbe]
2333; GFX10-NEXT:    s_wqm_b32 exec_lo, exec_lo ; encoding: [0x7e,0x09,0xfe,0xbe]
2334; GFX10-NEXT:    s_and_b32 exec_lo, exec_lo, s12 ; encoding: [0x7e,0x0c,0x7e,0x87]
2335; GFX10-NEXT:    image_sample v[0:1], v0, s[0:7], s[8:11] dmask:0xa dim:SQ_RSRC_IMG_1D ; encoding: [0x00,0x0a,0x80,0xf0,0x00,0x00,0x40,0x00]
2336; GFX10-NEXT:    ; implicit-def: $vcc_hi
2337; GFX10-NEXT:    s_waitcnt vmcnt(0) ; encoding: [0x70,0x3f,0x8c,0xbf]
2338; GFX10-NEXT:    ; return to shader part epilog
2339main_body:
2340  %r = call <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32 11, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 0, i32 0, i32 0)
2341  %out = shufflevector <4 x float> %r, <4 x float> undef, <2 x i32> <i32 1, i32 2>
2342  ret <2 x float> %out
2343}
2344
2345declare <4 x float> @llvm.amdgcn.image.sample.1d.v4f32.f32(i32, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2346declare {<4 x float>,i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2347declare <4 x float> @llvm.amdgcn.image.sample.2d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2348declare <4 x float> @llvm.amdgcn.image.sample.3d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2349declare <4 x float> @llvm.amdgcn.image.sample.cube.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2350declare <4 x float> @llvm.amdgcn.image.sample.1darray.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2351declare <4 x float> @llvm.amdgcn.image.sample.2darray.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2352
2353declare <4 x float> @llvm.amdgcn.image.sample.c.1d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2354declare <4 x float> @llvm.amdgcn.image.sample.c.2d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2355declare <4 x float> @llvm.amdgcn.image.sample.cl.1d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2356declare <4 x float> @llvm.amdgcn.image.sample.cl.2d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2357declare <4 x float> @llvm.amdgcn.image.sample.c.cl.1d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2358declare <4 x float> @llvm.amdgcn.image.sample.c.cl.2d.v4f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2359
2360declare <4 x float> @llvm.amdgcn.image.sample.b.1d.v4f32.f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2361declare <4 x float> @llvm.amdgcn.image.sample.b.2d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2362declare <4 x float> @llvm.amdgcn.image.sample.c.b.1d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2363declare <4 x float> @llvm.amdgcn.image.sample.c.b.2d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2364declare <4 x float> @llvm.amdgcn.image.sample.b.cl.1d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2365declare <4 x float> @llvm.amdgcn.image.sample.b.cl.2d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2366declare <4 x float> @llvm.amdgcn.image.sample.c.b.cl.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2367declare <4 x float> @llvm.amdgcn.image.sample.c.b.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2368
2369declare <4 x float> @llvm.amdgcn.image.sample.d.1d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2370declare <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2371declare <4 x float> @llvm.amdgcn.image.sample.c.d.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2372declare <4 x float> @llvm.amdgcn.image.sample.c.d.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2373declare <4 x float> @llvm.amdgcn.image.sample.d.cl.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2374declare <4 x float> @llvm.amdgcn.image.sample.d.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2375declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.1d.v4f32.f32.f32(i32, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2376declare <4 x float> @llvm.amdgcn.image.sample.c.d.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2377
2378declare <4 x float> @llvm.amdgcn.image.sample.cd.1d.v4f32.f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2379declare <4 x float> @llvm.amdgcn.image.sample.cd.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2380declare <4 x float> @llvm.amdgcn.image.sample.c.cd.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2381declare <4 x float> @llvm.amdgcn.image.sample.c.cd.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2382declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.1d.v4f32.f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2383declare <4 x float> @llvm.amdgcn.image.sample.cd.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2384declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.1d.v4f32.f32.f32(i32, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2385declare <4 x float> @llvm.amdgcn.image.sample.c.cd.cl.2d.v4f32.f32.f32(i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2386
2387declare <4 x float> @llvm.amdgcn.image.sample.l.1d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2388declare <4 x float> @llvm.amdgcn.image.sample.l.2d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2389declare <4 x float> @llvm.amdgcn.image.sample.c.l.1d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2390declare <4 x float> @llvm.amdgcn.image.sample.c.l.2d.v4f32.f32(i32, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2391
2392declare <4 x float> @llvm.amdgcn.image.sample.lz.1d.v4f32.f32(i32, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2393declare <4 x float> @llvm.amdgcn.image.sample.lz.2d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2394declare <4 x float> @llvm.amdgcn.image.sample.c.lz.1d.v4f32.f32(i32, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2395declare <4 x float> @llvm.amdgcn.image.sample.c.lz.2d.v4f32.f32(i32, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2396
2397declare float @llvm.amdgcn.image.sample.c.d.o.2darray.f32.f32.f32(i32, i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2398declare {float, i32} @llvm.amdgcn.image.sample.c.d.o.2darray.f32i32.f32.f32(i32, i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2399declare <2 x float> @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32.f32.f32(i32, i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2400declare {<2 x float>, i32} @llvm.amdgcn.image.sample.c.d.o.2darray.v2f32i32.f32.f32(i32, i32, float, float, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32) #1
2401
2402attributes #0 = { nounwind }
2403attributes #1 = { nounwind readonly }
2404attributes #2 = { nounwind readnone }
2405