1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefixes=VERDE %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=fiji -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefixes=FIJI %s
4 ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX6789 %s
5 ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=-enable-prt-strict-null -verify-machineinstrs < %s | FileCheck -check-prefixes=NOPRT %s
6 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10PLUS,GFX10 %s
7 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10PLUS,GFX11 %s
8 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-enable-delay-alu=0 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX12 %s
10 define amdgpu_ps <4 x float> @load_1d(<8 x i32> inreg %rsrc, i32 %s) {
11 ; VERDE-LABEL: load_1d:
12 ; VERDE: ; %bb.0: ; %main_body
13 ; VERDE-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm
14 ; VERDE-NEXT: s_waitcnt vmcnt(0)
15 ; VERDE-NEXT: ; return to shader part epilog
17 ; FIJI-LABEL: load_1d:
18 ; FIJI: ; %bb.0: ; %main_body
19 ; FIJI-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm
20 ; FIJI-NEXT: s_waitcnt vmcnt(0)
21 ; FIJI-NEXT: ; return to shader part epilog
23 ; GFX6789-LABEL: load_1d:
24 ; GFX6789: ; %bb.0: ; %main_body
25 ; GFX6789-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm
26 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
27 ; GFX6789-NEXT: ; return to shader part epilog
29 ; NOPRT-LABEL: load_1d:
30 ; NOPRT: ; %bb.0: ; %main_body
31 ; NOPRT-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm
32 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
33 ; NOPRT-NEXT: ; return to shader part epilog
35 ; GFX10PLUS-LABEL: load_1d:
36 ; GFX10PLUS: ; %bb.0: ; %main_body
37 ; GFX10PLUS-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
38 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
39 ; GFX10PLUS-NEXT: ; return to shader part epilog
41 ; GFX12-LABEL: load_1d:
42 ; GFX12: ; %bb.0: ; %main_body
43 ; GFX12-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D
44 ; GFX12-NEXT: s_wait_loadcnt 0x0
45 ; GFX12-NEXT: ; return to shader part epilog
47 %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i32(i32 15, i32 %s, <8 x i32> %rsrc, i32 0, i32 0)
51 define amdgpu_ps <4 x float> @load_1d_tfe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s) {
52 ; VERDE-LABEL: load_1d_tfe:
53 ; VERDE: ; %bb.0: ; %main_body
54 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
55 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
56 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
57 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
58 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
59 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
60 ; VERDE-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf unorm tfe
61 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
62 ; VERDE-NEXT: s_mov_b32 s10, -1
63 ; VERDE-NEXT: s_waitcnt vmcnt(0)
64 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
65 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
66 ; VERDE-NEXT: ; return to shader part epilog
68 ; FIJI-LABEL: load_1d_tfe:
69 ; FIJI: ; %bb.0: ; %main_body
70 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
71 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
72 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
73 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
74 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
75 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
76 ; FIJI-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf unorm tfe
77 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
78 ; FIJI-NEXT: s_mov_b32 s10, -1
79 ; FIJI-NEXT: s_waitcnt vmcnt(0)
80 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
81 ; FIJI-NEXT: s_waitcnt vmcnt(0)
82 ; FIJI-NEXT: ; return to shader part epilog
84 ; GFX6789-LABEL: load_1d_tfe:
85 ; GFX6789: ; %bb.0: ; %main_body
86 ; GFX6789-NEXT: v_mov_b32_e32 v6, 0
87 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
88 ; GFX6789-NEXT: v_mov_b32_e32 v7, v6
89 ; GFX6789-NEXT: v_mov_b32_e32 v8, v6
90 ; GFX6789-NEXT: v_mov_b32_e32 v9, v6
91 ; GFX6789-NEXT: v_mov_b32_e32 v10, v6
92 ; GFX6789-NEXT: v_mov_b32_e32 v0, v6
93 ; GFX6789-NEXT: v_mov_b32_e32 v1, v7
94 ; GFX6789-NEXT: v_mov_b32_e32 v2, v8
95 ; GFX6789-NEXT: v_mov_b32_e32 v3, v9
96 ; GFX6789-NEXT: v_mov_b32_e32 v4, v10
97 ; GFX6789-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf unorm tfe
98 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
99 ; GFX6789-NEXT: global_store_dword v6, v4, s[8:9]
100 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
101 ; GFX6789-NEXT: ; return to shader part epilog
103 ; NOPRT-LABEL: load_1d_tfe:
104 ; NOPRT: ; %bb.0: ; %main_body
105 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
106 ; NOPRT-NEXT: image_load v[0:4], v0, s[0:7] dmask:0xf unorm tfe
107 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
108 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
109 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
110 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
111 ; NOPRT-NEXT: ; return to shader part epilog
113 ; GFX10-LABEL: load_1d_tfe:
114 ; GFX10: ; %bb.0: ; %main_body
115 ; GFX10-NEXT: v_mov_b32_e32 v6, 0
116 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
117 ; GFX10-NEXT: v_mov_b32_e32 v7, v6
118 ; GFX10-NEXT: v_mov_b32_e32 v8, v6
119 ; GFX10-NEXT: v_mov_b32_e32 v9, v6
120 ; GFX10-NEXT: v_mov_b32_e32 v10, v6
121 ; GFX10-NEXT: v_mov_b32_e32 v0, v6
122 ; GFX10-NEXT: v_mov_b32_e32 v1, v7
123 ; GFX10-NEXT: v_mov_b32_e32 v2, v8
124 ; GFX10-NEXT: v_mov_b32_e32 v3, v9
125 ; GFX10-NEXT: v_mov_b32_e32 v4, v10
126 ; GFX10-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm tfe
127 ; GFX10-NEXT: s_waitcnt vmcnt(0)
128 ; GFX10-NEXT: global_store_dword v6, v4, s[8:9]
129 ; GFX10-NEXT: ; return to shader part epilog
131 ; GFX11-LABEL: load_1d_tfe:
132 ; GFX11: ; %bb.0: ; %main_body
133 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v6, 0
134 ; GFX11-NEXT: v_mov_b32_e32 v7, v6
135 ; GFX11-NEXT: v_mov_b32_e32 v8, v6
136 ; GFX11-NEXT: v_mov_b32_e32 v9, v6
137 ; GFX11-NEXT: v_mov_b32_e32 v10, v6
138 ; GFX11-NEXT: v_dual_mov_b32 v0, v6 :: v_dual_mov_b32 v1, v7
139 ; GFX11-NEXT: v_dual_mov_b32 v2, v8 :: v_dual_mov_b32 v3, v9
140 ; GFX11-NEXT: v_mov_b32_e32 v4, v10
141 ; GFX11-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm tfe
142 ; GFX11-NEXT: s_waitcnt vmcnt(0)
143 ; GFX11-NEXT: global_store_b32 v6, v4, s[8:9]
144 ; GFX11-NEXT: ; return to shader part epilog
146 ; GFX12-LABEL: load_1d_tfe:
147 ; GFX12: ; %bb.0: ; %main_body
148 ; GFX12-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v6, 0
149 ; GFX12-NEXT: v_dual_mov_b32 v7, v6 :: v_dual_mov_b32 v8, v6
150 ; GFX12-NEXT: v_dual_mov_b32 v9, v6 :: v_dual_mov_b32 v10, v6
151 ; GFX12-NEXT: v_dual_mov_b32 v0, v6 :: v_dual_mov_b32 v1, v7
152 ; GFX12-NEXT: v_dual_mov_b32 v2, v8 :: v_dual_mov_b32 v3, v9
153 ; GFX12-NEXT: v_mov_b32_e32 v4, v10
154 ; GFX12-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D tfe
155 ; GFX12-NEXT: s_wait_loadcnt 0x0
156 ; GFX12-NEXT: global_store_b32 v6, v4, s[8:9]
157 ; GFX12-NEXT: ; return to shader part epilog
159 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32 15, i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
160 %v.vec = extractvalue {<4 x float>, i32} %v, 0
161 %v.err = extractvalue {<4 x float>, i32} %v, 1
162 store i32 %v.err, ptr addrspace(1) %out, align 4
163 ret <4 x float> %v.vec
166 define amdgpu_ps <4 x float> @load_1d_lwe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s) {
167 ; VERDE-LABEL: load_1d_lwe:
168 ; VERDE: ; %bb.0: ; %main_body
169 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
170 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
171 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
172 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
173 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
174 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
175 ; VERDE-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf unorm lwe
176 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
177 ; VERDE-NEXT: s_mov_b32 s10, -1
178 ; VERDE-NEXT: s_waitcnt vmcnt(0)
179 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
180 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
181 ; VERDE-NEXT: ; return to shader part epilog
183 ; FIJI-LABEL: load_1d_lwe:
184 ; FIJI: ; %bb.0: ; %main_body
185 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
186 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
187 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
188 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
189 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
190 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
191 ; FIJI-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf unorm lwe
192 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
193 ; FIJI-NEXT: s_mov_b32 s10, -1
194 ; FIJI-NEXT: s_waitcnt vmcnt(0)
195 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
196 ; FIJI-NEXT: s_waitcnt vmcnt(0)
197 ; FIJI-NEXT: ; return to shader part epilog
199 ; GFX6789-LABEL: load_1d_lwe:
200 ; GFX6789: ; %bb.0: ; %main_body
201 ; GFX6789-NEXT: v_mov_b32_e32 v6, 0
202 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
203 ; GFX6789-NEXT: v_mov_b32_e32 v7, v6
204 ; GFX6789-NEXT: v_mov_b32_e32 v8, v6
205 ; GFX6789-NEXT: v_mov_b32_e32 v9, v6
206 ; GFX6789-NEXT: v_mov_b32_e32 v10, v6
207 ; GFX6789-NEXT: v_mov_b32_e32 v0, v6
208 ; GFX6789-NEXT: v_mov_b32_e32 v1, v7
209 ; GFX6789-NEXT: v_mov_b32_e32 v2, v8
210 ; GFX6789-NEXT: v_mov_b32_e32 v3, v9
211 ; GFX6789-NEXT: v_mov_b32_e32 v4, v10
212 ; GFX6789-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf unorm lwe
213 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
214 ; GFX6789-NEXT: global_store_dword v6, v4, s[8:9]
215 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
216 ; GFX6789-NEXT: ; return to shader part epilog
218 ; NOPRT-LABEL: load_1d_lwe:
219 ; NOPRT: ; %bb.0: ; %main_body
220 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
221 ; NOPRT-NEXT: image_load v[0:4], v0, s[0:7] dmask:0xf unorm lwe
222 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
223 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
224 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
225 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
226 ; NOPRT-NEXT: ; return to shader part epilog
228 ; GFX10-LABEL: load_1d_lwe:
229 ; GFX10: ; %bb.0: ; %main_body
230 ; GFX10-NEXT: v_mov_b32_e32 v6, 0
231 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
232 ; GFX10-NEXT: v_mov_b32_e32 v7, v6
233 ; GFX10-NEXT: v_mov_b32_e32 v8, v6
234 ; GFX10-NEXT: v_mov_b32_e32 v9, v6
235 ; GFX10-NEXT: v_mov_b32_e32 v10, v6
236 ; GFX10-NEXT: v_mov_b32_e32 v0, v6
237 ; GFX10-NEXT: v_mov_b32_e32 v1, v7
238 ; GFX10-NEXT: v_mov_b32_e32 v2, v8
239 ; GFX10-NEXT: v_mov_b32_e32 v3, v9
240 ; GFX10-NEXT: v_mov_b32_e32 v4, v10
241 ; GFX10-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm lwe
242 ; GFX10-NEXT: s_waitcnt vmcnt(0)
243 ; GFX10-NEXT: global_store_dword v6, v4, s[8:9]
244 ; GFX10-NEXT: ; return to shader part epilog
246 ; GFX11-LABEL: load_1d_lwe:
247 ; GFX11: ; %bb.0: ; %main_body
248 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v6, 0
249 ; GFX11-NEXT: v_mov_b32_e32 v7, v6
250 ; GFX11-NEXT: v_mov_b32_e32 v8, v6
251 ; GFX11-NEXT: v_mov_b32_e32 v9, v6
252 ; GFX11-NEXT: v_mov_b32_e32 v10, v6
253 ; GFX11-NEXT: v_dual_mov_b32 v0, v6 :: v_dual_mov_b32 v1, v7
254 ; GFX11-NEXT: v_dual_mov_b32 v2, v8 :: v_dual_mov_b32 v3, v9
255 ; GFX11-NEXT: v_mov_b32_e32 v4, v10
256 ; GFX11-NEXT: image_load v[0:4], v5, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm lwe
257 ; GFX11-NEXT: s_waitcnt vmcnt(0)
258 ; GFX11-NEXT: global_store_b32 v6, v4, s[8:9]
259 ; GFX11-NEXT: ; return to shader part epilog
261 ; GFX12-LABEL: load_1d_lwe:
262 ; GFX12: ; %bb.0: ; %main_body
263 ; GFX12-NEXT: image_load v[0:4], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D
264 ; GFX12-NEXT: v_mov_b32_e32 v5, 0
265 ; GFX12-NEXT: s_wait_loadcnt 0x0
266 ; GFX12-NEXT: global_store_b32 v5, v4, s[8:9]
267 ; GFX12-NEXT: ; return to shader part epilog
269 %v = call {<4 x float>, i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32 15, i32 %s, <8 x i32> %rsrc, i32 2, i32 0)
270 %v.vec = extractvalue {<4 x float>, i32} %v, 0
271 %v.err = extractvalue {<4 x float>, i32} %v, 1
272 store i32 %v.err, ptr addrspace(1) %out, align 4
273 ret <4 x float> %v.vec
276 define amdgpu_ps <4 x float> @load_2d(<8 x i32> inreg %rsrc, i32 %s, i32 %t) {
277 ; VERDE-LABEL: load_2d:
278 ; VERDE: ; %bb.0: ; %main_body
279 ; VERDE-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm
280 ; VERDE-NEXT: s_waitcnt vmcnt(0)
281 ; VERDE-NEXT: ; return to shader part epilog
283 ; FIJI-LABEL: load_2d:
284 ; FIJI: ; %bb.0: ; %main_body
285 ; FIJI-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm
286 ; FIJI-NEXT: s_waitcnt vmcnt(0)
287 ; FIJI-NEXT: ; return to shader part epilog
289 ; GFX6789-LABEL: load_2d:
290 ; GFX6789: ; %bb.0: ; %main_body
291 ; GFX6789-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm
292 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
293 ; GFX6789-NEXT: ; return to shader part epilog
295 ; NOPRT-LABEL: load_2d:
296 ; NOPRT: ; %bb.0: ; %main_body
297 ; NOPRT-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm
298 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
299 ; NOPRT-NEXT: ; return to shader part epilog
301 ; GFX10PLUS-LABEL: load_2d:
302 ; GFX10PLUS: ; %bb.0: ; %main_body
303 ; GFX10PLUS-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
304 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
305 ; GFX10PLUS-NEXT: ; return to shader part epilog
307 ; GFX12-LABEL: load_2d:
308 ; GFX12: ; %bb.0: ; %main_body
309 ; GFX12-NEXT: image_load v[0:3], [v0, v1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D
310 ; GFX12-NEXT: s_wait_loadcnt 0x0
311 ; GFX12-NEXT: ; return to shader part epilog
313 %v = call <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i32(i32 15, i32 %s, i32 %t, <8 x i32> %rsrc, i32 0, i32 0)
317 define amdgpu_ps <4 x float> @load_2d_tfe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %t) {
318 ; VERDE-LABEL: load_2d_tfe:
319 ; VERDE: ; %bb.0: ; %main_body
320 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
321 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
322 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
323 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
324 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
325 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
326 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
327 ; VERDE-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf unorm tfe
328 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
329 ; VERDE-NEXT: s_mov_b32 s10, -1
330 ; VERDE-NEXT: s_waitcnt vmcnt(0)
331 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
332 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
333 ; VERDE-NEXT: ; return to shader part epilog
335 ; FIJI-LABEL: load_2d_tfe:
336 ; FIJI: ; %bb.0: ; %main_body
337 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
338 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
339 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
340 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
341 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
342 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
343 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
344 ; FIJI-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf unorm tfe
345 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
346 ; FIJI-NEXT: s_mov_b32 s10, -1
347 ; FIJI-NEXT: s_waitcnt vmcnt(0)
348 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
349 ; FIJI-NEXT: s_waitcnt vmcnt(0)
350 ; FIJI-NEXT: ; return to shader part epilog
352 ; GFX6789-LABEL: load_2d_tfe:
353 ; GFX6789: ; %bb.0: ; %main_body
354 ; GFX6789-NEXT: v_mov_b32_e32 v7, 0
355 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
356 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
357 ; GFX6789-NEXT: v_mov_b32_e32 v8, v7
358 ; GFX6789-NEXT: v_mov_b32_e32 v9, v7
359 ; GFX6789-NEXT: v_mov_b32_e32 v10, v7
360 ; GFX6789-NEXT: v_mov_b32_e32 v11, v7
361 ; GFX6789-NEXT: v_mov_b32_e32 v0, v7
362 ; GFX6789-NEXT: v_mov_b32_e32 v1, v8
363 ; GFX6789-NEXT: v_mov_b32_e32 v2, v9
364 ; GFX6789-NEXT: v_mov_b32_e32 v3, v10
365 ; GFX6789-NEXT: v_mov_b32_e32 v4, v11
366 ; GFX6789-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf unorm tfe
367 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
368 ; GFX6789-NEXT: global_store_dword v7, v4, s[8:9]
369 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
370 ; GFX6789-NEXT: ; return to shader part epilog
372 ; NOPRT-LABEL: load_2d_tfe:
373 ; NOPRT: ; %bb.0: ; %main_body
374 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
375 ; NOPRT-NEXT: image_load v[0:4], v[0:1], s[0:7] dmask:0xf unorm tfe
376 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
377 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
378 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
379 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
380 ; NOPRT-NEXT: ; return to shader part epilog
382 ; GFX10-LABEL: load_2d_tfe:
383 ; GFX10: ; %bb.0: ; %main_body
384 ; GFX10-NEXT: v_mov_b32_e32 v7, 0
385 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
386 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
387 ; GFX10-NEXT: v_mov_b32_e32 v8, v7
388 ; GFX10-NEXT: v_mov_b32_e32 v9, v7
389 ; GFX10-NEXT: v_mov_b32_e32 v10, v7
390 ; GFX10-NEXT: v_mov_b32_e32 v11, v7
391 ; GFX10-NEXT: v_mov_b32_e32 v0, v7
392 ; GFX10-NEXT: v_mov_b32_e32 v1, v8
393 ; GFX10-NEXT: v_mov_b32_e32 v2, v9
394 ; GFX10-NEXT: v_mov_b32_e32 v3, v10
395 ; GFX10-NEXT: v_mov_b32_e32 v4, v11
396 ; GFX10-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm tfe
397 ; GFX10-NEXT: s_waitcnt vmcnt(0)
398 ; GFX10-NEXT: global_store_dword v7, v4, s[8:9]
399 ; GFX10-NEXT: ; return to shader part epilog
401 ; GFX11-LABEL: load_2d_tfe:
402 ; GFX11: ; %bb.0: ; %main_body
403 ; GFX11-NEXT: v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v6, v1
404 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v8, v7
405 ; GFX11-NEXT: v_mov_b32_e32 v9, v7
406 ; GFX11-NEXT: v_mov_b32_e32 v10, v7
407 ; GFX11-NEXT: v_mov_b32_e32 v11, v7
408 ; GFX11-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
409 ; GFX11-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
410 ; GFX11-NEXT: v_mov_b32_e32 v4, v11
411 ; GFX11-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm tfe
412 ; GFX11-NEXT: s_waitcnt vmcnt(0)
413 ; GFX11-NEXT: global_store_b32 v7, v4, s[8:9]
414 ; GFX11-NEXT: ; return to shader part epilog
416 ; GFX12-LABEL: load_2d_tfe:
417 ; GFX12: ; %bb.0: ; %main_body
418 ; GFX12-NEXT: v_mov_b32_e32 v7, 0
419 ; GFX12-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v6, v0
420 ; GFX12-NEXT: v_dual_mov_b32 v8, v7 :: v_dual_mov_b32 v9, v7
421 ; GFX12-NEXT: v_dual_mov_b32 v10, v7 :: v_dual_mov_b32 v11, v7
422 ; GFX12-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
423 ; GFX12-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
424 ; GFX12-NEXT: v_mov_b32_e32 v4, v11
425 ; GFX12-NEXT: image_load v[0:4], [v6, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D tfe
426 ; GFX12-NEXT: s_wait_loadcnt 0x0
427 ; GFX12-NEXT: global_store_b32 v7, v4, s[8:9]
428 ; GFX12-NEXT: ; return to shader part epilog
430 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.2d.v4f32i32.i32(i32 15, i32 %s, i32 %t, <8 x i32> %rsrc, i32 1, i32 0)
431 %v.vec = extractvalue {<4 x float>, i32} %v, 0
432 %v.err = extractvalue {<4 x float>, i32} %v, 1
433 store i32 %v.err, ptr addrspace(1) %out, align 4
434 ret <4 x float> %v.vec
437 define amdgpu_ps <4 x float> @load_3d(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %r) {
438 ; VERDE-LABEL: load_3d:
439 ; VERDE: ; %bb.0: ; %main_body
440 ; VERDE-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm
441 ; VERDE-NEXT: s_waitcnt vmcnt(0)
442 ; VERDE-NEXT: ; return to shader part epilog
444 ; FIJI-LABEL: load_3d:
445 ; FIJI: ; %bb.0: ; %main_body
446 ; FIJI-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm
447 ; FIJI-NEXT: s_waitcnt vmcnt(0)
448 ; FIJI-NEXT: ; return to shader part epilog
450 ; GFX6789-LABEL: load_3d:
451 ; GFX6789: ; %bb.0: ; %main_body
452 ; GFX6789-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm
453 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
454 ; GFX6789-NEXT: ; return to shader part epilog
456 ; NOPRT-LABEL: load_3d:
457 ; NOPRT: ; %bb.0: ; %main_body
458 ; NOPRT-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm
459 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
460 ; NOPRT-NEXT: ; return to shader part epilog
462 ; GFX10PLUS-LABEL: load_3d:
463 ; GFX10PLUS: ; %bb.0: ; %main_body
464 ; GFX10PLUS-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm
465 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
466 ; GFX10PLUS-NEXT: ; return to shader part epilog
468 ; GFX12-LABEL: load_3d:
469 ; GFX12: ; %bb.0: ; %main_body
470 ; GFX12-NEXT: image_load v[0:3], [v0, v1, v2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D
471 ; GFX12-NEXT: s_wait_loadcnt 0x0
472 ; GFX12-NEXT: ; return to shader part epilog
474 %v = call <4 x float> @llvm.amdgcn.image.load.3d.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %r, <8 x i32> %rsrc, i32 0, i32 0)
478 define amdgpu_ps <4 x float> @load_3d_tfe_lwe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %t, i32 %r) {
479 ; VERDE-LABEL: load_3d_tfe_lwe:
480 ; VERDE: ; %bb.0: ; %main_body
481 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
482 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
483 ; VERDE-NEXT: v_mov_b32_e32 v7, v2
484 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
485 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
486 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
487 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
488 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
489 ; VERDE-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe lwe
490 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
491 ; VERDE-NEXT: s_mov_b32 s10, -1
492 ; VERDE-NEXT: s_waitcnt vmcnt(0)
493 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
494 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
495 ; VERDE-NEXT: ; return to shader part epilog
497 ; FIJI-LABEL: load_3d_tfe_lwe:
498 ; FIJI: ; %bb.0: ; %main_body
499 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
500 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
501 ; FIJI-NEXT: v_mov_b32_e32 v7, v2
502 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
503 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
504 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
505 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
506 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
507 ; FIJI-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe lwe
508 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
509 ; FIJI-NEXT: s_mov_b32 s10, -1
510 ; FIJI-NEXT: s_waitcnt vmcnt(0)
511 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
512 ; FIJI-NEXT: s_waitcnt vmcnt(0)
513 ; FIJI-NEXT: ; return to shader part epilog
515 ; GFX6789-LABEL: load_3d_tfe_lwe:
516 ; GFX6789: ; %bb.0: ; %main_body
517 ; GFX6789-NEXT: v_mov_b32_e32 v8, 0
518 ; GFX6789-NEXT: v_mov_b32_e32 v7, v2
519 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
520 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
521 ; GFX6789-NEXT: v_mov_b32_e32 v9, v8
522 ; GFX6789-NEXT: v_mov_b32_e32 v10, v8
523 ; GFX6789-NEXT: v_mov_b32_e32 v11, v8
524 ; GFX6789-NEXT: v_mov_b32_e32 v12, v8
525 ; GFX6789-NEXT: v_mov_b32_e32 v0, v8
526 ; GFX6789-NEXT: v_mov_b32_e32 v1, v9
527 ; GFX6789-NEXT: v_mov_b32_e32 v2, v10
528 ; GFX6789-NEXT: v_mov_b32_e32 v3, v11
529 ; GFX6789-NEXT: v_mov_b32_e32 v4, v12
530 ; GFX6789-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe lwe
531 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
532 ; GFX6789-NEXT: global_store_dword v8, v4, s[8:9]
533 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
534 ; GFX6789-NEXT: ; return to shader part epilog
536 ; NOPRT-LABEL: load_3d_tfe_lwe:
537 ; NOPRT: ; %bb.0: ; %main_body
538 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
539 ; NOPRT-NEXT: image_load v[0:4], v[0:2], s[0:7] dmask:0xf unorm tfe lwe
540 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
541 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
542 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
543 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
544 ; NOPRT-NEXT: ; return to shader part epilog
546 ; GFX10-LABEL: load_3d_tfe_lwe:
547 ; GFX10: ; %bb.0: ; %main_body
548 ; GFX10-NEXT: v_mov_b32_e32 v8, 0
549 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
550 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
551 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
552 ; GFX10-NEXT: v_mov_b32_e32 v9, v8
553 ; GFX10-NEXT: v_mov_b32_e32 v10, v8
554 ; GFX10-NEXT: v_mov_b32_e32 v11, v8
555 ; GFX10-NEXT: v_mov_b32_e32 v12, v8
556 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
557 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
558 ; GFX10-NEXT: v_mov_b32_e32 v2, v10
559 ; GFX10-NEXT: v_mov_b32_e32 v3, v11
560 ; GFX10-NEXT: v_mov_b32_e32 v4, v12
561 ; GFX10-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm tfe lwe
562 ; GFX10-NEXT: s_waitcnt vmcnt(0)
563 ; GFX10-NEXT: global_store_dword v8, v4, s[8:9]
564 ; GFX10-NEXT: ; return to shader part epilog
566 ; GFX11-LABEL: load_3d_tfe_lwe:
567 ; GFX11: ; %bb.0: ; %main_body
568 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v8, 0
569 ; GFX11-NEXT: v_dual_mov_b32 v7, v2 :: v_dual_mov_b32 v6, v1
570 ; GFX11-NEXT: v_mov_b32_e32 v9, v8
571 ; GFX11-NEXT: v_mov_b32_e32 v10, v8
572 ; GFX11-NEXT: v_mov_b32_e32 v11, v8
573 ; GFX11-NEXT: v_mov_b32_e32 v12, v8
574 ; GFX11-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_mov_b32 v1, v9
575 ; GFX11-NEXT: v_dual_mov_b32 v2, v10 :: v_dual_mov_b32 v3, v11
576 ; GFX11-NEXT: v_mov_b32_e32 v4, v12
577 ; GFX11-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm tfe lwe
578 ; GFX11-NEXT: s_waitcnt vmcnt(0)
579 ; GFX11-NEXT: global_store_b32 v8, v4, s[8:9]
580 ; GFX11-NEXT: ; return to shader part epilog
582 ; GFX12-LABEL: load_3d_tfe_lwe:
583 ; GFX12: ; %bb.0: ; %main_body
584 ; GFX12-NEXT: v_dual_mov_b32 v7, v0 :: v_dual_mov_b32 v8, 0
585 ; GFX12-NEXT: v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v6, v1
586 ; GFX12-NEXT: v_dual_mov_b32 v9, v8 :: v_dual_mov_b32 v10, v8
587 ; GFX12-NEXT: v_dual_mov_b32 v11, v8 :: v_dual_mov_b32 v12, v8
588 ; GFX12-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_mov_b32 v1, v9
589 ; GFX12-NEXT: v_dual_mov_b32 v2, v10 :: v_dual_mov_b32 v3, v11
590 ; GFX12-NEXT: v_mov_b32_e32 v4, v12
591 ; GFX12-NEXT: image_load v[0:4], [v7, v6, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D tfe
592 ; GFX12-NEXT: s_wait_loadcnt 0x0
593 ; GFX12-NEXT: global_store_b32 v8, v4, s[8:9]
594 ; GFX12-NEXT: ; return to shader part epilog
596 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.3d.v4f32i32.i32(i32 15, i32 %s, i32 %t, i32 %r, <8 x i32> %rsrc, i32 3, i32 0)
597 %v.vec = extractvalue {<4 x float>, i32} %v, 0
598 %v.err = extractvalue {<4 x float>, i32} %v, 1
599 store i32 %v.err, ptr addrspace(1) %out, align 4
600 ret <4 x float> %v.vec
603 define amdgpu_ps <4 x float> @load_cube(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %slice) {
604 ; VERDE-LABEL: load_cube:
605 ; VERDE: ; %bb.0: ; %main_body
606 ; VERDE-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
607 ; VERDE-NEXT: s_waitcnt vmcnt(0)
608 ; VERDE-NEXT: ; return to shader part epilog
610 ; FIJI-LABEL: load_cube:
611 ; FIJI: ; %bb.0: ; %main_body
612 ; FIJI-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
613 ; FIJI-NEXT: s_waitcnt vmcnt(0)
614 ; FIJI-NEXT: ; return to shader part epilog
616 ; GFX6789-LABEL: load_cube:
617 ; GFX6789: ; %bb.0: ; %main_body
618 ; GFX6789-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
619 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
620 ; GFX6789-NEXT: ; return to shader part epilog
622 ; NOPRT-LABEL: load_cube:
623 ; NOPRT: ; %bb.0: ; %main_body
624 ; NOPRT-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
625 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
626 ; NOPRT-NEXT: ; return to shader part epilog
628 ; GFX10PLUS-LABEL: load_cube:
629 ; GFX10PLUS: ; %bb.0: ; %main_body
630 ; GFX10PLUS-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm
631 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
632 ; GFX10PLUS-NEXT: ; return to shader part epilog
634 ; GFX12-LABEL: load_cube:
635 ; GFX12: ; %bb.0: ; %main_body
636 ; GFX12-NEXT: image_load v[0:3], [v0, v1, v2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE
637 ; GFX12-NEXT: s_wait_loadcnt 0x0
638 ; GFX12-NEXT: ; return to shader part epilog
640 %v = call <4 x float> @llvm.amdgcn.image.load.cube.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %slice, <8 x i32> %rsrc, i32 0, i32 0)
644 define amdgpu_ps <4 x float> @load_cube_lwe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %t, i32 %slice) {
645 ; VERDE-LABEL: load_cube_lwe:
646 ; VERDE: ; %bb.0: ; %main_body
647 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
648 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
649 ; VERDE-NEXT: v_mov_b32_e32 v7, v2
650 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
651 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
652 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
653 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
654 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
655 ; VERDE-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm lwe da
656 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
657 ; VERDE-NEXT: s_mov_b32 s10, -1
658 ; VERDE-NEXT: s_waitcnt vmcnt(0)
659 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
660 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
661 ; VERDE-NEXT: ; return to shader part epilog
663 ; FIJI-LABEL: load_cube_lwe:
664 ; FIJI: ; %bb.0: ; %main_body
665 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
666 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
667 ; FIJI-NEXT: v_mov_b32_e32 v7, v2
668 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
669 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
670 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
671 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
672 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
673 ; FIJI-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm lwe da
674 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
675 ; FIJI-NEXT: s_mov_b32 s10, -1
676 ; FIJI-NEXT: s_waitcnt vmcnt(0)
677 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
678 ; FIJI-NEXT: s_waitcnt vmcnt(0)
679 ; FIJI-NEXT: ; return to shader part epilog
681 ; GFX6789-LABEL: load_cube_lwe:
682 ; GFX6789: ; %bb.0: ; %main_body
683 ; GFX6789-NEXT: v_mov_b32_e32 v8, 0
684 ; GFX6789-NEXT: v_mov_b32_e32 v7, v2
685 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
686 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
687 ; GFX6789-NEXT: v_mov_b32_e32 v9, v8
688 ; GFX6789-NEXT: v_mov_b32_e32 v10, v8
689 ; GFX6789-NEXT: v_mov_b32_e32 v11, v8
690 ; GFX6789-NEXT: v_mov_b32_e32 v12, v8
691 ; GFX6789-NEXT: v_mov_b32_e32 v0, v8
692 ; GFX6789-NEXT: v_mov_b32_e32 v1, v9
693 ; GFX6789-NEXT: v_mov_b32_e32 v2, v10
694 ; GFX6789-NEXT: v_mov_b32_e32 v3, v11
695 ; GFX6789-NEXT: v_mov_b32_e32 v4, v12
696 ; GFX6789-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm lwe da
697 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
698 ; GFX6789-NEXT: global_store_dword v8, v4, s[8:9]
699 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
700 ; GFX6789-NEXT: ; return to shader part epilog
702 ; NOPRT-LABEL: load_cube_lwe:
703 ; NOPRT: ; %bb.0: ; %main_body
704 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
705 ; NOPRT-NEXT: image_load v[0:4], v[0:2], s[0:7] dmask:0xf unorm lwe da
706 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
707 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
708 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
709 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
710 ; NOPRT-NEXT: ; return to shader part epilog
712 ; GFX10-LABEL: load_cube_lwe:
713 ; GFX10: ; %bb.0: ; %main_body
714 ; GFX10-NEXT: v_mov_b32_e32 v8, 0
715 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
716 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
717 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
718 ; GFX10-NEXT: v_mov_b32_e32 v9, v8
719 ; GFX10-NEXT: v_mov_b32_e32 v10, v8
720 ; GFX10-NEXT: v_mov_b32_e32 v11, v8
721 ; GFX10-NEXT: v_mov_b32_e32 v12, v8
722 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
723 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
724 ; GFX10-NEXT: v_mov_b32_e32 v2, v10
725 ; GFX10-NEXT: v_mov_b32_e32 v3, v11
726 ; GFX10-NEXT: v_mov_b32_e32 v4, v12
727 ; GFX10-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm lwe
728 ; GFX10-NEXT: s_waitcnt vmcnt(0)
729 ; GFX10-NEXT: global_store_dword v8, v4, s[8:9]
730 ; GFX10-NEXT: ; return to shader part epilog
732 ; GFX11-LABEL: load_cube_lwe:
733 ; GFX11: ; %bb.0: ; %main_body
734 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v8, 0
735 ; GFX11-NEXT: v_dual_mov_b32 v7, v2 :: v_dual_mov_b32 v6, v1
736 ; GFX11-NEXT: v_mov_b32_e32 v9, v8
737 ; GFX11-NEXT: v_mov_b32_e32 v10, v8
738 ; GFX11-NEXT: v_mov_b32_e32 v11, v8
739 ; GFX11-NEXT: v_mov_b32_e32 v12, v8
740 ; GFX11-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_mov_b32 v1, v9
741 ; GFX11-NEXT: v_dual_mov_b32 v2, v10 :: v_dual_mov_b32 v3, v11
742 ; GFX11-NEXT: v_mov_b32_e32 v4, v12
743 ; GFX11-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm lwe
744 ; GFX11-NEXT: s_waitcnt vmcnt(0)
745 ; GFX11-NEXT: global_store_b32 v8, v4, s[8:9]
746 ; GFX11-NEXT: ; return to shader part epilog
748 ; GFX12-LABEL: load_cube_lwe:
749 ; GFX12: ; %bb.0: ; %main_body
750 ; GFX12-NEXT: image_load v[0:4], [v0, v1, v2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE
751 ; GFX12-NEXT: v_mov_b32_e32 v5, 0
752 ; GFX12-NEXT: s_wait_loadcnt 0x0
753 ; GFX12-NEXT: global_store_b32 v5, v4, s[8:9]
754 ; GFX12-NEXT: ; return to shader part epilog
756 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.cube.v4f32i32.i32(i32 15, i32 %s, i32 %t, i32 %slice, <8 x i32> %rsrc, i32 2, i32 0)
757 %v.vec = extractvalue {<4 x float>, i32} %v, 0
758 %v.err = extractvalue {<4 x float>, i32} %v, 1
759 store i32 %v.err, ptr addrspace(1) %out, align 4
760 ret <4 x float> %v.vec
763 define amdgpu_ps <4 x float> @load_1darray(<8 x i32> inreg %rsrc, i32 %s, i32 %slice) {
764 ; VERDE-LABEL: load_1darray:
765 ; VERDE: ; %bb.0: ; %main_body
766 ; VERDE-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm da
767 ; VERDE-NEXT: s_waitcnt vmcnt(0)
768 ; VERDE-NEXT: ; return to shader part epilog
770 ; FIJI-LABEL: load_1darray:
771 ; FIJI: ; %bb.0: ; %main_body
772 ; FIJI-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm da
773 ; FIJI-NEXT: s_waitcnt vmcnt(0)
774 ; FIJI-NEXT: ; return to shader part epilog
776 ; GFX6789-LABEL: load_1darray:
777 ; GFX6789: ; %bb.0: ; %main_body
778 ; GFX6789-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm da
779 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
780 ; GFX6789-NEXT: ; return to shader part epilog
782 ; NOPRT-LABEL: load_1darray:
783 ; NOPRT: ; %bb.0: ; %main_body
784 ; NOPRT-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf unorm da
785 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
786 ; NOPRT-NEXT: ; return to shader part epilog
788 ; GFX10PLUS-LABEL: load_1darray:
789 ; GFX10PLUS: ; %bb.0: ; %main_body
790 ; GFX10PLUS-NEXT: image_load v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm
791 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
792 ; GFX10PLUS-NEXT: ; return to shader part epilog
794 ; GFX12-LABEL: load_1darray:
795 ; GFX12: ; %bb.0: ; %main_body
796 ; GFX12-NEXT: image_load v[0:3], [v0, v1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY
797 ; GFX12-NEXT: s_wait_loadcnt 0x0
798 ; GFX12-NEXT: ; return to shader part epilog
800 %v = call <4 x float> @llvm.amdgcn.image.load.1darray.v4f32.i32(i32 15, i32 %s, i32 %slice, <8 x i32> %rsrc, i32 0, i32 0)
804 define amdgpu_ps <4 x float> @load_1darray_tfe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %slice) {
805 ; VERDE-LABEL: load_1darray_tfe:
806 ; VERDE: ; %bb.0: ; %main_body
807 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
808 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
809 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
810 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
811 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
812 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
813 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
814 ; VERDE-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf unorm tfe da
815 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
816 ; VERDE-NEXT: s_mov_b32 s10, -1
817 ; VERDE-NEXT: s_waitcnt vmcnt(0)
818 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
819 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
820 ; VERDE-NEXT: ; return to shader part epilog
822 ; FIJI-LABEL: load_1darray_tfe:
823 ; FIJI: ; %bb.0: ; %main_body
824 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
825 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
826 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
827 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
828 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
829 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
830 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
831 ; FIJI-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf unorm tfe da
832 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
833 ; FIJI-NEXT: s_mov_b32 s10, -1
834 ; FIJI-NEXT: s_waitcnt vmcnt(0)
835 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
836 ; FIJI-NEXT: s_waitcnt vmcnt(0)
837 ; FIJI-NEXT: ; return to shader part epilog
839 ; GFX6789-LABEL: load_1darray_tfe:
840 ; GFX6789: ; %bb.0: ; %main_body
841 ; GFX6789-NEXT: v_mov_b32_e32 v7, 0
842 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
843 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
844 ; GFX6789-NEXT: v_mov_b32_e32 v8, v7
845 ; GFX6789-NEXT: v_mov_b32_e32 v9, v7
846 ; GFX6789-NEXT: v_mov_b32_e32 v10, v7
847 ; GFX6789-NEXT: v_mov_b32_e32 v11, v7
848 ; GFX6789-NEXT: v_mov_b32_e32 v0, v7
849 ; GFX6789-NEXT: v_mov_b32_e32 v1, v8
850 ; GFX6789-NEXT: v_mov_b32_e32 v2, v9
851 ; GFX6789-NEXT: v_mov_b32_e32 v3, v10
852 ; GFX6789-NEXT: v_mov_b32_e32 v4, v11
853 ; GFX6789-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf unorm tfe da
854 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
855 ; GFX6789-NEXT: global_store_dword v7, v4, s[8:9]
856 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
857 ; GFX6789-NEXT: ; return to shader part epilog
859 ; NOPRT-LABEL: load_1darray_tfe:
860 ; NOPRT: ; %bb.0: ; %main_body
861 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
862 ; NOPRT-NEXT: image_load v[0:4], v[0:1], s[0:7] dmask:0xf unorm tfe da
863 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
864 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
865 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
866 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
867 ; NOPRT-NEXT: ; return to shader part epilog
869 ; GFX10-LABEL: load_1darray_tfe:
870 ; GFX10: ; %bb.0: ; %main_body
871 ; GFX10-NEXT: v_mov_b32_e32 v7, 0
872 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
873 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
874 ; GFX10-NEXT: v_mov_b32_e32 v8, v7
875 ; GFX10-NEXT: v_mov_b32_e32 v9, v7
876 ; GFX10-NEXT: v_mov_b32_e32 v10, v7
877 ; GFX10-NEXT: v_mov_b32_e32 v11, v7
878 ; GFX10-NEXT: v_mov_b32_e32 v0, v7
879 ; GFX10-NEXT: v_mov_b32_e32 v1, v8
880 ; GFX10-NEXT: v_mov_b32_e32 v2, v9
881 ; GFX10-NEXT: v_mov_b32_e32 v3, v10
882 ; GFX10-NEXT: v_mov_b32_e32 v4, v11
883 ; GFX10-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm tfe
884 ; GFX10-NEXT: s_waitcnt vmcnt(0)
885 ; GFX10-NEXT: global_store_dword v7, v4, s[8:9]
886 ; GFX10-NEXT: ; return to shader part epilog
888 ; GFX11-LABEL: load_1darray_tfe:
889 ; GFX11: ; %bb.0: ; %main_body
890 ; GFX11-NEXT: v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v6, v1
891 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v8, v7
892 ; GFX11-NEXT: v_mov_b32_e32 v9, v7
893 ; GFX11-NEXT: v_mov_b32_e32 v10, v7
894 ; GFX11-NEXT: v_mov_b32_e32 v11, v7
895 ; GFX11-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
896 ; GFX11-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
897 ; GFX11-NEXT: v_mov_b32_e32 v4, v11
898 ; GFX11-NEXT: image_load v[0:4], v[5:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm tfe
899 ; GFX11-NEXT: s_waitcnt vmcnt(0)
900 ; GFX11-NEXT: global_store_b32 v7, v4, s[8:9]
901 ; GFX11-NEXT: ; return to shader part epilog
903 ; GFX12-LABEL: load_1darray_tfe:
904 ; GFX12: ; %bb.0: ; %main_body
905 ; GFX12-NEXT: v_mov_b32_e32 v7, 0
906 ; GFX12-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v6, v0
907 ; GFX12-NEXT: v_dual_mov_b32 v8, v7 :: v_dual_mov_b32 v9, v7
908 ; GFX12-NEXT: v_dual_mov_b32 v10, v7 :: v_dual_mov_b32 v11, v7
909 ; GFX12-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
910 ; GFX12-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
911 ; GFX12-NEXT: v_mov_b32_e32 v4, v11
912 ; GFX12-NEXT: image_load v[0:4], [v6, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY tfe
913 ; GFX12-NEXT: s_wait_loadcnt 0x0
914 ; GFX12-NEXT: global_store_b32 v7, v4, s[8:9]
915 ; GFX12-NEXT: ; return to shader part epilog
917 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.1darray.v4f32i32.i32(i32 15, i32 %s, i32 %slice, <8 x i32> %rsrc, i32 1, i32 0)
918 %v.vec = extractvalue {<4 x float>, i32} %v, 0
919 %v.err = extractvalue {<4 x float>, i32} %v, 1
920 store i32 %v.err, ptr addrspace(1) %out, align 4
921 ret <4 x float> %v.vec
924 define amdgpu_ps <4 x float> @load_2darray(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %slice) {
925 ; VERDE-LABEL: load_2darray:
926 ; VERDE: ; %bb.0: ; %main_body
927 ; VERDE-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
928 ; VERDE-NEXT: s_waitcnt vmcnt(0)
929 ; VERDE-NEXT: ; return to shader part epilog
931 ; FIJI-LABEL: load_2darray:
932 ; FIJI: ; %bb.0: ; %main_body
933 ; FIJI-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
934 ; FIJI-NEXT: s_waitcnt vmcnt(0)
935 ; FIJI-NEXT: ; return to shader part epilog
937 ; GFX6789-LABEL: load_2darray:
938 ; GFX6789: ; %bb.0: ; %main_body
939 ; GFX6789-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
940 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
941 ; GFX6789-NEXT: ; return to shader part epilog
943 ; NOPRT-LABEL: load_2darray:
944 ; NOPRT: ; %bb.0: ; %main_body
945 ; NOPRT-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
946 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
947 ; NOPRT-NEXT: ; return to shader part epilog
949 ; GFX10PLUS-LABEL: load_2darray:
950 ; GFX10PLUS: ; %bb.0: ; %main_body
951 ; GFX10PLUS-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm
952 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
953 ; GFX10PLUS-NEXT: ; return to shader part epilog
955 ; GFX12-LABEL: load_2darray:
956 ; GFX12: ; %bb.0: ; %main_body
957 ; GFX12-NEXT: image_load v[0:3], [v0, v1, v2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY
958 ; GFX12-NEXT: s_wait_loadcnt 0x0
959 ; GFX12-NEXT: ; return to shader part epilog
961 %v = call <4 x float> @llvm.amdgcn.image.load.2darray.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %slice, <8 x i32> %rsrc, i32 0, i32 0)
965 define amdgpu_ps <4 x float> @load_2darray_lwe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %t, i32 %slice) {
966 ; VERDE-LABEL: load_2darray_lwe:
967 ; VERDE: ; %bb.0: ; %main_body
968 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
969 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
970 ; VERDE-NEXT: v_mov_b32_e32 v7, v2
971 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
972 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
973 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
974 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
975 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
976 ; VERDE-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm lwe da
977 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
978 ; VERDE-NEXT: s_mov_b32 s10, -1
979 ; VERDE-NEXT: s_waitcnt vmcnt(0)
980 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
981 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
982 ; VERDE-NEXT: ; return to shader part epilog
984 ; FIJI-LABEL: load_2darray_lwe:
985 ; FIJI: ; %bb.0: ; %main_body
986 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
987 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
988 ; FIJI-NEXT: v_mov_b32_e32 v7, v2
989 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
990 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
991 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
992 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
993 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
994 ; FIJI-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm lwe da
995 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
996 ; FIJI-NEXT: s_mov_b32 s10, -1
997 ; FIJI-NEXT: s_waitcnt vmcnt(0)
998 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
999 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1000 ; FIJI-NEXT: ; return to shader part epilog
1002 ; GFX6789-LABEL: load_2darray_lwe:
1003 ; GFX6789: ; %bb.0: ; %main_body
1004 ; GFX6789-NEXT: v_mov_b32_e32 v8, 0
1005 ; GFX6789-NEXT: v_mov_b32_e32 v7, v2
1006 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
1007 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
1008 ; GFX6789-NEXT: v_mov_b32_e32 v9, v8
1009 ; GFX6789-NEXT: v_mov_b32_e32 v10, v8
1010 ; GFX6789-NEXT: v_mov_b32_e32 v11, v8
1011 ; GFX6789-NEXT: v_mov_b32_e32 v12, v8
1012 ; GFX6789-NEXT: v_mov_b32_e32 v0, v8
1013 ; GFX6789-NEXT: v_mov_b32_e32 v1, v9
1014 ; GFX6789-NEXT: v_mov_b32_e32 v2, v10
1015 ; GFX6789-NEXT: v_mov_b32_e32 v3, v11
1016 ; GFX6789-NEXT: v_mov_b32_e32 v4, v12
1017 ; GFX6789-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm lwe da
1018 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1019 ; GFX6789-NEXT: global_store_dword v8, v4, s[8:9]
1020 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1021 ; GFX6789-NEXT: ; return to shader part epilog
1023 ; NOPRT-LABEL: load_2darray_lwe:
1024 ; NOPRT: ; %bb.0: ; %main_body
1025 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
1026 ; NOPRT-NEXT: image_load v[0:4], v[0:2], s[0:7] dmask:0xf unorm lwe da
1027 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
1028 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1029 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
1030 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1031 ; NOPRT-NEXT: ; return to shader part epilog
1033 ; GFX10-LABEL: load_2darray_lwe:
1034 ; GFX10: ; %bb.0: ; %main_body
1035 ; GFX10-NEXT: v_mov_b32_e32 v8, 0
1036 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
1037 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
1038 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
1039 ; GFX10-NEXT: v_mov_b32_e32 v9, v8
1040 ; GFX10-NEXT: v_mov_b32_e32 v10, v8
1041 ; GFX10-NEXT: v_mov_b32_e32 v11, v8
1042 ; GFX10-NEXT: v_mov_b32_e32 v12, v8
1043 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
1044 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
1045 ; GFX10-NEXT: v_mov_b32_e32 v2, v10
1046 ; GFX10-NEXT: v_mov_b32_e32 v3, v11
1047 ; GFX10-NEXT: v_mov_b32_e32 v4, v12
1048 ; GFX10-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm lwe
1049 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1050 ; GFX10-NEXT: global_store_dword v8, v4, s[8:9]
1051 ; GFX10-NEXT: ; return to shader part epilog
1053 ; GFX11-LABEL: load_2darray_lwe:
1054 ; GFX11: ; %bb.0: ; %main_body
1055 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v8, 0
1056 ; GFX11-NEXT: v_dual_mov_b32 v7, v2 :: v_dual_mov_b32 v6, v1
1057 ; GFX11-NEXT: v_mov_b32_e32 v9, v8
1058 ; GFX11-NEXT: v_mov_b32_e32 v10, v8
1059 ; GFX11-NEXT: v_mov_b32_e32 v11, v8
1060 ; GFX11-NEXT: v_mov_b32_e32 v12, v8
1061 ; GFX11-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_mov_b32 v1, v9
1062 ; GFX11-NEXT: v_dual_mov_b32 v2, v10 :: v_dual_mov_b32 v3, v11
1063 ; GFX11-NEXT: v_mov_b32_e32 v4, v12
1064 ; GFX11-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm lwe
1065 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1066 ; GFX11-NEXT: global_store_b32 v8, v4, s[8:9]
1067 ; GFX11-NEXT: ; return to shader part epilog
1069 ; GFX12-LABEL: load_2darray_lwe:
1070 ; GFX12: ; %bb.0: ; %main_body
1071 ; GFX12-NEXT: image_load v[0:4], [v0, v1, v2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY
1072 ; GFX12-NEXT: v_mov_b32_e32 v5, 0
1073 ; GFX12-NEXT: s_wait_loadcnt 0x0
1074 ; GFX12-NEXT: global_store_b32 v5, v4, s[8:9]
1075 ; GFX12-NEXT: ; return to shader part epilog
1077 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.2darray.v4f32i32.i32(i32 15, i32 %s, i32 %t, i32 %slice, <8 x i32> %rsrc, i32 2, i32 0)
1078 %v.vec = extractvalue {<4 x float>, i32} %v, 0
1079 %v.err = extractvalue {<4 x float>, i32} %v, 1
1080 store i32 %v.err, ptr addrspace(1) %out, align 4
1081 ret <4 x float> %v.vec
1084 define amdgpu_ps <4 x float> @load_2dmsaa(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %fragid) {
1085 ; VERDE-LABEL: load_2dmsaa:
1086 ; VERDE: ; %bb.0: ; %main_body
1087 ; VERDE-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm
1088 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1089 ; VERDE-NEXT: ; return to shader part epilog
1091 ; FIJI-LABEL: load_2dmsaa:
1092 ; FIJI: ; %bb.0: ; %main_body
1093 ; FIJI-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm
1094 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1095 ; FIJI-NEXT: ; return to shader part epilog
1097 ; GFX6789-LABEL: load_2dmsaa:
1098 ; GFX6789: ; %bb.0: ; %main_body
1099 ; GFX6789-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm
1100 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1101 ; GFX6789-NEXT: ; return to shader part epilog
1103 ; NOPRT-LABEL: load_2dmsaa:
1104 ; NOPRT: ; %bb.0: ; %main_body
1105 ; NOPRT-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf unorm
1106 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1107 ; NOPRT-NEXT: ; return to shader part epilog
1109 ; GFX10PLUS-LABEL: load_2dmsaa:
1110 ; GFX10PLUS: ; %bb.0: ; %main_body
1111 ; GFX10PLUS-NEXT: image_load v[0:3], v[0:2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm
1112 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
1113 ; GFX10PLUS-NEXT: ; return to shader part epilog
1115 ; GFX12-LABEL: load_2dmsaa:
1116 ; GFX12: ; %bb.0: ; %main_body
1117 ; GFX12-NEXT: image_load v[0:3], [v0, v1, v2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA
1118 ; GFX12-NEXT: s_wait_loadcnt 0x0
1119 ; GFX12-NEXT: ; return to shader part epilog
1121 %v = call <4 x float> @llvm.amdgcn.image.load.2dmsaa.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
1125 define amdgpu_ps <4 x float> @load_2dmsaa_both(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %t, i32 %fragid) {
1126 ; VERDE-LABEL: load_2dmsaa_both:
1127 ; VERDE: ; %bb.0: ; %main_body
1128 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
1129 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
1130 ; VERDE-NEXT: v_mov_b32_e32 v7, v2
1131 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
1132 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
1133 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
1134 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
1135 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
1136 ; VERDE-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe lwe
1137 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
1138 ; VERDE-NEXT: s_mov_b32 s10, -1
1139 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1140 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
1141 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
1142 ; VERDE-NEXT: ; return to shader part epilog
1144 ; FIJI-LABEL: load_2dmsaa_both:
1145 ; FIJI: ; %bb.0: ; %main_body
1146 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
1147 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
1148 ; FIJI-NEXT: v_mov_b32_e32 v7, v2
1149 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
1150 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
1151 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
1152 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
1153 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
1154 ; FIJI-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe lwe
1155 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
1156 ; FIJI-NEXT: s_mov_b32 s10, -1
1157 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1158 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
1159 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1160 ; FIJI-NEXT: ; return to shader part epilog
1162 ; GFX6789-LABEL: load_2dmsaa_both:
1163 ; GFX6789: ; %bb.0: ; %main_body
1164 ; GFX6789-NEXT: v_mov_b32_e32 v8, 0
1165 ; GFX6789-NEXT: v_mov_b32_e32 v7, v2
1166 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
1167 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
1168 ; GFX6789-NEXT: v_mov_b32_e32 v9, v8
1169 ; GFX6789-NEXT: v_mov_b32_e32 v10, v8
1170 ; GFX6789-NEXT: v_mov_b32_e32 v11, v8
1171 ; GFX6789-NEXT: v_mov_b32_e32 v12, v8
1172 ; GFX6789-NEXT: v_mov_b32_e32 v0, v8
1173 ; GFX6789-NEXT: v_mov_b32_e32 v1, v9
1174 ; GFX6789-NEXT: v_mov_b32_e32 v2, v10
1175 ; GFX6789-NEXT: v_mov_b32_e32 v3, v11
1176 ; GFX6789-NEXT: v_mov_b32_e32 v4, v12
1177 ; GFX6789-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe lwe
1178 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1179 ; GFX6789-NEXT: global_store_dword v8, v4, s[8:9]
1180 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1181 ; GFX6789-NEXT: ; return to shader part epilog
1183 ; NOPRT-LABEL: load_2dmsaa_both:
1184 ; NOPRT: ; %bb.0: ; %main_body
1185 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
1186 ; NOPRT-NEXT: image_load v[0:4], v[0:2], s[0:7] dmask:0xf unorm tfe lwe
1187 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
1188 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1189 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
1190 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1191 ; NOPRT-NEXT: ; return to shader part epilog
1193 ; GFX10-LABEL: load_2dmsaa_both:
1194 ; GFX10: ; %bb.0: ; %main_body
1195 ; GFX10-NEXT: v_mov_b32_e32 v8, 0
1196 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
1197 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
1198 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
1199 ; GFX10-NEXT: v_mov_b32_e32 v9, v8
1200 ; GFX10-NEXT: v_mov_b32_e32 v10, v8
1201 ; GFX10-NEXT: v_mov_b32_e32 v11, v8
1202 ; GFX10-NEXT: v_mov_b32_e32 v12, v8
1203 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
1204 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
1205 ; GFX10-NEXT: v_mov_b32_e32 v2, v10
1206 ; GFX10-NEXT: v_mov_b32_e32 v3, v11
1207 ; GFX10-NEXT: v_mov_b32_e32 v4, v12
1208 ; GFX10-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm tfe lwe
1209 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1210 ; GFX10-NEXT: global_store_dword v8, v4, s[8:9]
1211 ; GFX10-NEXT: ; return to shader part epilog
1213 ; GFX11-LABEL: load_2dmsaa_both:
1214 ; GFX11: ; %bb.0: ; %main_body
1215 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v8, 0
1216 ; GFX11-NEXT: v_dual_mov_b32 v7, v2 :: v_dual_mov_b32 v6, v1
1217 ; GFX11-NEXT: v_mov_b32_e32 v9, v8
1218 ; GFX11-NEXT: v_mov_b32_e32 v10, v8
1219 ; GFX11-NEXT: v_mov_b32_e32 v11, v8
1220 ; GFX11-NEXT: v_mov_b32_e32 v12, v8
1221 ; GFX11-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_mov_b32 v1, v9
1222 ; GFX11-NEXT: v_dual_mov_b32 v2, v10 :: v_dual_mov_b32 v3, v11
1223 ; GFX11-NEXT: v_mov_b32_e32 v4, v12
1224 ; GFX11-NEXT: image_load v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm tfe lwe
1225 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1226 ; GFX11-NEXT: global_store_b32 v8, v4, s[8:9]
1227 ; GFX11-NEXT: ; return to shader part epilog
1229 ; GFX12-LABEL: load_2dmsaa_both:
1230 ; GFX12: ; %bb.0: ; %main_body
1231 ; GFX12-NEXT: v_dual_mov_b32 v7, v0 :: v_dual_mov_b32 v8, 0
1232 ; GFX12-NEXT: v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v6, v1
1233 ; GFX12-NEXT: v_dual_mov_b32 v9, v8 :: v_dual_mov_b32 v10, v8
1234 ; GFX12-NEXT: v_dual_mov_b32 v11, v8 :: v_dual_mov_b32 v12, v8
1235 ; GFX12-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_mov_b32 v1, v9
1236 ; GFX12-NEXT: v_dual_mov_b32 v2, v10 :: v_dual_mov_b32 v3, v11
1237 ; GFX12-NEXT: v_mov_b32_e32 v4, v12
1238 ; GFX12-NEXT: image_load v[0:4], [v7, v6, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA tfe
1239 ; GFX12-NEXT: s_wait_loadcnt 0x0
1240 ; GFX12-NEXT: global_store_b32 v8, v4, s[8:9]
1241 ; GFX12-NEXT: ; return to shader part epilog
1243 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.2dmsaa.v4f32i32.i32(i32 15, i32 %s, i32 %t, i32 %fragid, <8 x i32> %rsrc, i32 3, i32 0)
1244 %v.vec = extractvalue {<4 x float>, i32} %v, 0
1245 %v.err = extractvalue {<4 x float>, i32} %v, 1
1246 store i32 %v.err, ptr addrspace(1) %out, align 4
1247 ret <4 x float> %v.vec
1250 define amdgpu_ps <4 x float> @load_2darraymsaa(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %slice, i32 %fragid) {
1251 ; VERDE-LABEL: load_2darraymsaa:
1252 ; VERDE: ; %bb.0: ; %main_body
1253 ; VERDE-NEXT: image_load v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
1254 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1255 ; VERDE-NEXT: ; return to shader part epilog
1257 ; FIJI-LABEL: load_2darraymsaa:
1258 ; FIJI: ; %bb.0: ; %main_body
1259 ; FIJI-NEXT: image_load v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
1260 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1261 ; FIJI-NEXT: ; return to shader part epilog
1263 ; GFX6789-LABEL: load_2darraymsaa:
1264 ; GFX6789: ; %bb.0: ; %main_body
1265 ; GFX6789-NEXT: image_load v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
1266 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1267 ; GFX6789-NEXT: ; return to shader part epilog
1269 ; NOPRT-LABEL: load_2darraymsaa:
1270 ; NOPRT: ; %bb.0: ; %main_body
1271 ; NOPRT-NEXT: image_load v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
1272 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1273 ; NOPRT-NEXT: ; return to shader part epilog
1275 ; GFX10PLUS-LABEL: load_2darraymsaa:
1276 ; GFX10PLUS: ; %bb.0: ; %main_body
1277 ; GFX10PLUS-NEXT: image_load v[0:3], v[0:3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm
1278 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
1279 ; GFX10PLUS-NEXT: ; return to shader part epilog
1281 ; GFX12-LABEL: load_2darraymsaa:
1282 ; GFX12: ; %bb.0: ; %main_body
1283 ; GFX12-NEXT: image_load v[0:3], [v0, v1, v2, v3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY
1284 ; GFX12-NEXT: s_wait_loadcnt 0x0
1285 ; GFX12-NEXT: ; return to shader part epilog
1287 %v = call <4 x float> @llvm.amdgcn.image.load.2darraymsaa.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %slice, i32 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
1291 define amdgpu_ps <4 x float> @load_2darraymsaa_tfe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %t, i32 %slice, i32 %fragid) {
1292 ; VERDE-LABEL: load_2darraymsaa_tfe:
1293 ; VERDE: ; %bb.0: ; %main_body
1294 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
1295 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
1296 ; VERDE-NEXT: v_mov_b32_e32 v8, v3
1297 ; VERDE-NEXT: v_mov_b32_e32 v7, v2
1298 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
1299 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
1300 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
1301 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
1302 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
1303 ; VERDE-NEXT: image_load v[0:4], v[5:8], s[0:7] dmask:0xf unorm tfe da
1304 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
1305 ; VERDE-NEXT: s_mov_b32 s10, -1
1306 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1307 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
1308 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
1309 ; VERDE-NEXT: ; return to shader part epilog
1311 ; FIJI-LABEL: load_2darraymsaa_tfe:
1312 ; FIJI: ; %bb.0: ; %main_body
1313 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
1314 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
1315 ; FIJI-NEXT: v_mov_b32_e32 v8, v3
1316 ; FIJI-NEXT: v_mov_b32_e32 v7, v2
1317 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
1318 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
1319 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
1320 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
1321 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
1322 ; FIJI-NEXT: image_load v[0:4], v[5:8], s[0:7] dmask:0xf unorm tfe da
1323 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
1324 ; FIJI-NEXT: s_mov_b32 s10, -1
1325 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1326 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
1327 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1328 ; FIJI-NEXT: ; return to shader part epilog
1330 ; GFX6789-LABEL: load_2darraymsaa_tfe:
1331 ; GFX6789: ; %bb.0: ; %main_body
1332 ; GFX6789-NEXT: v_mov_b32_e32 v9, 0
1333 ; GFX6789-NEXT: v_mov_b32_e32 v8, v3
1334 ; GFX6789-NEXT: v_mov_b32_e32 v7, v2
1335 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
1336 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
1337 ; GFX6789-NEXT: v_mov_b32_e32 v10, v9
1338 ; GFX6789-NEXT: v_mov_b32_e32 v11, v9
1339 ; GFX6789-NEXT: v_mov_b32_e32 v12, v9
1340 ; GFX6789-NEXT: v_mov_b32_e32 v13, v9
1341 ; GFX6789-NEXT: v_mov_b32_e32 v0, v9
1342 ; GFX6789-NEXT: v_mov_b32_e32 v1, v10
1343 ; GFX6789-NEXT: v_mov_b32_e32 v2, v11
1344 ; GFX6789-NEXT: v_mov_b32_e32 v3, v12
1345 ; GFX6789-NEXT: v_mov_b32_e32 v4, v13
1346 ; GFX6789-NEXT: image_load v[0:4], v[5:8], s[0:7] dmask:0xf unorm tfe da
1347 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1348 ; GFX6789-NEXT: global_store_dword v9, v4, s[8:9]
1349 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1350 ; GFX6789-NEXT: ; return to shader part epilog
1352 ; NOPRT-LABEL: load_2darraymsaa_tfe:
1353 ; NOPRT: ; %bb.0: ; %main_body
1354 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
1355 ; NOPRT-NEXT: image_load v[0:4], v[0:3], s[0:7] dmask:0xf unorm tfe da
1356 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
1357 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1358 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
1359 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1360 ; NOPRT-NEXT: ; return to shader part epilog
1362 ; GFX10-LABEL: load_2darraymsaa_tfe:
1363 ; GFX10: ; %bb.0: ; %main_body
1364 ; GFX10-NEXT: v_mov_b32_e32 v9, 0
1365 ; GFX10-NEXT: v_mov_b32_e32 v8, v3
1366 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
1367 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
1368 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
1369 ; GFX10-NEXT: v_mov_b32_e32 v10, v9
1370 ; GFX10-NEXT: v_mov_b32_e32 v11, v9
1371 ; GFX10-NEXT: v_mov_b32_e32 v12, v9
1372 ; GFX10-NEXT: v_mov_b32_e32 v13, v9
1373 ; GFX10-NEXT: v_mov_b32_e32 v0, v9
1374 ; GFX10-NEXT: v_mov_b32_e32 v1, v10
1375 ; GFX10-NEXT: v_mov_b32_e32 v2, v11
1376 ; GFX10-NEXT: v_mov_b32_e32 v3, v12
1377 ; GFX10-NEXT: v_mov_b32_e32 v4, v13
1378 ; GFX10-NEXT: image_load v[0:4], v[5:8], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm tfe
1379 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1380 ; GFX10-NEXT: global_store_dword v9, v4, s[8:9]
1381 ; GFX10-NEXT: ; return to shader part epilog
1383 ; GFX11-LABEL: load_2darraymsaa_tfe:
1384 ; GFX11: ; %bb.0: ; %main_body
1385 ; GFX11-NEXT: v_dual_mov_b32 v9, 0 :: v_dual_mov_b32 v8, v3
1386 ; GFX11-NEXT: v_dual_mov_b32 v7, v2 :: v_dual_mov_b32 v6, v1
1387 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v10, v9
1388 ; GFX11-NEXT: v_mov_b32_e32 v11, v9
1389 ; GFX11-NEXT: v_mov_b32_e32 v12, v9
1390 ; GFX11-NEXT: v_mov_b32_e32 v13, v9
1391 ; GFX11-NEXT: v_dual_mov_b32 v0, v9 :: v_dual_mov_b32 v1, v10
1392 ; GFX11-NEXT: v_dual_mov_b32 v2, v11 :: v_dual_mov_b32 v3, v12
1393 ; GFX11-NEXT: v_mov_b32_e32 v4, v13
1394 ; GFX11-NEXT: image_load v[0:4], v[5:8], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm tfe
1395 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1396 ; GFX11-NEXT: global_store_b32 v9, v4, s[8:9]
1397 ; GFX11-NEXT: ; return to shader part epilog
1399 ; GFX12-LABEL: load_2darraymsaa_tfe:
1400 ; GFX12: ; %bb.0: ; %main_body
1401 ; GFX12-NEXT: v_mov_b32_e32 v9, 0
1402 ; GFX12-NEXT: v_dual_mov_b32 v5, v3 :: v_dual_mov_b32 v6, v2
1403 ; GFX12-NEXT: v_dual_mov_b32 v7, v1 :: v_dual_mov_b32 v8, v0
1404 ; GFX12-NEXT: v_dual_mov_b32 v10, v9 :: v_dual_mov_b32 v11, v9
1405 ; GFX12-NEXT: v_dual_mov_b32 v12, v9 :: v_dual_mov_b32 v13, v9
1406 ; GFX12-NEXT: v_dual_mov_b32 v0, v9 :: v_dual_mov_b32 v1, v10
1407 ; GFX12-NEXT: v_dual_mov_b32 v2, v11 :: v_dual_mov_b32 v3, v12
1408 ; GFX12-NEXT: v_mov_b32_e32 v4, v13
1409 ; GFX12-NEXT: image_load v[0:4], [v8, v7, v6, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY tfe
1410 ; GFX12-NEXT: s_wait_loadcnt 0x0
1411 ; GFX12-NEXT: global_store_b32 v9, v4, s[8:9]
1412 ; GFX12-NEXT: ; return to shader part epilog
1414 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.2darraymsaa.v4f32i32.i32(i32 15, i32 %s, i32 %t, i32 %slice, i32 %fragid, <8 x i32> %rsrc, i32 1, i32 0)
1415 %v.vec = extractvalue {<4 x float>, i32} %v, 0
1416 %v.err = extractvalue {<4 x float>, i32} %v, 1
1417 store i32 %v.err, ptr addrspace(1) %out, align 4
1418 ret <4 x float> %v.vec
1421 define amdgpu_ps <4 x float> @load_mip_1d(<8 x i32> inreg %rsrc, i32 %s, i32 %mip) {
1422 ; VERDE-LABEL: load_mip_1d:
1423 ; VERDE: ; %bb.0: ; %main_body
1424 ; VERDE-NEXT: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm
1425 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1426 ; VERDE-NEXT: ; return to shader part epilog
1428 ; FIJI-LABEL: load_mip_1d:
1429 ; FIJI: ; %bb.0: ; %main_body
1430 ; FIJI-NEXT: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm
1431 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1432 ; FIJI-NEXT: ; return to shader part epilog
1434 ; GFX6789-LABEL: load_mip_1d:
1435 ; GFX6789: ; %bb.0: ; %main_body
1436 ; GFX6789-NEXT: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm
1437 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1438 ; GFX6789-NEXT: ; return to shader part epilog
1440 ; NOPRT-LABEL: load_mip_1d:
1441 ; NOPRT: ; %bb.0: ; %main_body
1442 ; NOPRT-NEXT: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf unorm
1443 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1444 ; NOPRT-NEXT: ; return to shader part epilog
1446 ; GFX10PLUS-LABEL: load_mip_1d:
1447 ; GFX10PLUS: ; %bb.0: ; %main_body
1448 ; GFX10PLUS-NEXT: image_load_mip v[0:3], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
1449 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
1450 ; GFX10PLUS-NEXT: ; return to shader part epilog
1452 ; GFX12-LABEL: load_mip_1d:
1453 ; GFX12: ; %bb.0: ; %main_body
1454 ; GFX12-NEXT: image_load_mip v[0:3], [v0, v1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D
1455 ; GFX12-NEXT: s_wait_loadcnt 0x0
1456 ; GFX12-NEXT: ; return to shader part epilog
1458 %v = call <4 x float> @llvm.amdgcn.image.load.mip.1d.v4f32.i32(i32 15, i32 %s, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
1462 define amdgpu_ps <4 x float> @load_mip_1d_lwe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %mip) {
1463 ; VERDE-LABEL: load_mip_1d_lwe:
1464 ; VERDE: ; %bb.0: ; %main_body
1465 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
1466 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
1467 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
1468 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
1469 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
1470 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
1471 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
1472 ; VERDE-NEXT: image_load_mip v[0:4], v[5:6], s[0:7] dmask:0xf unorm lwe
1473 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
1474 ; VERDE-NEXT: s_mov_b32 s10, -1
1475 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1476 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
1477 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
1478 ; VERDE-NEXT: ; return to shader part epilog
1480 ; FIJI-LABEL: load_mip_1d_lwe:
1481 ; FIJI: ; %bb.0: ; %main_body
1482 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
1483 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
1484 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
1485 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
1486 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
1487 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
1488 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
1489 ; FIJI-NEXT: image_load_mip v[0:4], v[5:6], s[0:7] dmask:0xf unorm lwe
1490 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
1491 ; FIJI-NEXT: s_mov_b32 s10, -1
1492 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1493 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
1494 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1495 ; FIJI-NEXT: ; return to shader part epilog
1497 ; GFX6789-LABEL: load_mip_1d_lwe:
1498 ; GFX6789: ; %bb.0: ; %main_body
1499 ; GFX6789-NEXT: v_mov_b32_e32 v7, 0
1500 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
1501 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
1502 ; GFX6789-NEXT: v_mov_b32_e32 v8, v7
1503 ; GFX6789-NEXT: v_mov_b32_e32 v9, v7
1504 ; GFX6789-NEXT: v_mov_b32_e32 v10, v7
1505 ; GFX6789-NEXT: v_mov_b32_e32 v11, v7
1506 ; GFX6789-NEXT: v_mov_b32_e32 v0, v7
1507 ; GFX6789-NEXT: v_mov_b32_e32 v1, v8
1508 ; GFX6789-NEXT: v_mov_b32_e32 v2, v9
1509 ; GFX6789-NEXT: v_mov_b32_e32 v3, v10
1510 ; GFX6789-NEXT: v_mov_b32_e32 v4, v11
1511 ; GFX6789-NEXT: image_load_mip v[0:4], v[5:6], s[0:7] dmask:0xf unorm lwe
1512 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1513 ; GFX6789-NEXT: global_store_dword v7, v4, s[8:9]
1514 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1515 ; GFX6789-NEXT: ; return to shader part epilog
1517 ; NOPRT-LABEL: load_mip_1d_lwe:
1518 ; NOPRT: ; %bb.0: ; %main_body
1519 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
1520 ; NOPRT-NEXT: image_load_mip v[0:4], v[0:1], s[0:7] dmask:0xf unorm lwe
1521 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
1522 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1523 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
1524 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1525 ; NOPRT-NEXT: ; return to shader part epilog
1527 ; GFX10-LABEL: load_mip_1d_lwe:
1528 ; GFX10: ; %bb.0: ; %main_body
1529 ; GFX10-NEXT: v_mov_b32_e32 v7, 0
1530 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
1531 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
1532 ; GFX10-NEXT: v_mov_b32_e32 v8, v7
1533 ; GFX10-NEXT: v_mov_b32_e32 v9, v7
1534 ; GFX10-NEXT: v_mov_b32_e32 v10, v7
1535 ; GFX10-NEXT: v_mov_b32_e32 v11, v7
1536 ; GFX10-NEXT: v_mov_b32_e32 v0, v7
1537 ; GFX10-NEXT: v_mov_b32_e32 v1, v8
1538 ; GFX10-NEXT: v_mov_b32_e32 v2, v9
1539 ; GFX10-NEXT: v_mov_b32_e32 v3, v10
1540 ; GFX10-NEXT: v_mov_b32_e32 v4, v11
1541 ; GFX10-NEXT: image_load_mip v[0:4], v[5:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm lwe
1542 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1543 ; GFX10-NEXT: global_store_dword v7, v4, s[8:9]
1544 ; GFX10-NEXT: ; return to shader part epilog
1546 ; GFX11-LABEL: load_mip_1d_lwe:
1547 ; GFX11: ; %bb.0: ; %main_body
1548 ; GFX11-NEXT: v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v6, v1
1549 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v8, v7
1550 ; GFX11-NEXT: v_mov_b32_e32 v9, v7
1551 ; GFX11-NEXT: v_mov_b32_e32 v10, v7
1552 ; GFX11-NEXT: v_mov_b32_e32 v11, v7
1553 ; GFX11-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
1554 ; GFX11-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
1555 ; GFX11-NEXT: v_mov_b32_e32 v4, v11
1556 ; GFX11-NEXT: image_load_mip v[0:4], v[5:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm lwe
1557 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1558 ; GFX11-NEXT: global_store_b32 v7, v4, s[8:9]
1559 ; GFX11-NEXT: ; return to shader part epilog
1561 ; GFX12-LABEL: load_mip_1d_lwe:
1562 ; GFX12: ; %bb.0: ; %main_body
1563 ; GFX12-NEXT: image_load_mip v[0:4], [v0, v1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D
1564 ; GFX12-NEXT: v_mov_b32_e32 v5, 0
1565 ; GFX12-NEXT: s_wait_loadcnt 0x0
1566 ; GFX12-NEXT: global_store_b32 v5, v4, s[8:9]
1567 ; GFX12-NEXT: ; return to shader part epilog
1569 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.mip.1d.v4f32i32.i32(i32 15, i32 %s, i32 %mip, <8 x i32> %rsrc, i32 2, i32 0)
1570 %v.vec = extractvalue {<4 x float>, i32} %v, 0
1571 %v.err = extractvalue {<4 x float>, i32} %v, 1
1572 store i32 %v.err, ptr addrspace(1) %out, align 4
1573 ret <4 x float> %v.vec
1576 define amdgpu_ps <4 x float> @load_mip_2d(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %mip) {
1577 ; VERDE-LABEL: load_mip_2d:
1578 ; VERDE: ; %bb.0: ; %main_body
1579 ; VERDE-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf unorm
1580 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1581 ; VERDE-NEXT: ; return to shader part epilog
1583 ; FIJI-LABEL: load_mip_2d:
1584 ; FIJI: ; %bb.0: ; %main_body
1585 ; FIJI-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf unorm
1586 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1587 ; FIJI-NEXT: ; return to shader part epilog
1589 ; GFX6789-LABEL: load_mip_2d:
1590 ; GFX6789: ; %bb.0: ; %main_body
1591 ; GFX6789-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf unorm
1592 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1593 ; GFX6789-NEXT: ; return to shader part epilog
1595 ; NOPRT-LABEL: load_mip_2d:
1596 ; NOPRT: ; %bb.0: ; %main_body
1597 ; NOPRT-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf unorm
1598 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1599 ; NOPRT-NEXT: ; return to shader part epilog
1601 ; GFX10PLUS-LABEL: load_mip_2d:
1602 ; GFX10PLUS: ; %bb.0: ; %main_body
1603 ; GFX10PLUS-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
1604 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
1605 ; GFX10PLUS-NEXT: ; return to shader part epilog
1607 ; GFX12-LABEL: load_mip_2d:
1608 ; GFX12: ; %bb.0: ; %main_body
1609 ; GFX12-NEXT: image_load_mip v[0:3], [v0, v1, v2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D
1610 ; GFX12-NEXT: s_wait_loadcnt 0x0
1611 ; GFX12-NEXT: ; return to shader part epilog
1613 %v = call <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
1617 define amdgpu_ps <4 x float> @load_mip_2d_tfe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %t, i32 %mip) {
1618 ; VERDE-LABEL: load_mip_2d_tfe:
1619 ; VERDE: ; %bb.0: ; %main_body
1620 ; VERDE-NEXT: v_mov_b32_e32 v5, v0
1621 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
1622 ; VERDE-NEXT: v_mov_b32_e32 v7, v2
1623 ; VERDE-NEXT: v_mov_b32_e32 v6, v1
1624 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
1625 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
1626 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
1627 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
1628 ; VERDE-NEXT: image_load_mip v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe
1629 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
1630 ; VERDE-NEXT: s_mov_b32 s10, -1
1631 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1632 ; VERDE-NEXT: buffer_store_dword v4, off, s[8:11], 0
1633 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
1634 ; VERDE-NEXT: ; return to shader part epilog
1636 ; FIJI-LABEL: load_mip_2d_tfe:
1637 ; FIJI: ; %bb.0: ; %main_body
1638 ; FIJI-NEXT: v_mov_b32_e32 v5, v0
1639 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
1640 ; FIJI-NEXT: v_mov_b32_e32 v7, v2
1641 ; FIJI-NEXT: v_mov_b32_e32 v6, v1
1642 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
1643 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
1644 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
1645 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
1646 ; FIJI-NEXT: image_load_mip v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe
1647 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
1648 ; FIJI-NEXT: s_mov_b32 s10, -1
1649 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1650 ; FIJI-NEXT: buffer_store_dword v4, off, s[8:11], 0
1651 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1652 ; FIJI-NEXT: ; return to shader part epilog
1654 ; GFX6789-LABEL: load_mip_2d_tfe:
1655 ; GFX6789: ; %bb.0: ; %main_body
1656 ; GFX6789-NEXT: v_mov_b32_e32 v8, 0
1657 ; GFX6789-NEXT: v_mov_b32_e32 v7, v2
1658 ; GFX6789-NEXT: v_mov_b32_e32 v6, v1
1659 ; GFX6789-NEXT: v_mov_b32_e32 v5, v0
1660 ; GFX6789-NEXT: v_mov_b32_e32 v9, v8
1661 ; GFX6789-NEXT: v_mov_b32_e32 v10, v8
1662 ; GFX6789-NEXT: v_mov_b32_e32 v11, v8
1663 ; GFX6789-NEXT: v_mov_b32_e32 v12, v8
1664 ; GFX6789-NEXT: v_mov_b32_e32 v0, v8
1665 ; GFX6789-NEXT: v_mov_b32_e32 v1, v9
1666 ; GFX6789-NEXT: v_mov_b32_e32 v2, v10
1667 ; GFX6789-NEXT: v_mov_b32_e32 v3, v11
1668 ; GFX6789-NEXT: v_mov_b32_e32 v4, v12
1669 ; GFX6789-NEXT: image_load_mip v[0:4], v[5:7], s[0:7] dmask:0xf unorm tfe
1670 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1671 ; GFX6789-NEXT: global_store_dword v8, v4, s[8:9]
1672 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1673 ; GFX6789-NEXT: ; return to shader part epilog
1675 ; NOPRT-LABEL: load_mip_2d_tfe:
1676 ; NOPRT: ; %bb.0: ; %main_body
1677 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
1678 ; NOPRT-NEXT: image_load_mip v[0:4], v[0:2], s[0:7] dmask:0xf unorm tfe
1679 ; NOPRT-NEXT: v_mov_b32_e32 v5, 0
1680 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1681 ; NOPRT-NEXT: global_store_dword v5, v4, s[8:9]
1682 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1683 ; NOPRT-NEXT: ; return to shader part epilog
1685 ; GFX10-LABEL: load_mip_2d_tfe:
1686 ; GFX10: ; %bb.0: ; %main_body
1687 ; GFX10-NEXT: v_mov_b32_e32 v8, 0
1688 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
1689 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
1690 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
1691 ; GFX10-NEXT: v_mov_b32_e32 v9, v8
1692 ; GFX10-NEXT: v_mov_b32_e32 v10, v8
1693 ; GFX10-NEXT: v_mov_b32_e32 v11, v8
1694 ; GFX10-NEXT: v_mov_b32_e32 v12, v8
1695 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
1696 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
1697 ; GFX10-NEXT: v_mov_b32_e32 v2, v10
1698 ; GFX10-NEXT: v_mov_b32_e32 v3, v11
1699 ; GFX10-NEXT: v_mov_b32_e32 v4, v12
1700 ; GFX10-NEXT: image_load_mip v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm tfe
1701 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1702 ; GFX10-NEXT: global_store_dword v8, v4, s[8:9]
1703 ; GFX10-NEXT: ; return to shader part epilog
1705 ; GFX11-LABEL: load_mip_2d_tfe:
1706 ; GFX11: ; %bb.0: ; %main_body
1707 ; GFX11-NEXT: v_dual_mov_b32 v5, v0 :: v_dual_mov_b32 v8, 0
1708 ; GFX11-NEXT: v_dual_mov_b32 v7, v2 :: v_dual_mov_b32 v6, v1
1709 ; GFX11-NEXT: v_mov_b32_e32 v9, v8
1710 ; GFX11-NEXT: v_mov_b32_e32 v10, v8
1711 ; GFX11-NEXT: v_mov_b32_e32 v11, v8
1712 ; GFX11-NEXT: v_mov_b32_e32 v12, v8
1713 ; GFX11-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_mov_b32 v1, v9
1714 ; GFX11-NEXT: v_dual_mov_b32 v2, v10 :: v_dual_mov_b32 v3, v11
1715 ; GFX11-NEXT: v_mov_b32_e32 v4, v12
1716 ; GFX11-NEXT: image_load_mip v[0:4], v[5:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm tfe
1717 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1718 ; GFX11-NEXT: global_store_b32 v8, v4, s[8:9]
1719 ; GFX11-NEXT: ; return to shader part epilog
1721 ; GFX12-LABEL: load_mip_2d_tfe:
1722 ; GFX12: ; %bb.0: ; %main_body
1723 ; GFX12-NEXT: v_dual_mov_b32 v7, v0 :: v_dual_mov_b32 v8, 0
1724 ; GFX12-NEXT: v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v6, v1
1725 ; GFX12-NEXT: v_dual_mov_b32 v9, v8 :: v_dual_mov_b32 v10, v8
1726 ; GFX12-NEXT: v_dual_mov_b32 v11, v8 :: v_dual_mov_b32 v12, v8
1727 ; GFX12-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_mov_b32 v1, v9
1728 ; GFX12-NEXT: v_dual_mov_b32 v2, v10 :: v_dual_mov_b32 v3, v11
1729 ; GFX12-NEXT: v_mov_b32_e32 v4, v12
1730 ; GFX12-NEXT: image_load_mip v[0:4], [v7, v6, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D tfe
1731 ; GFX12-NEXT: s_wait_loadcnt 0x0
1732 ; GFX12-NEXT: global_store_b32 v8, v4, s[8:9]
1733 ; GFX12-NEXT: ; return to shader part epilog
1735 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.mip.2d.v4f32i32.i32(i32 15, i32 %s, i32 %t, i32 %mip, <8 x i32> %rsrc, i32 1, i32 0)
1736 %v.vec = extractvalue {<4 x float>, i32} %v, 0
1737 %v.err = extractvalue {<4 x float>, i32} %v, 1
1738 store i32 %v.err, ptr addrspace(1) %out, align 4
1739 ret <4 x float> %v.vec
1742 define amdgpu_ps float @load_1d_V2_tfe_dmask0(<8 x i32> inreg %rsrc, i32 %s) {
1743 ; VERDE-LABEL: load_1d_V2_tfe_dmask0:
1744 ; VERDE: ; %bb.0: ; %main_body
1745 ; VERDE-NEXT: v_mov_b32_e32 v1, 0
1746 ; VERDE-NEXT: v_mov_b32_e32 v2, v1
1747 ; VERDE-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 unorm tfe
1748 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1749 ; VERDE-NEXT: v_mov_b32_e32 v0, v2
1750 ; VERDE-NEXT: ; return to shader part epilog
1752 ; FIJI-LABEL: load_1d_V2_tfe_dmask0:
1753 ; FIJI: ; %bb.0: ; %main_body
1754 ; FIJI-NEXT: v_mov_b32_e32 v1, 0
1755 ; FIJI-NEXT: v_mov_b32_e32 v2, v1
1756 ; FIJI-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 unorm tfe
1757 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1758 ; FIJI-NEXT: v_mov_b32_e32 v0, v2
1759 ; FIJI-NEXT: ; return to shader part epilog
1761 ; GFX6789-LABEL: load_1d_V2_tfe_dmask0:
1762 ; GFX6789: ; %bb.0: ; %main_body
1763 ; GFX6789-NEXT: v_mov_b32_e32 v1, 0
1764 ; GFX6789-NEXT: v_mov_b32_e32 v2, v1
1765 ; GFX6789-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 unorm tfe
1766 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1767 ; GFX6789-NEXT: v_mov_b32_e32 v0, v2
1768 ; GFX6789-NEXT: ; return to shader part epilog
1770 ; NOPRT-LABEL: load_1d_V2_tfe_dmask0:
1771 ; NOPRT: ; %bb.0: ; %main_body
1772 ; NOPRT-NEXT: v_mov_b32_e32 v1, 0
1773 ; NOPRT-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x1 unorm tfe
1774 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1775 ; NOPRT-NEXT: v_mov_b32_e32 v0, v1
1776 ; NOPRT-NEXT: ; return to shader part epilog
1778 ; GFX10PLUS-LABEL: load_1d_V2_tfe_dmask0:
1779 ; GFX10PLUS: ; %bb.0: ; %main_body
1780 ; GFX10PLUS-NEXT: v_mov_b32_e32 v1, 0
1781 ; GFX10PLUS-NEXT: v_mov_b32_e32 v2, v1
1782 ; GFX10PLUS-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm tfe
1783 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
1784 ; GFX10PLUS-NEXT: v_mov_b32_e32 v0, v2
1785 ; GFX10PLUS-NEXT: ; return to shader part epilog
1787 ; GFX12-LABEL: load_1d_V2_tfe_dmask0:
1788 ; GFX12: ; %bb.0: ; %main_body
1789 ; GFX12-NEXT: v_mov_b32_e32 v1, 0
1790 ; GFX12-NEXT: v_mov_b32_e32 v2, v1
1791 ; GFX12-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D tfe
1792 ; GFX12-NEXT: s_wait_loadcnt 0x0
1793 ; GFX12-NEXT: v_mov_b32_e32 v0, v2
1794 ; GFX12-NEXT: ; return to shader part epilog
1796 %v = call {<2 x float>,i32} @llvm.amdgcn.image.load.1d.v2f32i32.i32(i32 0, i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
1797 %v.err = extractvalue {<2 x float>, i32} %v, 1
1798 %vv = bitcast i32 %v.err to float
1802 define amdgpu_ps float @load_1d_V1_tfe_dmask0(<8 x i32> inreg %rsrc, i32 %s) {
1803 ; VERDE-LABEL: load_1d_V1_tfe_dmask0:
1804 ; VERDE: ; %bb.0: ; %main_body
1805 ; VERDE-NEXT: v_mov_b32_e32 v1, 0
1806 ; VERDE-NEXT: v_mov_b32_e32 v2, v1
1807 ; VERDE-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 unorm tfe
1808 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1809 ; VERDE-NEXT: v_mov_b32_e32 v0, v2
1810 ; VERDE-NEXT: ; return to shader part epilog
1812 ; FIJI-LABEL: load_1d_V1_tfe_dmask0:
1813 ; FIJI: ; %bb.0: ; %main_body
1814 ; FIJI-NEXT: v_mov_b32_e32 v1, 0
1815 ; FIJI-NEXT: v_mov_b32_e32 v2, v1
1816 ; FIJI-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 unorm tfe
1817 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1818 ; FIJI-NEXT: v_mov_b32_e32 v0, v2
1819 ; FIJI-NEXT: ; return to shader part epilog
1821 ; GFX6789-LABEL: load_1d_V1_tfe_dmask0:
1822 ; GFX6789: ; %bb.0: ; %main_body
1823 ; GFX6789-NEXT: v_mov_b32_e32 v1, 0
1824 ; GFX6789-NEXT: v_mov_b32_e32 v2, v1
1825 ; GFX6789-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 unorm tfe
1826 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1827 ; GFX6789-NEXT: v_mov_b32_e32 v0, v2
1828 ; GFX6789-NEXT: ; return to shader part epilog
1830 ; NOPRT-LABEL: load_1d_V1_tfe_dmask0:
1831 ; NOPRT: ; %bb.0: ; %main_body
1832 ; NOPRT-NEXT: v_mov_b32_e32 v1, 0
1833 ; NOPRT-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x1 unorm tfe
1834 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1835 ; NOPRT-NEXT: v_mov_b32_e32 v0, v1
1836 ; NOPRT-NEXT: ; return to shader part epilog
1838 ; GFX10PLUS-LABEL: load_1d_V1_tfe_dmask0:
1839 ; GFX10PLUS: ; %bb.0: ; %main_body
1840 ; GFX10PLUS-NEXT: v_mov_b32_e32 v1, 0
1841 ; GFX10PLUS-NEXT: v_mov_b32_e32 v2, v1
1842 ; GFX10PLUS-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm tfe
1843 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
1844 ; GFX10PLUS-NEXT: v_mov_b32_e32 v0, v2
1845 ; GFX10PLUS-NEXT: ; return to shader part epilog
1847 ; GFX12-LABEL: load_1d_V1_tfe_dmask0:
1848 ; GFX12: ; %bb.0: ; %main_body
1849 ; GFX12-NEXT: v_mov_b32_e32 v1, 0
1850 ; GFX12-NEXT: v_mov_b32_e32 v2, v1
1851 ; GFX12-NEXT: image_load v[1:2], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D tfe
1852 ; GFX12-NEXT: s_wait_loadcnt 0x0
1853 ; GFX12-NEXT: v_mov_b32_e32 v0, v2
1854 ; GFX12-NEXT: ; return to shader part epilog
1856 %v = call {float,i32} @llvm.amdgcn.image.load.1d.f32i32.i32(i32 0, i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
1857 %v.err = extractvalue {float, i32} %v, 1
1858 %vv = bitcast i32 %v.err to float
1862 define amdgpu_ps float @load_mip_2d_tfe_dmask0(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %mip) {
1863 ; VERDE-LABEL: load_mip_2d_tfe_dmask0:
1864 ; VERDE: ; %bb.0: ; %main_body
1865 ; VERDE-NEXT: v_mov_b32_e32 v3, 0
1866 ; VERDE-NEXT: v_mov_b32_e32 v4, v3
1867 ; VERDE-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
1868 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1869 ; VERDE-NEXT: v_mov_b32_e32 v0, v4
1870 ; VERDE-NEXT: ; return to shader part epilog
1872 ; FIJI-LABEL: load_mip_2d_tfe_dmask0:
1873 ; FIJI: ; %bb.0: ; %main_body
1874 ; FIJI-NEXT: v_mov_b32_e32 v3, 0
1875 ; FIJI-NEXT: v_mov_b32_e32 v4, v3
1876 ; FIJI-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
1877 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1878 ; FIJI-NEXT: v_mov_b32_e32 v0, v4
1879 ; FIJI-NEXT: ; return to shader part epilog
1881 ; GFX6789-LABEL: load_mip_2d_tfe_dmask0:
1882 ; GFX6789: ; %bb.0: ; %main_body
1883 ; GFX6789-NEXT: v_mov_b32_e32 v3, 0
1884 ; GFX6789-NEXT: v_mov_b32_e32 v4, v3
1885 ; GFX6789-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
1886 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1887 ; GFX6789-NEXT: v_mov_b32_e32 v0, v4
1888 ; GFX6789-NEXT: ; return to shader part epilog
1890 ; NOPRT-LABEL: load_mip_2d_tfe_dmask0:
1891 ; NOPRT: ; %bb.0: ; %main_body
1892 ; NOPRT-NEXT: v_mov_b32_e32 v3, 0
1893 ; NOPRT-NEXT: image_load_mip v[2:3], v[0:2], s[0:7] dmask:0x1 unorm tfe
1894 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1895 ; NOPRT-NEXT: v_mov_b32_e32 v0, v3
1896 ; NOPRT-NEXT: ; return to shader part epilog
1898 ; GFX10PLUS-LABEL: load_mip_2d_tfe_dmask0:
1899 ; GFX10PLUS: ; %bb.0: ; %main_body
1900 ; GFX10PLUS-NEXT: v_mov_b32_e32 v3, 0
1901 ; GFX10PLUS-NEXT: v_mov_b32_e32 v4, v3
1902 ; GFX10PLUS-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm tfe
1903 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
1904 ; GFX10PLUS-NEXT: v_mov_b32_e32 v0, v4
1905 ; GFX10PLUS-NEXT: ; return to shader part epilog
1907 ; GFX12-LABEL: load_mip_2d_tfe_dmask0:
1908 ; GFX12: ; %bb.0: ; %main_body
1909 ; GFX12-NEXT: v_mov_b32_e32 v3, 0
1910 ; GFX12-NEXT: v_mov_b32_e32 v4, v3
1911 ; GFX12-NEXT: image_load_mip v[3:4], [v0, v1, v2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D tfe
1912 ; GFX12-NEXT: s_wait_loadcnt 0x0
1913 ; GFX12-NEXT: v_mov_b32_e32 v0, v4
1914 ; GFX12-NEXT: ; return to shader part epilog
1916 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.mip.2d.v4f32i32.i32(i32 0, i32 %s, i32 %t, i32 %mip, <8 x i32> %rsrc, i32 1, i32 0)
1917 %v.err = extractvalue {<4 x float>, i32} %v, 1
1918 %vv = bitcast i32 %v.err to float
1922 define amdgpu_ps float @load_mip_2d_tfe_nouse(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %mip) {
1923 ; VERDE-LABEL: load_mip_2d_tfe_nouse:
1924 ; VERDE: ; %bb.0: ; %main_body
1925 ; VERDE-NEXT: v_mov_b32_e32 v3, 0
1926 ; VERDE-NEXT: v_mov_b32_e32 v4, v3
1927 ; VERDE-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
1928 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1929 ; VERDE-NEXT: v_mov_b32_e32 v0, v4
1930 ; VERDE-NEXT: ; return to shader part epilog
1932 ; FIJI-LABEL: load_mip_2d_tfe_nouse:
1933 ; FIJI: ; %bb.0: ; %main_body
1934 ; FIJI-NEXT: v_mov_b32_e32 v3, 0
1935 ; FIJI-NEXT: v_mov_b32_e32 v4, v3
1936 ; FIJI-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
1937 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1938 ; FIJI-NEXT: v_mov_b32_e32 v0, v4
1939 ; FIJI-NEXT: ; return to shader part epilog
1941 ; GFX6789-LABEL: load_mip_2d_tfe_nouse:
1942 ; GFX6789: ; %bb.0: ; %main_body
1943 ; GFX6789-NEXT: v_mov_b32_e32 v3, 0
1944 ; GFX6789-NEXT: v_mov_b32_e32 v4, v3
1945 ; GFX6789-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
1946 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
1947 ; GFX6789-NEXT: v_mov_b32_e32 v0, v4
1948 ; GFX6789-NEXT: ; return to shader part epilog
1950 ; NOPRT-LABEL: load_mip_2d_tfe_nouse:
1951 ; NOPRT: ; %bb.0: ; %main_body
1952 ; NOPRT-NEXT: v_mov_b32_e32 v3, 0
1953 ; NOPRT-NEXT: image_load_mip v[2:3], v[0:2], s[0:7] dmask:0x1 unorm tfe
1954 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
1955 ; NOPRT-NEXT: v_mov_b32_e32 v0, v3
1956 ; NOPRT-NEXT: ; return to shader part epilog
1958 ; GFX10PLUS-LABEL: load_mip_2d_tfe_nouse:
1959 ; GFX10PLUS: ; %bb.0: ; %main_body
1960 ; GFX10PLUS-NEXT: v_mov_b32_e32 v3, 0
1961 ; GFX10PLUS-NEXT: v_mov_b32_e32 v4, v3
1962 ; GFX10PLUS-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm tfe
1963 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
1964 ; GFX10PLUS-NEXT: v_mov_b32_e32 v0, v4
1965 ; GFX10PLUS-NEXT: ; return to shader part epilog
1967 ; GFX12-LABEL: load_mip_2d_tfe_nouse:
1968 ; GFX12: ; %bb.0: ; %main_body
1969 ; GFX12-NEXT: v_mov_b32_e32 v3, 0
1970 ; GFX12-NEXT: v_mov_b32_e32 v4, v3
1971 ; GFX12-NEXT: image_load_mip v[3:4], [v0, v1, v2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D tfe
1972 ; GFX12-NEXT: s_wait_loadcnt 0x0
1973 ; GFX12-NEXT: v_mov_b32_e32 v0, v4
1974 ; GFX12-NEXT: ; return to shader part epilog
1976 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.mip.2d.v4f32i32.i32(i32 15, i32 %s, i32 %t, i32 %mip, <8 x i32> %rsrc, i32 1, i32 0)
1977 %v.err = extractvalue {<4 x float>, i32} %v, 1
1978 %vv = bitcast i32 %v.err to float
1982 define amdgpu_ps float @load_mip_2d_tfe_nouse_V2(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %mip) {
1983 ; VERDE-LABEL: load_mip_2d_tfe_nouse_V2:
1984 ; VERDE: ; %bb.0: ; %main_body
1985 ; VERDE-NEXT: v_mov_b32_e32 v3, 0
1986 ; VERDE-NEXT: v_mov_b32_e32 v4, v3
1987 ; VERDE-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
1988 ; VERDE-NEXT: s_waitcnt vmcnt(0)
1989 ; VERDE-NEXT: v_mov_b32_e32 v0, v4
1990 ; VERDE-NEXT: ; return to shader part epilog
1992 ; FIJI-LABEL: load_mip_2d_tfe_nouse_V2:
1993 ; FIJI: ; %bb.0: ; %main_body
1994 ; FIJI-NEXT: v_mov_b32_e32 v3, 0
1995 ; FIJI-NEXT: v_mov_b32_e32 v4, v3
1996 ; FIJI-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
1997 ; FIJI-NEXT: s_waitcnt vmcnt(0)
1998 ; FIJI-NEXT: v_mov_b32_e32 v0, v4
1999 ; FIJI-NEXT: ; return to shader part epilog
2001 ; GFX6789-LABEL: load_mip_2d_tfe_nouse_V2:
2002 ; GFX6789: ; %bb.0: ; %main_body
2003 ; GFX6789-NEXT: v_mov_b32_e32 v3, 0
2004 ; GFX6789-NEXT: v_mov_b32_e32 v4, v3
2005 ; GFX6789-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 unorm tfe
2006 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2007 ; GFX6789-NEXT: v_mov_b32_e32 v0, v4
2008 ; GFX6789-NEXT: ; return to shader part epilog
2010 ; NOPRT-LABEL: load_mip_2d_tfe_nouse_V2:
2011 ; NOPRT: ; %bb.0: ; %main_body
2012 ; NOPRT-NEXT: v_mov_b32_e32 v3, 0
2013 ; NOPRT-NEXT: image_load_mip v[2:3], v[0:2], s[0:7] dmask:0x1 unorm tfe
2014 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2015 ; NOPRT-NEXT: v_mov_b32_e32 v0, v3
2016 ; NOPRT-NEXT: ; return to shader part epilog
2018 ; GFX10PLUS-LABEL: load_mip_2d_tfe_nouse_V2:
2019 ; GFX10PLUS: ; %bb.0: ; %main_body
2020 ; GFX10PLUS-NEXT: v_mov_b32_e32 v3, 0
2021 ; GFX10PLUS-NEXT: v_mov_b32_e32 v4, v3
2022 ; GFX10PLUS-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm tfe
2023 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
2024 ; GFX10PLUS-NEXT: v_mov_b32_e32 v0, v4
2025 ; GFX10PLUS-NEXT: ; return to shader part epilog
2027 ; GFX12-LABEL: load_mip_2d_tfe_nouse_V2:
2028 ; GFX12: ; %bb.0: ; %main_body
2029 ; GFX12-NEXT: v_mov_b32_e32 v3, 0
2030 ; GFX12-NEXT: v_mov_b32_e32 v4, v3
2031 ; GFX12-NEXT: image_load_mip v[3:4], [v0, v1, v2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D tfe
2032 ; GFX12-NEXT: s_wait_loadcnt 0x0
2033 ; GFX12-NEXT: v_mov_b32_e32 v0, v4
2034 ; GFX12-NEXT: ; return to shader part epilog
2036 %v = call {<2 x float>,i32} @llvm.amdgcn.image.load.mip.2d.v2f32i32.i32(i32 6, i32 %s, i32 %t, i32 %mip, <8 x i32> %rsrc, i32 1, i32 0)
2037 %v.err = extractvalue {<2 x float>, i32} %v, 1
2038 %vv = bitcast i32 %v.err to float
2042 define amdgpu_ps float @load_mip_2d_tfe_nouse_V1(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %mip) {
2043 ; VERDE-LABEL: load_mip_2d_tfe_nouse_V1:
2044 ; VERDE: ; %bb.0: ; %main_body
2045 ; VERDE-NEXT: v_mov_b32_e32 v3, 0
2046 ; VERDE-NEXT: v_mov_b32_e32 v4, v3
2047 ; VERDE-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x2 unorm tfe
2048 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2049 ; VERDE-NEXT: v_mov_b32_e32 v0, v4
2050 ; VERDE-NEXT: ; return to shader part epilog
2052 ; FIJI-LABEL: load_mip_2d_tfe_nouse_V1:
2053 ; FIJI: ; %bb.0: ; %main_body
2054 ; FIJI-NEXT: v_mov_b32_e32 v3, 0
2055 ; FIJI-NEXT: v_mov_b32_e32 v4, v3
2056 ; FIJI-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x2 unorm tfe
2057 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2058 ; FIJI-NEXT: v_mov_b32_e32 v0, v4
2059 ; FIJI-NEXT: ; return to shader part epilog
2061 ; GFX6789-LABEL: load_mip_2d_tfe_nouse_V1:
2062 ; GFX6789: ; %bb.0: ; %main_body
2063 ; GFX6789-NEXT: v_mov_b32_e32 v3, 0
2064 ; GFX6789-NEXT: v_mov_b32_e32 v4, v3
2065 ; GFX6789-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x2 unorm tfe
2066 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2067 ; GFX6789-NEXT: v_mov_b32_e32 v0, v4
2068 ; GFX6789-NEXT: ; return to shader part epilog
2070 ; NOPRT-LABEL: load_mip_2d_tfe_nouse_V1:
2071 ; NOPRT: ; %bb.0: ; %main_body
2072 ; NOPRT-NEXT: v_mov_b32_e32 v3, 0
2073 ; NOPRT-NEXT: image_load_mip v[2:3], v[0:2], s[0:7] dmask:0x2 unorm tfe
2074 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2075 ; NOPRT-NEXT: v_mov_b32_e32 v0, v3
2076 ; NOPRT-NEXT: ; return to shader part epilog
2078 ; GFX10PLUS-LABEL: load_mip_2d_tfe_nouse_V1:
2079 ; GFX10PLUS: ; %bb.0: ; %main_body
2080 ; GFX10PLUS-NEXT: v_mov_b32_e32 v3, 0
2081 ; GFX10PLUS-NEXT: v_mov_b32_e32 v4, v3
2082 ; GFX10PLUS-NEXT: image_load_mip v[3:4], v[0:2], s[0:7] dmask:0x2 dim:SQ_RSRC_IMG_2D unorm tfe
2083 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
2084 ; GFX10PLUS-NEXT: v_mov_b32_e32 v0, v4
2085 ; GFX10PLUS-NEXT: ; return to shader part epilog
2087 ; GFX12-LABEL: load_mip_2d_tfe_nouse_V1:
2088 ; GFX12: ; %bb.0: ; %main_body
2089 ; GFX12-NEXT: v_mov_b32_e32 v3, 0
2090 ; GFX12-NEXT: v_mov_b32_e32 v4, v3
2091 ; GFX12-NEXT: image_load_mip v[3:4], [v0, v1, v2], s[0:7] dmask:0x2 dim:SQ_RSRC_IMG_2D tfe
2092 ; GFX12-NEXT: s_wait_loadcnt 0x0
2093 ; GFX12-NEXT: v_mov_b32_e32 v0, v4
2094 ; GFX12-NEXT: ; return to shader part epilog
2096 %v = call {float, i32} @llvm.amdgcn.image.load.mip.2d.f32i32.i32(i32 2, i32 %s, i32 %t, i32 %mip, <8 x i32> %rsrc, i32 1, i32 0)
2097 %v.err = extractvalue {float, i32} %v, 1
2098 %vv = bitcast i32 %v.err to float
2102 define amdgpu_ps <4 x float> @load_1d_tfe_V4_dmask3(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s) {
2103 ; VERDE-LABEL: load_1d_tfe_V4_dmask3:
2104 ; VERDE: ; %bb.0: ; %main_body
2105 ; VERDE-NEXT: v_mov_b32_e32 v4, v0
2106 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
2107 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
2108 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
2109 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
2110 ; VERDE-NEXT: image_load v[0:3], v4, s[0:7] dmask:0x7 unorm tfe
2111 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
2112 ; VERDE-NEXT: s_mov_b32 s10, -1
2113 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2114 ; VERDE-NEXT: buffer_store_dword v3, off, s[8:11], 0
2115 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
2116 ; VERDE-NEXT: ; return to shader part epilog
2118 ; FIJI-LABEL: load_1d_tfe_V4_dmask3:
2119 ; FIJI: ; %bb.0: ; %main_body
2120 ; FIJI-NEXT: v_mov_b32_e32 v4, v0
2121 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
2122 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
2123 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
2124 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
2125 ; FIJI-NEXT: image_load v[0:3], v4, s[0:7] dmask:0x7 unorm tfe
2126 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
2127 ; FIJI-NEXT: s_mov_b32 s10, -1
2128 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2129 ; FIJI-NEXT: buffer_store_dword v3, off, s[8:11], 0
2130 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2131 ; FIJI-NEXT: ; return to shader part epilog
2133 ; GFX6789-LABEL: load_1d_tfe_V4_dmask3:
2134 ; GFX6789: ; %bb.0: ; %main_body
2135 ; GFX6789-NEXT: v_mov_b32_e32 v5, 0
2136 ; GFX6789-NEXT: v_mov_b32_e32 v4, v0
2137 ; GFX6789-NEXT: v_mov_b32_e32 v6, v5
2138 ; GFX6789-NEXT: v_mov_b32_e32 v7, v5
2139 ; GFX6789-NEXT: v_mov_b32_e32 v8, v5
2140 ; GFX6789-NEXT: v_mov_b32_e32 v0, v5
2141 ; GFX6789-NEXT: v_mov_b32_e32 v1, v6
2142 ; GFX6789-NEXT: v_mov_b32_e32 v2, v7
2143 ; GFX6789-NEXT: v_mov_b32_e32 v3, v8
2144 ; GFX6789-NEXT: image_load v[0:3], v4, s[0:7] dmask:0x7 unorm tfe
2145 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2146 ; GFX6789-NEXT: global_store_dword v5, v3, s[8:9]
2147 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2148 ; GFX6789-NEXT: ; return to shader part epilog
2150 ; NOPRT-LABEL: load_1d_tfe_V4_dmask3:
2151 ; NOPRT: ; %bb.0: ; %main_body
2152 ; NOPRT-NEXT: v_mov_b32_e32 v3, 0
2153 ; NOPRT-NEXT: image_load v[0:3], v0, s[0:7] dmask:0x7 unorm tfe
2154 ; NOPRT-NEXT: v_mov_b32_e32 v4, 0
2155 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2156 ; NOPRT-NEXT: global_store_dword v4, v3, s[8:9]
2157 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2158 ; NOPRT-NEXT: ; return to shader part epilog
2160 ; GFX10-LABEL: load_1d_tfe_V4_dmask3:
2161 ; GFX10: ; %bb.0: ; %main_body
2162 ; GFX10-NEXT: v_mov_b32_e32 v5, 0
2163 ; GFX10-NEXT: v_mov_b32_e32 v4, v0
2164 ; GFX10-NEXT: v_mov_b32_e32 v6, v5
2165 ; GFX10-NEXT: v_mov_b32_e32 v7, v5
2166 ; GFX10-NEXT: v_mov_b32_e32 v8, v5
2167 ; GFX10-NEXT: v_mov_b32_e32 v0, v5
2168 ; GFX10-NEXT: v_mov_b32_e32 v1, v6
2169 ; GFX10-NEXT: v_mov_b32_e32 v2, v7
2170 ; GFX10-NEXT: v_mov_b32_e32 v3, v8
2171 ; GFX10-NEXT: image_load v[0:3], v4, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D unorm tfe
2172 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2173 ; GFX10-NEXT: global_store_dword v5, v3, s[8:9]
2174 ; GFX10-NEXT: ; return to shader part epilog
2176 ; GFX11-LABEL: load_1d_tfe_V4_dmask3:
2177 ; GFX11: ; %bb.0: ; %main_body
2178 ; GFX11-NEXT: v_dual_mov_b32 v4, v0 :: v_dual_mov_b32 v5, 0
2179 ; GFX11-NEXT: v_mov_b32_e32 v6, v5
2180 ; GFX11-NEXT: v_mov_b32_e32 v7, v5
2181 ; GFX11-NEXT: v_mov_b32_e32 v8, v5
2182 ; GFX11-NEXT: v_dual_mov_b32 v0, v5 :: v_dual_mov_b32 v1, v6
2183 ; GFX11-NEXT: v_dual_mov_b32 v2, v7 :: v_dual_mov_b32 v3, v8
2184 ; GFX11-NEXT: image_load v[0:3], v4, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D unorm tfe
2185 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2186 ; GFX11-NEXT: global_store_b32 v5, v3, s[8:9]
2187 ; GFX11-NEXT: ; return to shader part epilog
2189 ; GFX12-LABEL: load_1d_tfe_V4_dmask3:
2190 ; GFX12: ; %bb.0: ; %main_body
2191 ; GFX12-NEXT: v_dual_mov_b32 v4, v0 :: v_dual_mov_b32 v5, 0
2192 ; GFX12-NEXT: v_dual_mov_b32 v6, v5 :: v_dual_mov_b32 v7, v5
2193 ; GFX12-NEXT: v_mov_b32_e32 v8, v5
2194 ; GFX12-NEXT: v_dual_mov_b32 v0, v5 :: v_dual_mov_b32 v1, v6
2195 ; GFX12-NEXT: v_dual_mov_b32 v2, v7 :: v_dual_mov_b32 v3, v8
2196 ; GFX12-NEXT: image_load v[0:3], v4, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D tfe
2197 ; GFX12-NEXT: s_wait_loadcnt 0x0
2198 ; GFX12-NEXT: global_store_b32 v5, v3, s[8:9]
2199 ; GFX12-NEXT: ; return to shader part epilog
2201 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32 7, i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
2202 %v.vec = extractvalue {<4 x float>, i32} %v, 0
2203 %v.err = extractvalue {<4 x float>, i32} %v, 1
2204 store i32 %v.err, ptr addrspace(1) %out, align 4
2205 ret <4 x float> %v.vec
2208 define amdgpu_ps <4 x float> @load_1d_tfe_V4_dmask2(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s) {
2209 ; VERDE-LABEL: load_1d_tfe_V4_dmask2:
2210 ; VERDE: ; %bb.0: ; %main_body
2211 ; VERDE-NEXT: v_mov_b32_e32 v3, v0
2212 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
2213 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
2214 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
2215 ; VERDE-NEXT: image_load v[0:2], v3, s[0:7] dmask:0x6 unorm tfe
2216 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
2217 ; VERDE-NEXT: s_mov_b32 s10, -1
2218 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2219 ; VERDE-NEXT: buffer_store_dword v2, off, s[8:11], 0
2220 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
2221 ; VERDE-NEXT: ; return to shader part epilog
2223 ; FIJI-LABEL: load_1d_tfe_V4_dmask2:
2224 ; FIJI: ; %bb.0: ; %main_body
2225 ; FIJI-NEXT: v_mov_b32_e32 v3, v0
2226 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
2227 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
2228 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
2229 ; FIJI-NEXT: image_load v[0:2], v3, s[0:7] dmask:0x6 unorm tfe
2230 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
2231 ; FIJI-NEXT: s_mov_b32 s10, -1
2232 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2233 ; FIJI-NEXT: buffer_store_dword v2, off, s[8:11], 0
2234 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2235 ; FIJI-NEXT: ; return to shader part epilog
2237 ; GFX6789-LABEL: load_1d_tfe_V4_dmask2:
2238 ; GFX6789: ; %bb.0: ; %main_body
2239 ; GFX6789-NEXT: v_mov_b32_e32 v4, 0
2240 ; GFX6789-NEXT: v_mov_b32_e32 v3, v0
2241 ; GFX6789-NEXT: v_mov_b32_e32 v5, v4
2242 ; GFX6789-NEXT: v_mov_b32_e32 v6, v4
2243 ; GFX6789-NEXT: v_mov_b32_e32 v0, v4
2244 ; GFX6789-NEXT: v_mov_b32_e32 v1, v5
2245 ; GFX6789-NEXT: v_mov_b32_e32 v2, v6
2246 ; GFX6789-NEXT: image_load v[0:2], v3, s[0:7] dmask:0x6 unorm tfe
2247 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2248 ; GFX6789-NEXT: global_store_dword v4, v2, s[8:9]
2249 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2250 ; GFX6789-NEXT: ; return to shader part epilog
2252 ; NOPRT-LABEL: load_1d_tfe_V4_dmask2:
2253 ; NOPRT: ; %bb.0: ; %main_body
2254 ; NOPRT-NEXT: v_mov_b32_e32 v2, 0
2255 ; NOPRT-NEXT: image_load v[0:2], v0, s[0:7] dmask:0x6 unorm tfe
2256 ; NOPRT-NEXT: v_mov_b32_e32 v3, 0
2257 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2258 ; NOPRT-NEXT: global_store_dword v3, v2, s[8:9]
2259 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2260 ; NOPRT-NEXT: ; return to shader part epilog
2262 ; GFX10-LABEL: load_1d_tfe_V4_dmask2:
2263 ; GFX10: ; %bb.0: ; %main_body
2264 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
2265 ; GFX10-NEXT: v_mov_b32_e32 v3, v0
2266 ; GFX10-NEXT: v_mov_b32_e32 v5, v4
2267 ; GFX10-NEXT: v_mov_b32_e32 v6, v4
2268 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
2269 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
2270 ; GFX10-NEXT: v_mov_b32_e32 v2, v6
2271 ; GFX10-NEXT: image_load v[0:2], v3, s[0:7] dmask:0x6 dim:SQ_RSRC_IMG_1D unorm tfe
2272 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2273 ; GFX10-NEXT: global_store_dword v4, v2, s[8:9]
2274 ; GFX10-NEXT: ; return to shader part epilog
2276 ; GFX11-LABEL: load_1d_tfe_V4_dmask2:
2277 ; GFX11: ; %bb.0: ; %main_body
2278 ; GFX11-NEXT: v_dual_mov_b32 v3, v0 :: v_dual_mov_b32 v4, 0
2279 ; GFX11-NEXT: v_mov_b32_e32 v5, v4
2280 ; GFX11-NEXT: v_mov_b32_e32 v6, v4
2281 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
2282 ; GFX11-NEXT: v_mov_b32_e32 v2, v6
2283 ; GFX11-NEXT: image_load v[0:2], v3, s[0:7] dmask:0x6 dim:SQ_RSRC_IMG_1D unorm tfe
2284 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2285 ; GFX11-NEXT: global_store_b32 v4, v2, s[8:9]
2286 ; GFX11-NEXT: ; return to shader part epilog
2288 ; GFX12-LABEL: load_1d_tfe_V4_dmask2:
2289 ; GFX12: ; %bb.0: ; %main_body
2290 ; GFX12-NEXT: v_dual_mov_b32 v3, v0 :: v_dual_mov_b32 v4, 0
2291 ; GFX12-NEXT: v_dual_mov_b32 v5, v4 :: v_dual_mov_b32 v6, v4
2292 ; GFX12-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
2293 ; GFX12-NEXT: v_mov_b32_e32 v2, v6
2294 ; GFX12-NEXT: image_load v[0:2], v3, s[0:7] dmask:0x6 dim:SQ_RSRC_IMG_1D tfe
2295 ; GFX12-NEXT: s_wait_loadcnt 0x0
2296 ; GFX12-NEXT: global_store_b32 v4, v2, s[8:9]
2297 ; GFX12-NEXT: ; return to shader part epilog
2299 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32 6, i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
2300 %v.vec = extractvalue {<4 x float>, i32} %v, 0
2301 %v.err = extractvalue {<4 x float>, i32} %v, 1
2302 store i32 %v.err, ptr addrspace(1) %out, align 4
2303 ret <4 x float> %v.vec
2306 define amdgpu_ps <4 x float> @load_1d_tfe_V4_dmask1(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s) {
2307 ; VERDE-LABEL: load_1d_tfe_V4_dmask1:
2308 ; VERDE: ; %bb.0: ; %main_body
2309 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
2310 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
2311 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
2312 ; VERDE-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 unorm tfe
2313 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
2314 ; VERDE-NEXT: s_mov_b32 s10, -1
2315 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2316 ; VERDE-NEXT: buffer_store_dword v1, off, s[8:11], 0
2317 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
2318 ; VERDE-NEXT: ; return to shader part epilog
2320 ; FIJI-LABEL: load_1d_tfe_V4_dmask1:
2321 ; FIJI: ; %bb.0: ; %main_body
2322 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
2323 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
2324 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
2325 ; FIJI-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 unorm tfe
2326 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
2327 ; FIJI-NEXT: s_mov_b32 s10, -1
2328 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2329 ; FIJI-NEXT: buffer_store_dword v1, off, s[8:11], 0
2330 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2331 ; FIJI-NEXT: ; return to shader part epilog
2333 ; GFX6789-LABEL: load_1d_tfe_V4_dmask1:
2334 ; GFX6789: ; %bb.0: ; %main_body
2335 ; GFX6789-NEXT: v_mov_b32_e32 v3, 0
2336 ; GFX6789-NEXT: v_mov_b32_e32 v2, v0
2337 ; GFX6789-NEXT: v_mov_b32_e32 v4, v3
2338 ; GFX6789-NEXT: v_mov_b32_e32 v0, v3
2339 ; GFX6789-NEXT: v_mov_b32_e32 v1, v4
2340 ; GFX6789-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 unorm tfe
2341 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2342 ; GFX6789-NEXT: global_store_dword v3, v1, s[8:9]
2343 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2344 ; GFX6789-NEXT: ; return to shader part epilog
2346 ; NOPRT-LABEL: load_1d_tfe_V4_dmask1:
2347 ; NOPRT: ; %bb.0: ; %main_body
2348 ; NOPRT-NEXT: v_mov_b32_e32 v1, 0
2349 ; NOPRT-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x8 unorm tfe
2350 ; NOPRT-NEXT: v_mov_b32_e32 v2, 0
2351 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2352 ; NOPRT-NEXT: global_store_dword v2, v1, s[8:9]
2353 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2354 ; NOPRT-NEXT: ; return to shader part epilog
2356 ; GFX10-LABEL: load_1d_tfe_V4_dmask1:
2357 ; GFX10: ; %bb.0: ; %main_body
2358 ; GFX10-NEXT: v_mov_b32_e32 v3, 0
2359 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
2360 ; GFX10-NEXT: v_mov_b32_e32 v4, v3
2361 ; GFX10-NEXT: v_mov_b32_e32 v0, v3
2362 ; GFX10-NEXT: v_mov_b32_e32 v1, v4
2363 ; GFX10-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D unorm tfe
2364 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2365 ; GFX10-NEXT: global_store_dword v3, v1, s[8:9]
2366 ; GFX10-NEXT: ; return to shader part epilog
2368 ; GFX11-LABEL: load_1d_tfe_V4_dmask1:
2369 ; GFX11: ; %bb.0: ; %main_body
2370 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, 0
2371 ; GFX11-NEXT: v_mov_b32_e32 v4, v3
2372 ; GFX11-NEXT: v_dual_mov_b32 v0, v3 :: v_dual_mov_b32 v1, v4
2373 ; GFX11-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D unorm tfe
2374 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2375 ; GFX11-NEXT: global_store_b32 v3, v1, s[8:9]
2376 ; GFX11-NEXT: ; return to shader part epilog
2378 ; GFX12-LABEL: load_1d_tfe_V4_dmask1:
2379 ; GFX12: ; %bb.0: ; %main_body
2380 ; GFX12-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, 0
2381 ; GFX12-NEXT: v_mov_b32_e32 v4, v3
2382 ; GFX12-NEXT: v_dual_mov_b32 v0, v3 :: v_dual_mov_b32 v1, v4
2383 ; GFX12-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D tfe
2384 ; GFX12-NEXT: s_wait_loadcnt 0x0
2385 ; GFX12-NEXT: global_store_b32 v3, v1, s[8:9]
2386 ; GFX12-NEXT: ; return to shader part epilog
2388 %v = call {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32 8, i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
2389 %v.vec = extractvalue {<4 x float>, i32} %v, 0
2390 %v.err = extractvalue {<4 x float>, i32} %v, 1
2391 store i32 %v.err, ptr addrspace(1) %out, align 4
2392 ret <4 x float> %v.vec
2395 define amdgpu_ps <2 x float> @load_1d_tfe_V2_dmask1(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s) {
2396 ; VERDE-LABEL: load_1d_tfe_V2_dmask1:
2397 ; VERDE: ; %bb.0: ; %main_body
2398 ; VERDE-NEXT: v_mov_b32_e32 v2, v0
2399 ; VERDE-NEXT: v_mov_b32_e32 v0, 0
2400 ; VERDE-NEXT: v_mov_b32_e32 v1, v0
2401 ; VERDE-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 unorm tfe
2402 ; VERDE-NEXT: s_mov_b32 s11, 0xf000
2403 ; VERDE-NEXT: s_mov_b32 s10, -1
2404 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2405 ; VERDE-NEXT: buffer_store_dword v1, off, s[8:11], 0
2406 ; VERDE-NEXT: s_waitcnt vmcnt(0) expcnt(0)
2407 ; VERDE-NEXT: ; return to shader part epilog
2409 ; FIJI-LABEL: load_1d_tfe_V2_dmask1:
2410 ; FIJI: ; %bb.0: ; %main_body
2411 ; FIJI-NEXT: v_mov_b32_e32 v2, v0
2412 ; FIJI-NEXT: v_mov_b32_e32 v0, 0
2413 ; FIJI-NEXT: v_mov_b32_e32 v1, v0
2414 ; FIJI-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 unorm tfe
2415 ; FIJI-NEXT: s_mov_b32 s11, 0xf000
2416 ; FIJI-NEXT: s_mov_b32 s10, -1
2417 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2418 ; FIJI-NEXT: buffer_store_dword v1, off, s[8:11], 0
2419 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2420 ; FIJI-NEXT: ; return to shader part epilog
2422 ; GFX6789-LABEL: load_1d_tfe_V2_dmask1:
2423 ; GFX6789: ; %bb.0: ; %main_body
2424 ; GFX6789-NEXT: v_mov_b32_e32 v3, 0
2425 ; GFX6789-NEXT: v_mov_b32_e32 v2, v0
2426 ; GFX6789-NEXT: v_mov_b32_e32 v4, v3
2427 ; GFX6789-NEXT: v_mov_b32_e32 v0, v3
2428 ; GFX6789-NEXT: v_mov_b32_e32 v1, v4
2429 ; GFX6789-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 unorm tfe
2430 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2431 ; GFX6789-NEXT: global_store_dword v3, v1, s[8:9]
2432 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2433 ; GFX6789-NEXT: ; return to shader part epilog
2435 ; NOPRT-LABEL: load_1d_tfe_V2_dmask1:
2436 ; NOPRT: ; %bb.0: ; %main_body
2437 ; NOPRT-NEXT: v_mov_b32_e32 v1, 0
2438 ; NOPRT-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x8 unorm tfe
2439 ; NOPRT-NEXT: v_mov_b32_e32 v2, 0
2440 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2441 ; NOPRT-NEXT: global_store_dword v2, v1, s[8:9]
2442 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2443 ; NOPRT-NEXT: ; return to shader part epilog
2445 ; GFX10-LABEL: load_1d_tfe_V2_dmask1:
2446 ; GFX10: ; %bb.0: ; %main_body
2447 ; GFX10-NEXT: v_mov_b32_e32 v3, 0
2448 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
2449 ; GFX10-NEXT: v_mov_b32_e32 v4, v3
2450 ; GFX10-NEXT: v_mov_b32_e32 v0, v3
2451 ; GFX10-NEXT: v_mov_b32_e32 v1, v4
2452 ; GFX10-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D unorm tfe
2453 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2454 ; GFX10-NEXT: global_store_dword v3, v1, s[8:9]
2455 ; GFX10-NEXT: ; return to shader part epilog
2457 ; GFX11-LABEL: load_1d_tfe_V2_dmask1:
2458 ; GFX11: ; %bb.0: ; %main_body
2459 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, 0
2460 ; GFX11-NEXT: v_mov_b32_e32 v4, v3
2461 ; GFX11-NEXT: v_dual_mov_b32 v0, v3 :: v_dual_mov_b32 v1, v4
2462 ; GFX11-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D unorm tfe
2463 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2464 ; GFX11-NEXT: global_store_b32 v3, v1, s[8:9]
2465 ; GFX11-NEXT: ; return to shader part epilog
2467 ; GFX12-LABEL: load_1d_tfe_V2_dmask1:
2468 ; GFX12: ; %bb.0: ; %main_body
2469 ; GFX12-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, 0
2470 ; GFX12-NEXT: v_mov_b32_e32 v4, v3
2471 ; GFX12-NEXT: v_dual_mov_b32 v0, v3 :: v_dual_mov_b32 v1, v4
2472 ; GFX12-NEXT: image_load v[0:1], v2, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D tfe
2473 ; GFX12-NEXT: s_wait_loadcnt 0x0
2474 ; GFX12-NEXT: global_store_b32 v3, v1, s[8:9]
2475 ; GFX12-NEXT: ; return to shader part epilog
2477 %v = call {<2 x float>,i32} @llvm.amdgcn.image.load.1d.v2f32i32.i32(i32 8, i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
2478 %v.vec = extractvalue {<2 x float>, i32} %v, 0
2479 %v.err = extractvalue {<2 x float>, i32} %v, 1
2480 store i32 %v.err, ptr addrspace(1) %out, align 4
2481 ret <2 x float> %v.vec
2485 define amdgpu_ps <4 x float> @load_mip_3d(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %r, i32 %mip) {
2486 ; VERDE-LABEL: load_mip_3d:
2487 ; VERDE: ; %bb.0: ; %main_body
2488 ; VERDE-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm
2489 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2490 ; VERDE-NEXT: ; return to shader part epilog
2492 ; FIJI-LABEL: load_mip_3d:
2493 ; FIJI: ; %bb.0: ; %main_body
2494 ; FIJI-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm
2495 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2496 ; FIJI-NEXT: ; return to shader part epilog
2498 ; GFX6789-LABEL: load_mip_3d:
2499 ; GFX6789: ; %bb.0: ; %main_body
2500 ; GFX6789-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm
2501 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2502 ; GFX6789-NEXT: ; return to shader part epilog
2504 ; NOPRT-LABEL: load_mip_3d:
2505 ; NOPRT: ; %bb.0: ; %main_body
2506 ; NOPRT-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm
2507 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2508 ; NOPRT-NEXT: ; return to shader part epilog
2510 ; GFX10PLUS-LABEL: load_mip_3d:
2511 ; GFX10PLUS: ; %bb.0: ; %main_body
2512 ; GFX10PLUS-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm
2513 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
2514 ; GFX10PLUS-NEXT: ; return to shader part epilog
2516 ; GFX12-LABEL: load_mip_3d:
2517 ; GFX12: ; %bb.0: ; %main_body
2518 ; GFX12-NEXT: image_load_mip v[0:3], [v0, v1, v2, v3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D
2519 ; GFX12-NEXT: s_wait_loadcnt 0x0
2520 ; GFX12-NEXT: ; return to shader part epilog
2522 %v = call <4 x float> @llvm.amdgcn.image.load.mip.3d.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %r, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
2526 define amdgpu_ps <4 x float> @load_mip_cube(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %slice, i32 %mip) {
2527 ; VERDE-LABEL: load_mip_cube:
2528 ; VERDE: ; %bb.0: ; %main_body
2529 ; VERDE-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
2530 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2531 ; VERDE-NEXT: ; return to shader part epilog
2533 ; FIJI-LABEL: load_mip_cube:
2534 ; FIJI: ; %bb.0: ; %main_body
2535 ; FIJI-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
2536 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2537 ; FIJI-NEXT: ; return to shader part epilog
2539 ; GFX6789-LABEL: load_mip_cube:
2540 ; GFX6789: ; %bb.0: ; %main_body
2541 ; GFX6789-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
2542 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2543 ; GFX6789-NEXT: ; return to shader part epilog
2545 ; NOPRT-LABEL: load_mip_cube:
2546 ; NOPRT: ; %bb.0: ; %main_body
2547 ; NOPRT-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
2548 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2549 ; NOPRT-NEXT: ; return to shader part epilog
2551 ; GFX10PLUS-LABEL: load_mip_cube:
2552 ; GFX10PLUS: ; %bb.0: ; %main_body
2553 ; GFX10PLUS-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm
2554 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
2555 ; GFX10PLUS-NEXT: ; return to shader part epilog
2557 ; GFX12-LABEL: load_mip_cube:
2558 ; GFX12: ; %bb.0: ; %main_body
2559 ; GFX12-NEXT: image_load_mip v[0:3], [v0, v1, v2, v3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE
2560 ; GFX12-NEXT: s_wait_loadcnt 0x0
2561 ; GFX12-NEXT: ; return to shader part epilog
2563 %v = call <4 x float> @llvm.amdgcn.image.load.mip.cube.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %slice, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
2567 define amdgpu_ps <4 x float> @load_mip_1darray(<8 x i32> inreg %rsrc, i32 %s, i32 %slice, i32 %mip) {
2568 ; VERDE-LABEL: load_mip_1darray:
2569 ; VERDE: ; %bb.0: ; %main_body
2570 ; VERDE-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
2571 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2572 ; VERDE-NEXT: ; return to shader part epilog
2574 ; FIJI-LABEL: load_mip_1darray:
2575 ; FIJI: ; %bb.0: ; %main_body
2576 ; FIJI-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
2577 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2578 ; FIJI-NEXT: ; return to shader part epilog
2580 ; GFX6789-LABEL: load_mip_1darray:
2581 ; GFX6789: ; %bb.0: ; %main_body
2582 ; GFX6789-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
2583 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2584 ; GFX6789-NEXT: ; return to shader part epilog
2586 ; NOPRT-LABEL: load_mip_1darray:
2587 ; NOPRT: ; %bb.0: ; %main_body
2588 ; NOPRT-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf unorm da
2589 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2590 ; NOPRT-NEXT: ; return to shader part epilog
2592 ; GFX10PLUS-LABEL: load_mip_1darray:
2593 ; GFX10PLUS: ; %bb.0: ; %main_body
2594 ; GFX10PLUS-NEXT: image_load_mip v[0:3], v[0:2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm
2595 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
2596 ; GFX10PLUS-NEXT: ; return to shader part epilog
2598 ; GFX12-LABEL: load_mip_1darray:
2599 ; GFX12: ; %bb.0: ; %main_body
2600 ; GFX12-NEXT: image_load_mip v[0:3], [v0, v1, v2], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY
2601 ; GFX12-NEXT: s_wait_loadcnt 0x0
2602 ; GFX12-NEXT: ; return to shader part epilog
2604 %v = call <4 x float> @llvm.amdgcn.image.load.mip.1darray.v4f32.i32(i32 15, i32 %s, i32 %slice, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
2608 define amdgpu_ps <4 x float> @load_mip_2darray(<8 x i32> inreg %rsrc, i32 %s, i32 %t, i32 %slice, i32 %mip) {
2609 ; VERDE-LABEL: load_mip_2darray:
2610 ; VERDE: ; %bb.0: ; %main_body
2611 ; VERDE-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
2612 ; VERDE-NEXT: s_waitcnt vmcnt(0)
2613 ; VERDE-NEXT: ; return to shader part epilog
2615 ; FIJI-LABEL: load_mip_2darray:
2616 ; FIJI: ; %bb.0: ; %main_body
2617 ; FIJI-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
2618 ; FIJI-NEXT: s_waitcnt vmcnt(0)
2619 ; FIJI-NEXT: ; return to shader part epilog
2621 ; GFX6789-LABEL: load_mip_2darray:
2622 ; GFX6789: ; %bb.0: ; %main_body
2623 ; GFX6789-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
2624 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
2625 ; GFX6789-NEXT: ; return to shader part epilog
2627 ; NOPRT-LABEL: load_mip_2darray:
2628 ; NOPRT: ; %bb.0: ; %main_body
2629 ; NOPRT-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf unorm da
2630 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
2631 ; NOPRT-NEXT: ; return to shader part epilog
2633 ; GFX10PLUS-LABEL: load_mip_2darray:
2634 ; GFX10PLUS: ; %bb.0: ; %main_body
2635 ; GFX10PLUS-NEXT: image_load_mip v[0:3], v[0:3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm
2636 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
2637 ; GFX10PLUS-NEXT: ; return to shader part epilog
2639 ; GFX12-LABEL: load_mip_2darray:
2640 ; GFX12: ; %bb.0: ; %main_body
2641 ; GFX12-NEXT: image_load_mip v[0:3], [v0, v1, v2, v3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY
2642 ; GFX12-NEXT: s_wait_loadcnt 0x0
2643 ; GFX12-NEXT: ; return to shader part epilog
2645 %v = call <4 x float> @llvm.amdgcn.image.load.mip.2darray.v4f32.i32(i32 15, i32 %s, i32 %t, i32 %slice, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
2649 define amdgpu_ps void @store_1d(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s) {
2650 ; VERDE-LABEL: store_1d:
2651 ; VERDE: ; %bb.0: ; %main_body
2652 ; VERDE-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm
2653 ; VERDE-NEXT: s_endpgm
2655 ; FIJI-LABEL: store_1d:
2656 ; FIJI: ; %bb.0: ; %main_body
2657 ; FIJI-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm
2658 ; FIJI-NEXT: s_endpgm
2660 ; GFX6789-LABEL: store_1d:
2661 ; GFX6789: ; %bb.0: ; %main_body
2662 ; GFX6789-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm
2663 ; GFX6789-NEXT: s_endpgm
2665 ; NOPRT-LABEL: store_1d:
2666 ; NOPRT: ; %bb.0: ; %main_body
2667 ; NOPRT-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm
2668 ; NOPRT-NEXT: s_endpgm
2670 ; GFX10-LABEL: store_1d:
2671 ; GFX10: ; %bb.0: ; %main_body
2672 ; GFX10-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
2673 ; GFX10-NEXT: s_endpgm
2675 ; GFX11-LABEL: store_1d:
2676 ; GFX11: ; %bb.0: ; %main_body
2677 ; GFX11-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
2678 ; GFX11-NEXT: s_nop 0
2679 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2680 ; GFX11-NEXT: s_endpgm
2682 ; GFX12-LABEL: store_1d:
2683 ; GFX12: ; %bb.0: ; %main_body
2684 ; GFX12-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D
2685 ; GFX12-NEXT: s_nop 0
2686 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2687 ; GFX12-NEXT: s_endpgm
2689 call void @llvm.amdgcn.image.store.1d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, <8 x i32> %rsrc, i32 0, i32 0)
2693 define amdgpu_ps void @store_2d(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t) {
2694 ; VERDE-LABEL: store_2d:
2695 ; VERDE: ; %bb.0: ; %main_body
2696 ; VERDE-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm
2697 ; VERDE-NEXT: s_endpgm
2699 ; FIJI-LABEL: store_2d:
2700 ; FIJI: ; %bb.0: ; %main_body
2701 ; FIJI-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm
2702 ; FIJI-NEXT: s_endpgm
2704 ; GFX6789-LABEL: store_2d:
2705 ; GFX6789: ; %bb.0: ; %main_body
2706 ; GFX6789-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm
2707 ; GFX6789-NEXT: s_endpgm
2709 ; NOPRT-LABEL: store_2d:
2710 ; NOPRT: ; %bb.0: ; %main_body
2711 ; NOPRT-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm
2712 ; NOPRT-NEXT: s_endpgm
2714 ; GFX10-LABEL: store_2d:
2715 ; GFX10: ; %bb.0: ; %main_body
2716 ; GFX10-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
2717 ; GFX10-NEXT: s_endpgm
2719 ; GFX11-LABEL: store_2d:
2720 ; GFX11: ; %bb.0: ; %main_body
2721 ; GFX11-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
2722 ; GFX11-NEXT: s_nop 0
2723 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2724 ; GFX11-NEXT: s_endpgm
2726 ; GFX12-LABEL: store_2d:
2727 ; GFX12: ; %bb.0: ; %main_body
2728 ; GFX12-NEXT: image_store v[0:3], [v4, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D
2729 ; GFX12-NEXT: s_nop 0
2730 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2731 ; GFX12-NEXT: s_endpgm
2733 call void @llvm.amdgcn.image.store.2d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, <8 x i32> %rsrc, i32 0, i32 0)
2737 define amdgpu_ps void @store_3d(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %r) {
2738 ; VERDE-LABEL: store_3d:
2739 ; VERDE: ; %bb.0: ; %main_body
2740 ; VERDE-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm
2741 ; VERDE-NEXT: s_endpgm
2743 ; FIJI-LABEL: store_3d:
2744 ; FIJI: ; %bb.0: ; %main_body
2745 ; FIJI-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm
2746 ; FIJI-NEXT: s_endpgm
2748 ; GFX6789-LABEL: store_3d:
2749 ; GFX6789: ; %bb.0: ; %main_body
2750 ; GFX6789-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm
2751 ; GFX6789-NEXT: s_endpgm
2753 ; NOPRT-LABEL: store_3d:
2754 ; NOPRT: ; %bb.0: ; %main_body
2755 ; NOPRT-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm
2756 ; NOPRT-NEXT: s_endpgm
2758 ; GFX10-LABEL: store_3d:
2759 ; GFX10: ; %bb.0: ; %main_body
2760 ; GFX10-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm
2761 ; GFX10-NEXT: s_endpgm
2763 ; GFX11-LABEL: store_3d:
2764 ; GFX11: ; %bb.0: ; %main_body
2765 ; GFX11-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm
2766 ; GFX11-NEXT: s_nop 0
2767 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2768 ; GFX11-NEXT: s_endpgm
2770 ; GFX12-LABEL: store_3d:
2771 ; GFX12: ; %bb.0: ; %main_body
2772 ; GFX12-NEXT: image_store v[0:3], [v4, v5, v6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D
2773 ; GFX12-NEXT: s_nop 0
2774 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2775 ; GFX12-NEXT: s_endpgm
2777 call void @llvm.amdgcn.image.store.3d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %r, <8 x i32> %rsrc, i32 0, i32 0)
2781 define amdgpu_ps void @store_cube(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %slice) {
2782 ; VERDE-LABEL: store_cube:
2783 ; VERDE: ; %bb.0: ; %main_body
2784 ; VERDE-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
2785 ; VERDE-NEXT: s_endpgm
2787 ; FIJI-LABEL: store_cube:
2788 ; FIJI: ; %bb.0: ; %main_body
2789 ; FIJI-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
2790 ; FIJI-NEXT: s_endpgm
2792 ; GFX6789-LABEL: store_cube:
2793 ; GFX6789: ; %bb.0: ; %main_body
2794 ; GFX6789-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
2795 ; GFX6789-NEXT: s_endpgm
2797 ; NOPRT-LABEL: store_cube:
2798 ; NOPRT: ; %bb.0: ; %main_body
2799 ; NOPRT-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
2800 ; NOPRT-NEXT: s_endpgm
2802 ; GFX10-LABEL: store_cube:
2803 ; GFX10: ; %bb.0: ; %main_body
2804 ; GFX10-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm
2805 ; GFX10-NEXT: s_endpgm
2807 ; GFX11-LABEL: store_cube:
2808 ; GFX11: ; %bb.0: ; %main_body
2809 ; GFX11-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm
2810 ; GFX11-NEXT: s_nop 0
2811 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2812 ; GFX11-NEXT: s_endpgm
2814 ; GFX12-LABEL: store_cube:
2815 ; GFX12: ; %bb.0: ; %main_body
2816 ; GFX12-NEXT: image_store v[0:3], [v4, v5, v6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE
2817 ; GFX12-NEXT: s_nop 0
2818 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2819 ; GFX12-NEXT: s_endpgm
2821 call void @llvm.amdgcn.image.store.cube.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %slice, <8 x i32> %rsrc, i32 0, i32 0)
2825 define amdgpu_ps void @store_1darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %slice) {
2826 ; VERDE-LABEL: store_1darray:
2827 ; VERDE: ; %bb.0: ; %main_body
2828 ; VERDE-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm da
2829 ; VERDE-NEXT: s_endpgm
2831 ; FIJI-LABEL: store_1darray:
2832 ; FIJI: ; %bb.0: ; %main_body
2833 ; FIJI-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm da
2834 ; FIJI-NEXT: s_endpgm
2836 ; GFX6789-LABEL: store_1darray:
2837 ; GFX6789: ; %bb.0: ; %main_body
2838 ; GFX6789-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm da
2839 ; GFX6789-NEXT: s_endpgm
2841 ; NOPRT-LABEL: store_1darray:
2842 ; NOPRT: ; %bb.0: ; %main_body
2843 ; NOPRT-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf unorm da
2844 ; NOPRT-NEXT: s_endpgm
2846 ; GFX10-LABEL: store_1darray:
2847 ; GFX10: ; %bb.0: ; %main_body
2848 ; GFX10-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm
2849 ; GFX10-NEXT: s_endpgm
2851 ; GFX11-LABEL: store_1darray:
2852 ; GFX11: ; %bb.0: ; %main_body
2853 ; GFX11-NEXT: image_store v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm
2854 ; GFX11-NEXT: s_nop 0
2855 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2856 ; GFX11-NEXT: s_endpgm
2858 ; GFX12-LABEL: store_1darray:
2859 ; GFX12: ; %bb.0: ; %main_body
2860 ; GFX12-NEXT: image_store v[0:3], [v4, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY
2861 ; GFX12-NEXT: s_nop 0
2862 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2863 ; GFX12-NEXT: s_endpgm
2865 call void @llvm.amdgcn.image.store.1darray.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %slice, <8 x i32> %rsrc, i32 0, i32 0)
2869 define amdgpu_ps void @store_2darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %slice) {
2870 ; VERDE-LABEL: store_2darray:
2871 ; VERDE: ; %bb.0: ; %main_body
2872 ; VERDE-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
2873 ; VERDE-NEXT: s_endpgm
2875 ; FIJI-LABEL: store_2darray:
2876 ; FIJI: ; %bb.0: ; %main_body
2877 ; FIJI-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
2878 ; FIJI-NEXT: s_endpgm
2880 ; GFX6789-LABEL: store_2darray:
2881 ; GFX6789: ; %bb.0: ; %main_body
2882 ; GFX6789-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
2883 ; GFX6789-NEXT: s_endpgm
2885 ; NOPRT-LABEL: store_2darray:
2886 ; NOPRT: ; %bb.0: ; %main_body
2887 ; NOPRT-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
2888 ; NOPRT-NEXT: s_endpgm
2890 ; GFX10-LABEL: store_2darray:
2891 ; GFX10: ; %bb.0: ; %main_body
2892 ; GFX10-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm
2893 ; GFX10-NEXT: s_endpgm
2895 ; GFX11-LABEL: store_2darray:
2896 ; GFX11: ; %bb.0: ; %main_body
2897 ; GFX11-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm
2898 ; GFX11-NEXT: s_nop 0
2899 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2900 ; GFX11-NEXT: s_endpgm
2902 ; GFX12-LABEL: store_2darray:
2903 ; GFX12: ; %bb.0: ; %main_body
2904 ; GFX12-NEXT: image_store v[0:3], [v4, v5, v6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY
2905 ; GFX12-NEXT: s_nop 0
2906 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2907 ; GFX12-NEXT: s_endpgm
2909 call void @llvm.amdgcn.image.store.2darray.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %slice, <8 x i32> %rsrc, i32 0, i32 0)
2913 define amdgpu_ps void @store_2dmsaa(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %fragid) {
2914 ; VERDE-LABEL: store_2dmsaa:
2915 ; VERDE: ; %bb.0: ; %main_body
2916 ; VERDE-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm
2917 ; VERDE-NEXT: s_endpgm
2919 ; FIJI-LABEL: store_2dmsaa:
2920 ; FIJI: ; %bb.0: ; %main_body
2921 ; FIJI-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm
2922 ; FIJI-NEXT: s_endpgm
2924 ; GFX6789-LABEL: store_2dmsaa:
2925 ; GFX6789: ; %bb.0: ; %main_body
2926 ; GFX6789-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm
2927 ; GFX6789-NEXT: s_endpgm
2929 ; NOPRT-LABEL: store_2dmsaa:
2930 ; NOPRT: ; %bb.0: ; %main_body
2931 ; NOPRT-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf unorm
2932 ; NOPRT-NEXT: s_endpgm
2934 ; GFX10-LABEL: store_2dmsaa:
2935 ; GFX10: ; %bb.0: ; %main_body
2936 ; GFX10-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm
2937 ; GFX10-NEXT: s_endpgm
2939 ; GFX11-LABEL: store_2dmsaa:
2940 ; GFX11: ; %bb.0: ; %main_body
2941 ; GFX11-NEXT: image_store v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm
2942 ; GFX11-NEXT: s_nop 0
2943 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2944 ; GFX11-NEXT: s_endpgm
2946 ; GFX12-LABEL: store_2dmsaa:
2947 ; GFX12: ; %bb.0: ; %main_body
2948 ; GFX12-NEXT: image_store v[0:3], [v4, v5, v6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA
2949 ; GFX12-NEXT: s_nop 0
2950 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2951 ; GFX12-NEXT: s_endpgm
2953 call void @llvm.amdgcn.image.store.2dmsaa.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
2957 define amdgpu_ps void @store_2darraymsaa(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %slice, i32 %fragid) {
2958 ; VERDE-LABEL: store_2darraymsaa:
2959 ; VERDE: ; %bb.0: ; %main_body
2960 ; VERDE-NEXT: image_store v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
2961 ; VERDE-NEXT: s_endpgm
2963 ; FIJI-LABEL: store_2darraymsaa:
2964 ; FIJI: ; %bb.0: ; %main_body
2965 ; FIJI-NEXT: image_store v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
2966 ; FIJI-NEXT: s_endpgm
2968 ; GFX6789-LABEL: store_2darraymsaa:
2969 ; GFX6789: ; %bb.0: ; %main_body
2970 ; GFX6789-NEXT: image_store v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
2971 ; GFX6789-NEXT: s_endpgm
2973 ; NOPRT-LABEL: store_2darraymsaa:
2974 ; NOPRT: ; %bb.0: ; %main_body
2975 ; NOPRT-NEXT: image_store v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
2976 ; NOPRT-NEXT: s_endpgm
2978 ; GFX10-LABEL: store_2darraymsaa:
2979 ; GFX10: ; %bb.0: ; %main_body
2980 ; GFX10-NEXT: image_store v[0:3], v[4:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm
2981 ; GFX10-NEXT: s_endpgm
2983 ; GFX11-LABEL: store_2darraymsaa:
2984 ; GFX11: ; %bb.0: ; %main_body
2985 ; GFX11-NEXT: image_store v[0:3], v[4:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm
2986 ; GFX11-NEXT: s_nop 0
2987 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2988 ; GFX11-NEXT: s_endpgm
2990 ; GFX12-LABEL: store_2darraymsaa:
2991 ; GFX12: ; %bb.0: ; %main_body
2992 ; GFX12-NEXT: image_store v[0:3], [v4, v5, v6, v7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY
2993 ; GFX12-NEXT: s_nop 0
2994 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2995 ; GFX12-NEXT: s_endpgm
2997 call void @llvm.amdgcn.image.store.2darraymsaa.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %slice, i32 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
3001 define amdgpu_ps void @store_mip_1d(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %mip) {
3002 ; VERDE-LABEL: store_mip_1d:
3003 ; VERDE: ; %bb.0: ; %main_body
3004 ; VERDE-NEXT: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm
3005 ; VERDE-NEXT: s_endpgm
3007 ; FIJI-LABEL: store_mip_1d:
3008 ; FIJI: ; %bb.0: ; %main_body
3009 ; FIJI-NEXT: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm
3010 ; FIJI-NEXT: s_endpgm
3012 ; GFX6789-LABEL: store_mip_1d:
3013 ; GFX6789: ; %bb.0: ; %main_body
3014 ; GFX6789-NEXT: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm
3015 ; GFX6789-NEXT: s_endpgm
3017 ; NOPRT-LABEL: store_mip_1d:
3018 ; NOPRT: ; %bb.0: ; %main_body
3019 ; NOPRT-NEXT: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf unorm
3020 ; NOPRT-NEXT: s_endpgm
3022 ; GFX10-LABEL: store_mip_1d:
3023 ; GFX10: ; %bb.0: ; %main_body
3024 ; GFX10-NEXT: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
3025 ; GFX10-NEXT: s_endpgm
3027 ; GFX11-LABEL: store_mip_1d:
3028 ; GFX11: ; %bb.0: ; %main_body
3029 ; GFX11-NEXT: image_store_mip v[0:3], v[4:5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
3030 ; GFX11-NEXT: s_nop 0
3031 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3032 ; GFX11-NEXT: s_endpgm
3034 ; GFX12-LABEL: store_mip_1d:
3035 ; GFX12: ; %bb.0: ; %main_body
3036 ; GFX12-NEXT: image_store_mip v[0:3], [v4, v5], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D
3037 ; GFX12-NEXT: s_nop 0
3038 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3039 ; GFX12-NEXT: s_endpgm
3041 call void @llvm.amdgcn.image.store.mip.1d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3045 define amdgpu_ps void @store_mip_2d(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %mip) {
3046 ; VERDE-LABEL: store_mip_2d:
3047 ; VERDE: ; %bb.0: ; %main_body
3048 ; VERDE-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf unorm
3049 ; VERDE-NEXT: s_endpgm
3051 ; FIJI-LABEL: store_mip_2d:
3052 ; FIJI: ; %bb.0: ; %main_body
3053 ; FIJI-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf unorm
3054 ; FIJI-NEXT: s_endpgm
3056 ; GFX6789-LABEL: store_mip_2d:
3057 ; GFX6789: ; %bb.0: ; %main_body
3058 ; GFX6789-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf unorm
3059 ; GFX6789-NEXT: s_endpgm
3061 ; NOPRT-LABEL: store_mip_2d:
3062 ; NOPRT: ; %bb.0: ; %main_body
3063 ; NOPRT-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf unorm
3064 ; NOPRT-NEXT: s_endpgm
3066 ; GFX10-LABEL: store_mip_2d:
3067 ; GFX10: ; %bb.0: ; %main_body
3068 ; GFX10-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
3069 ; GFX10-NEXT: s_endpgm
3071 ; GFX11-LABEL: store_mip_2d:
3072 ; GFX11: ; %bb.0: ; %main_body
3073 ; GFX11-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
3074 ; GFX11-NEXT: s_nop 0
3075 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3076 ; GFX11-NEXT: s_endpgm
3078 ; GFX12-LABEL: store_mip_2d:
3079 ; GFX12: ; %bb.0: ; %main_body
3080 ; GFX12-NEXT: image_store_mip v[0:3], [v4, v5, v6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D
3081 ; GFX12-NEXT: s_nop 0
3082 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3083 ; GFX12-NEXT: s_endpgm
3085 call void @llvm.amdgcn.image.store.mip.2d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3089 define amdgpu_ps void @store_mip_3d(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %r, i32 %mip) {
3090 ; VERDE-LABEL: store_mip_3d:
3091 ; VERDE: ; %bb.0: ; %main_body
3092 ; VERDE-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm
3093 ; VERDE-NEXT: s_endpgm
3095 ; FIJI-LABEL: store_mip_3d:
3096 ; FIJI: ; %bb.0: ; %main_body
3097 ; FIJI-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm
3098 ; FIJI-NEXT: s_endpgm
3100 ; GFX6789-LABEL: store_mip_3d:
3101 ; GFX6789: ; %bb.0: ; %main_body
3102 ; GFX6789-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm
3103 ; GFX6789-NEXT: s_endpgm
3105 ; NOPRT-LABEL: store_mip_3d:
3106 ; NOPRT: ; %bb.0: ; %main_body
3107 ; NOPRT-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm
3108 ; NOPRT-NEXT: s_endpgm
3110 ; GFX10-LABEL: store_mip_3d:
3111 ; GFX10: ; %bb.0: ; %main_body
3112 ; GFX10-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm
3113 ; GFX10-NEXT: s_endpgm
3115 ; GFX11-LABEL: store_mip_3d:
3116 ; GFX11: ; %bb.0: ; %main_body
3117 ; GFX11-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm
3118 ; GFX11-NEXT: s_nop 0
3119 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3120 ; GFX11-NEXT: s_endpgm
3122 ; GFX12-LABEL: store_mip_3d:
3123 ; GFX12: ; %bb.0: ; %main_body
3124 ; GFX12-NEXT: image_store_mip v[0:3], [v4, v5, v6, v7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D
3125 ; GFX12-NEXT: s_nop 0
3126 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3127 ; GFX12-NEXT: s_endpgm
3129 call void @llvm.amdgcn.image.store.mip.3d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %r, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3133 define amdgpu_ps void @store_mip_cube(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %slice, i32 %mip) {
3134 ; VERDE-LABEL: store_mip_cube:
3135 ; VERDE: ; %bb.0: ; %main_body
3136 ; VERDE-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
3137 ; VERDE-NEXT: s_endpgm
3139 ; FIJI-LABEL: store_mip_cube:
3140 ; FIJI: ; %bb.0: ; %main_body
3141 ; FIJI-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
3142 ; FIJI-NEXT: s_endpgm
3144 ; GFX6789-LABEL: store_mip_cube:
3145 ; GFX6789: ; %bb.0: ; %main_body
3146 ; GFX6789-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
3147 ; GFX6789-NEXT: s_endpgm
3149 ; NOPRT-LABEL: store_mip_cube:
3150 ; NOPRT: ; %bb.0: ; %main_body
3151 ; NOPRT-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
3152 ; NOPRT-NEXT: s_endpgm
3154 ; GFX10-LABEL: store_mip_cube:
3155 ; GFX10: ; %bb.0: ; %main_body
3156 ; GFX10-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm
3157 ; GFX10-NEXT: s_endpgm
3159 ; GFX11-LABEL: store_mip_cube:
3160 ; GFX11: ; %bb.0: ; %main_body
3161 ; GFX11-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm
3162 ; GFX11-NEXT: s_nop 0
3163 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3164 ; GFX11-NEXT: s_endpgm
3166 ; GFX12-LABEL: store_mip_cube:
3167 ; GFX12: ; %bb.0: ; %main_body
3168 ; GFX12-NEXT: image_store_mip v[0:3], [v4, v5, v6, v7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE
3169 ; GFX12-NEXT: s_nop 0
3170 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3171 ; GFX12-NEXT: s_endpgm
3173 call void @llvm.amdgcn.image.store.mip.cube.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %slice, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3177 define amdgpu_ps void @store_mip_1darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %slice, i32 %mip) {
3178 ; VERDE-LABEL: store_mip_1darray:
3179 ; VERDE: ; %bb.0: ; %main_body
3180 ; VERDE-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
3181 ; VERDE-NEXT: s_endpgm
3183 ; FIJI-LABEL: store_mip_1darray:
3184 ; FIJI: ; %bb.0: ; %main_body
3185 ; FIJI-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
3186 ; FIJI-NEXT: s_endpgm
3188 ; GFX6789-LABEL: store_mip_1darray:
3189 ; GFX6789: ; %bb.0: ; %main_body
3190 ; GFX6789-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
3191 ; GFX6789-NEXT: s_endpgm
3193 ; NOPRT-LABEL: store_mip_1darray:
3194 ; NOPRT: ; %bb.0: ; %main_body
3195 ; NOPRT-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf unorm da
3196 ; NOPRT-NEXT: s_endpgm
3198 ; GFX10-LABEL: store_mip_1darray:
3199 ; GFX10: ; %bb.0: ; %main_body
3200 ; GFX10-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm
3201 ; GFX10-NEXT: s_endpgm
3203 ; GFX11-LABEL: store_mip_1darray:
3204 ; GFX11: ; %bb.0: ; %main_body
3205 ; GFX11-NEXT: image_store_mip v[0:3], v[4:6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm
3206 ; GFX11-NEXT: s_nop 0
3207 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3208 ; GFX11-NEXT: s_endpgm
3210 ; GFX12-LABEL: store_mip_1darray:
3211 ; GFX12: ; %bb.0: ; %main_body
3212 ; GFX12-NEXT: image_store_mip v[0:3], [v4, v5, v6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY
3213 ; GFX12-NEXT: s_nop 0
3214 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3215 ; GFX12-NEXT: s_endpgm
3217 call void @llvm.amdgcn.image.store.mip.1darray.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %slice, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3221 define amdgpu_ps void @store_mip_2darray(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s, i32 %t, i32 %slice, i32 %mip) {
3222 ; VERDE-LABEL: store_mip_2darray:
3223 ; VERDE: ; %bb.0: ; %main_body
3224 ; VERDE-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
3225 ; VERDE-NEXT: s_endpgm
3227 ; FIJI-LABEL: store_mip_2darray:
3228 ; FIJI: ; %bb.0: ; %main_body
3229 ; FIJI-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
3230 ; FIJI-NEXT: s_endpgm
3232 ; GFX6789-LABEL: store_mip_2darray:
3233 ; GFX6789: ; %bb.0: ; %main_body
3234 ; GFX6789-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
3235 ; GFX6789-NEXT: s_endpgm
3237 ; NOPRT-LABEL: store_mip_2darray:
3238 ; NOPRT: ; %bb.0: ; %main_body
3239 ; NOPRT-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf unorm da
3240 ; NOPRT-NEXT: s_endpgm
3242 ; GFX10-LABEL: store_mip_2darray:
3243 ; GFX10: ; %bb.0: ; %main_body
3244 ; GFX10-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm
3245 ; GFX10-NEXT: s_endpgm
3247 ; GFX11-LABEL: store_mip_2darray:
3248 ; GFX11: ; %bb.0: ; %main_body
3249 ; GFX11-NEXT: image_store_mip v[0:3], v[4:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm
3250 ; GFX11-NEXT: s_nop 0
3251 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3252 ; GFX11-NEXT: s_endpgm
3254 ; GFX12-LABEL: store_mip_2darray:
3255 ; GFX12: ; %bb.0: ; %main_body
3256 ; GFX12-NEXT: image_store_mip v[0:3], [v4, v5, v6, v7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY
3257 ; GFX12-NEXT: s_nop 0
3258 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3259 ; GFX12-NEXT: s_endpgm
3261 call void @llvm.amdgcn.image.store.mip.2darray.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, i32 %t, i32 %slice, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3265 define amdgpu_ps <4 x float> @getresinfo_1d(<8 x i32> inreg %rsrc, i32 %mip) {
3266 ; VERDE-LABEL: getresinfo_1d:
3267 ; VERDE: ; %bb.0: ; %main_body
3268 ; VERDE-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3269 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3270 ; VERDE-NEXT: ; return to shader part epilog
3272 ; FIJI-LABEL: getresinfo_1d:
3273 ; FIJI: ; %bb.0: ; %main_body
3274 ; FIJI-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3275 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3276 ; FIJI-NEXT: ; return to shader part epilog
3278 ; GFX6789-LABEL: getresinfo_1d:
3279 ; GFX6789: ; %bb.0: ; %main_body
3280 ; GFX6789-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3281 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3282 ; GFX6789-NEXT: ; return to shader part epilog
3284 ; NOPRT-LABEL: getresinfo_1d:
3285 ; NOPRT: ; %bb.0: ; %main_body
3286 ; NOPRT-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3287 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3288 ; NOPRT-NEXT: ; return to shader part epilog
3290 ; GFX10PLUS-LABEL: getresinfo_1d:
3291 ; GFX10PLUS: ; %bb.0: ; %main_body
3292 ; GFX10PLUS-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
3293 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3294 ; GFX10PLUS-NEXT: ; return to shader part epilog
3296 ; GFX12-LABEL: getresinfo_1d:
3297 ; GFX12: ; %bb.0: ; %main_body
3298 ; GFX12-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D
3299 ; GFX12-NEXT: s_wait_loadcnt 0x0
3300 ; GFX12-NEXT: ; return to shader part epilog
3302 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i32(i32 15, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3306 define amdgpu_ps <4 x float> @getresinfo_2d(<8 x i32> inreg %rsrc, i32 %mip) {
3307 ; VERDE-LABEL: getresinfo_2d:
3308 ; VERDE: ; %bb.0: ; %main_body
3309 ; VERDE-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3310 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3311 ; VERDE-NEXT: ; return to shader part epilog
3313 ; FIJI-LABEL: getresinfo_2d:
3314 ; FIJI: ; %bb.0: ; %main_body
3315 ; FIJI-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3316 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3317 ; FIJI-NEXT: ; return to shader part epilog
3319 ; GFX6789-LABEL: getresinfo_2d:
3320 ; GFX6789: ; %bb.0: ; %main_body
3321 ; GFX6789-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3322 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3323 ; GFX6789-NEXT: ; return to shader part epilog
3325 ; NOPRT-LABEL: getresinfo_2d:
3326 ; NOPRT: ; %bb.0: ; %main_body
3327 ; NOPRT-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3328 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3329 ; NOPRT-NEXT: ; return to shader part epilog
3331 ; GFX10PLUS-LABEL: getresinfo_2d:
3332 ; GFX10PLUS: ; %bb.0: ; %main_body
3333 ; GFX10PLUS-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
3334 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3335 ; GFX10PLUS-NEXT: ; return to shader part epilog
3337 ; GFX12-LABEL: getresinfo_2d:
3338 ; GFX12: ; %bb.0: ; %main_body
3339 ; GFX12-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D
3340 ; GFX12-NEXT: s_wait_loadcnt 0x0
3341 ; GFX12-NEXT: ; return to shader part epilog
3343 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i32(i32 15, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3347 define amdgpu_ps <4 x float> @getresinfo_3d(<8 x i32> inreg %rsrc, i32 %mip) {
3348 ; VERDE-LABEL: getresinfo_3d:
3349 ; VERDE: ; %bb.0: ; %main_body
3350 ; VERDE-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3351 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3352 ; VERDE-NEXT: ; return to shader part epilog
3354 ; FIJI-LABEL: getresinfo_3d:
3355 ; FIJI: ; %bb.0: ; %main_body
3356 ; FIJI-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3357 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3358 ; FIJI-NEXT: ; return to shader part epilog
3360 ; GFX6789-LABEL: getresinfo_3d:
3361 ; GFX6789: ; %bb.0: ; %main_body
3362 ; GFX6789-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3363 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3364 ; GFX6789-NEXT: ; return to shader part epilog
3366 ; NOPRT-LABEL: getresinfo_3d:
3367 ; NOPRT: ; %bb.0: ; %main_body
3368 ; NOPRT-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3369 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3370 ; NOPRT-NEXT: ; return to shader part epilog
3372 ; GFX10PLUS-LABEL: getresinfo_3d:
3373 ; GFX10PLUS: ; %bb.0: ; %main_body
3374 ; GFX10PLUS-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm
3375 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3376 ; GFX10PLUS-NEXT: ; return to shader part epilog
3378 ; GFX12-LABEL: getresinfo_3d:
3379 ; GFX12: ; %bb.0: ; %main_body
3380 ; GFX12-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D
3381 ; GFX12-NEXT: s_wait_loadcnt 0x0
3382 ; GFX12-NEXT: ; return to shader part epilog
3384 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i32(i32 15, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3388 define amdgpu_ps <4 x float> @getresinfo_cube(<8 x i32> inreg %rsrc, i32 %mip) {
3389 ; VERDE-LABEL: getresinfo_cube:
3390 ; VERDE: ; %bb.0: ; %main_body
3391 ; VERDE-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3392 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3393 ; VERDE-NEXT: ; return to shader part epilog
3395 ; FIJI-LABEL: getresinfo_cube:
3396 ; FIJI: ; %bb.0: ; %main_body
3397 ; FIJI-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3398 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3399 ; FIJI-NEXT: ; return to shader part epilog
3401 ; GFX6789-LABEL: getresinfo_cube:
3402 ; GFX6789: ; %bb.0: ; %main_body
3403 ; GFX6789-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3404 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3405 ; GFX6789-NEXT: ; return to shader part epilog
3407 ; NOPRT-LABEL: getresinfo_cube:
3408 ; NOPRT: ; %bb.0: ; %main_body
3409 ; NOPRT-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3410 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3411 ; NOPRT-NEXT: ; return to shader part epilog
3413 ; GFX10PLUS-LABEL: getresinfo_cube:
3414 ; GFX10PLUS: ; %bb.0: ; %main_body
3415 ; GFX10PLUS-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE unorm
3416 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3417 ; GFX10PLUS-NEXT: ; return to shader part epilog
3419 ; GFX12-LABEL: getresinfo_cube:
3420 ; GFX12: ; %bb.0: ; %main_body
3421 ; GFX12-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_CUBE
3422 ; GFX12-NEXT: s_wait_loadcnt 0x0
3423 ; GFX12-NEXT: ; return to shader part epilog
3425 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i32(i32 15, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3429 define amdgpu_ps <4 x float> @getresinfo_1darray(<8 x i32> inreg %rsrc, i32 %mip) {
3430 ; VERDE-LABEL: getresinfo_1darray:
3431 ; VERDE: ; %bb.0: ; %main_body
3432 ; VERDE-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3433 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3434 ; VERDE-NEXT: ; return to shader part epilog
3436 ; FIJI-LABEL: getresinfo_1darray:
3437 ; FIJI: ; %bb.0: ; %main_body
3438 ; FIJI-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3439 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3440 ; FIJI-NEXT: ; return to shader part epilog
3442 ; GFX6789-LABEL: getresinfo_1darray:
3443 ; GFX6789: ; %bb.0: ; %main_body
3444 ; GFX6789-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3445 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3446 ; GFX6789-NEXT: ; return to shader part epilog
3448 ; NOPRT-LABEL: getresinfo_1darray:
3449 ; NOPRT: ; %bb.0: ; %main_body
3450 ; NOPRT-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3451 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3452 ; NOPRT-NEXT: ; return to shader part epilog
3454 ; GFX10PLUS-LABEL: getresinfo_1darray:
3455 ; GFX10PLUS: ; %bb.0: ; %main_body
3456 ; GFX10PLUS-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY unorm
3457 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3458 ; GFX10PLUS-NEXT: ; return to shader part epilog
3460 ; GFX12-LABEL: getresinfo_1darray:
3461 ; GFX12: ; %bb.0: ; %main_body
3462 ; GFX12-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D_ARRAY
3463 ; GFX12-NEXT: s_wait_loadcnt 0x0
3464 ; GFX12-NEXT: ; return to shader part epilog
3466 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i32(i32 15, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3470 define amdgpu_ps <4 x float> @getresinfo_2darray(<8 x i32> inreg %rsrc, i32 %mip) {
3471 ; VERDE-LABEL: getresinfo_2darray:
3472 ; VERDE: ; %bb.0: ; %main_body
3473 ; VERDE-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3474 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3475 ; VERDE-NEXT: ; return to shader part epilog
3477 ; FIJI-LABEL: getresinfo_2darray:
3478 ; FIJI: ; %bb.0: ; %main_body
3479 ; FIJI-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3480 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3481 ; FIJI-NEXT: ; return to shader part epilog
3483 ; GFX6789-LABEL: getresinfo_2darray:
3484 ; GFX6789: ; %bb.0: ; %main_body
3485 ; GFX6789-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3486 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3487 ; GFX6789-NEXT: ; return to shader part epilog
3489 ; NOPRT-LABEL: getresinfo_2darray:
3490 ; NOPRT: ; %bb.0: ; %main_body
3491 ; NOPRT-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3492 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3493 ; NOPRT-NEXT: ; return to shader part epilog
3495 ; GFX10PLUS-LABEL: getresinfo_2darray:
3496 ; GFX10PLUS: ; %bb.0: ; %main_body
3497 ; GFX10PLUS-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY unorm
3498 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3499 ; GFX10PLUS-NEXT: ; return to shader part epilog
3501 ; GFX12-LABEL: getresinfo_2darray:
3502 ; GFX12: ; %bb.0: ; %main_body
3503 ; GFX12-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_ARRAY
3504 ; GFX12-NEXT: s_wait_loadcnt 0x0
3505 ; GFX12-NEXT: ; return to shader part epilog
3507 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i32(i32 15, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3511 define amdgpu_ps <4 x float> @getresinfo_2dmsaa(<8 x i32> inreg %rsrc, i32 %mip) {
3512 ; VERDE-LABEL: getresinfo_2dmsaa:
3513 ; VERDE: ; %bb.0: ; %main_body
3514 ; VERDE-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3515 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3516 ; VERDE-NEXT: ; return to shader part epilog
3518 ; FIJI-LABEL: getresinfo_2dmsaa:
3519 ; FIJI: ; %bb.0: ; %main_body
3520 ; FIJI-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3521 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3522 ; FIJI-NEXT: ; return to shader part epilog
3524 ; GFX6789-LABEL: getresinfo_2dmsaa:
3525 ; GFX6789: ; %bb.0: ; %main_body
3526 ; GFX6789-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3527 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3528 ; GFX6789-NEXT: ; return to shader part epilog
3530 ; NOPRT-LABEL: getresinfo_2dmsaa:
3531 ; NOPRT: ; %bb.0: ; %main_body
3532 ; NOPRT-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm
3533 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3534 ; NOPRT-NEXT: ; return to shader part epilog
3536 ; GFX10PLUS-LABEL: getresinfo_2dmsaa:
3537 ; GFX10PLUS: ; %bb.0: ; %main_body
3538 ; GFX10PLUS-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA unorm
3539 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3540 ; GFX10PLUS-NEXT: ; return to shader part epilog
3542 ; GFX12-LABEL: getresinfo_2dmsaa:
3543 ; GFX12: ; %bb.0: ; %main_body
3544 ; GFX12-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA
3545 ; GFX12-NEXT: s_wait_loadcnt 0x0
3546 ; GFX12-NEXT: ; return to shader part epilog
3548 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i32(i32 15, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3552 define amdgpu_ps <4 x float> @getresinfo_2darraymsaa(<8 x i32> inreg %rsrc, i32 %mip) {
3553 ; VERDE-LABEL: getresinfo_2darraymsaa:
3554 ; VERDE: ; %bb.0: ; %main_body
3555 ; VERDE-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3556 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3557 ; VERDE-NEXT: ; return to shader part epilog
3559 ; FIJI-LABEL: getresinfo_2darraymsaa:
3560 ; FIJI: ; %bb.0: ; %main_body
3561 ; FIJI-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3562 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3563 ; FIJI-NEXT: ; return to shader part epilog
3565 ; GFX6789-LABEL: getresinfo_2darraymsaa:
3566 ; GFX6789: ; %bb.0: ; %main_body
3567 ; GFX6789-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3568 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3569 ; GFX6789-NEXT: ; return to shader part epilog
3571 ; NOPRT-LABEL: getresinfo_2darraymsaa:
3572 ; NOPRT: ; %bb.0: ; %main_body
3573 ; NOPRT-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf unorm da
3574 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3575 ; NOPRT-NEXT: ; return to shader part epilog
3577 ; GFX10PLUS-LABEL: getresinfo_2darraymsaa:
3578 ; GFX10PLUS: ; %bb.0: ; %main_body
3579 ; GFX10PLUS-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm
3580 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3581 ; GFX10PLUS-NEXT: ; return to shader part epilog
3583 ; GFX12-LABEL: getresinfo_2darraymsaa:
3584 ; GFX12: ; %bb.0: ; %main_body
3585 ; GFX12-NEXT: image_get_resinfo v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY
3586 ; GFX12-NEXT: s_wait_loadcnt 0x0
3587 ; GFX12-NEXT: ; return to shader part epilog
3589 %v = call <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i32(i32 15, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
3593 define amdgpu_ps float @load_1d_V1(<8 x i32> inreg %rsrc, i32 %s) {
3594 ; VERDE-LABEL: load_1d_V1:
3595 ; VERDE: ; %bb.0: ; %main_body
3596 ; VERDE-NEXT: image_load v0, v0, s[0:7] dmask:0x8 unorm
3597 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3598 ; VERDE-NEXT: ; return to shader part epilog
3600 ; FIJI-LABEL: load_1d_V1:
3601 ; FIJI: ; %bb.0: ; %main_body
3602 ; FIJI-NEXT: image_load v0, v0, s[0:7] dmask:0x8 unorm
3603 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3604 ; FIJI-NEXT: ; return to shader part epilog
3606 ; GFX6789-LABEL: load_1d_V1:
3607 ; GFX6789: ; %bb.0: ; %main_body
3608 ; GFX6789-NEXT: image_load v0, v0, s[0:7] dmask:0x8 unorm
3609 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3610 ; GFX6789-NEXT: ; return to shader part epilog
3612 ; NOPRT-LABEL: load_1d_V1:
3613 ; NOPRT: ; %bb.0: ; %main_body
3614 ; NOPRT-NEXT: image_load v0, v0, s[0:7] dmask:0x8 unorm
3615 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3616 ; NOPRT-NEXT: ; return to shader part epilog
3618 ; GFX10PLUS-LABEL: load_1d_V1:
3619 ; GFX10PLUS: ; %bb.0: ; %main_body
3620 ; GFX10PLUS-NEXT: image_load v0, v0, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D unorm
3621 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3622 ; GFX10PLUS-NEXT: ; return to shader part epilog
3624 ; GFX12-LABEL: load_1d_V1:
3625 ; GFX12: ; %bb.0: ; %main_body
3626 ; GFX12-NEXT: image_load v0, v0, s[0:7] dmask:0x8 dim:SQ_RSRC_IMG_1D
3627 ; GFX12-NEXT: s_wait_loadcnt 0x0
3628 ; GFX12-NEXT: ; return to shader part epilog
3630 %v = call float @llvm.amdgcn.image.load.1d.f32.i32(i32 8, i32 %s, <8 x i32> %rsrc, i32 0, i32 0)
3634 define amdgpu_ps <2 x float> @load_1d_V2(<8 x i32> inreg %rsrc, i32 %s) {
3635 ; VERDE-LABEL: load_1d_V2:
3636 ; VERDE: ; %bb.0: ; %main_body
3637 ; VERDE-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x9 unorm
3638 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3639 ; VERDE-NEXT: ; return to shader part epilog
3641 ; FIJI-LABEL: load_1d_V2:
3642 ; FIJI: ; %bb.0: ; %main_body
3643 ; FIJI-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x9 unorm
3644 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3645 ; FIJI-NEXT: ; return to shader part epilog
3647 ; GFX6789-LABEL: load_1d_V2:
3648 ; GFX6789: ; %bb.0: ; %main_body
3649 ; GFX6789-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x9 unorm
3650 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3651 ; GFX6789-NEXT: ; return to shader part epilog
3653 ; NOPRT-LABEL: load_1d_V2:
3654 ; NOPRT: ; %bb.0: ; %main_body
3655 ; NOPRT-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x9 unorm
3656 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3657 ; NOPRT-NEXT: ; return to shader part epilog
3659 ; GFX10PLUS-LABEL: load_1d_V2:
3660 ; GFX10PLUS: ; %bb.0: ; %main_body
3661 ; GFX10PLUS-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x9 dim:SQ_RSRC_IMG_1D unorm
3662 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3663 ; GFX10PLUS-NEXT: ; return to shader part epilog
3665 ; GFX12-LABEL: load_1d_V2:
3666 ; GFX12: ; %bb.0: ; %main_body
3667 ; GFX12-NEXT: image_load v[0:1], v0, s[0:7] dmask:0x9 dim:SQ_RSRC_IMG_1D
3668 ; GFX12-NEXT: s_wait_loadcnt 0x0
3669 ; GFX12-NEXT: ; return to shader part epilog
3671 %v = call <2 x float> @llvm.amdgcn.image.load.1d.v2f32.i32(i32 9, i32 %s, <8 x i32> %rsrc, i32 0, i32 0)
3675 define amdgpu_ps void @store_1d_V1(<8 x i32> inreg %rsrc, float %vdata, i32 %s) {
3676 ; VERDE-LABEL: store_1d_V1:
3677 ; VERDE: ; %bb.0: ; %main_body
3678 ; VERDE-NEXT: image_store v0, v1, s[0:7] dmask:0x2 unorm
3679 ; VERDE-NEXT: s_endpgm
3681 ; FIJI-LABEL: store_1d_V1:
3682 ; FIJI: ; %bb.0: ; %main_body
3683 ; FIJI-NEXT: image_store v0, v1, s[0:7] dmask:0x2 unorm
3684 ; FIJI-NEXT: s_endpgm
3686 ; GFX6789-LABEL: store_1d_V1:
3687 ; GFX6789: ; %bb.0: ; %main_body
3688 ; GFX6789-NEXT: image_store v0, v1, s[0:7] dmask:0x2 unorm
3689 ; GFX6789-NEXT: s_endpgm
3691 ; NOPRT-LABEL: store_1d_V1:
3692 ; NOPRT: ; %bb.0: ; %main_body
3693 ; NOPRT-NEXT: image_store v0, v1, s[0:7] dmask:0x2 unorm
3694 ; NOPRT-NEXT: s_endpgm
3696 ; GFX10-LABEL: store_1d_V1:
3697 ; GFX10: ; %bb.0: ; %main_body
3698 ; GFX10-NEXT: image_store v0, v1, s[0:7] dmask:0x2 dim:SQ_RSRC_IMG_1D unorm
3699 ; GFX10-NEXT: s_endpgm
3701 ; GFX11-LABEL: store_1d_V1:
3702 ; GFX11: ; %bb.0: ; %main_body
3703 ; GFX11-NEXT: image_store v0, v1, s[0:7] dmask:0x2 dim:SQ_RSRC_IMG_1D unorm
3704 ; GFX11-NEXT: s_nop 0
3705 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3706 ; GFX11-NEXT: s_endpgm
3708 ; GFX12-LABEL: store_1d_V1:
3709 ; GFX12: ; %bb.0: ; %main_body
3710 ; GFX12-NEXT: image_store v0, v1, s[0:7] dmask:0x2 dim:SQ_RSRC_IMG_1D
3711 ; GFX12-NEXT: s_nop 0
3712 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3713 ; GFX12-NEXT: s_endpgm
3715 call void @llvm.amdgcn.image.store.1d.f32.i32(float %vdata, i32 2, i32 %s, <8 x i32> %rsrc, i32 0, i32 0)
3719 define amdgpu_ps void @store_1d_V2(<8 x i32> inreg %rsrc, <2 x float> %vdata, i32 %s) {
3720 ; VERDE-LABEL: store_1d_V2:
3721 ; VERDE: ; %bb.0: ; %main_body
3722 ; VERDE-NEXT: image_store v[0:1], v2, s[0:7] dmask:0xc unorm
3723 ; VERDE-NEXT: s_endpgm
3725 ; FIJI-LABEL: store_1d_V2:
3726 ; FIJI: ; %bb.0: ; %main_body
3727 ; FIJI-NEXT: image_store v[0:1], v2, s[0:7] dmask:0xc unorm
3728 ; FIJI-NEXT: s_endpgm
3730 ; GFX6789-LABEL: store_1d_V2:
3731 ; GFX6789: ; %bb.0: ; %main_body
3732 ; GFX6789-NEXT: image_store v[0:1], v2, s[0:7] dmask:0xc unorm
3733 ; GFX6789-NEXT: s_endpgm
3735 ; NOPRT-LABEL: store_1d_V2:
3736 ; NOPRT: ; %bb.0: ; %main_body
3737 ; NOPRT-NEXT: image_store v[0:1], v2, s[0:7] dmask:0xc unorm
3738 ; NOPRT-NEXT: s_endpgm
3740 ; GFX10-LABEL: store_1d_V2:
3741 ; GFX10: ; %bb.0: ; %main_body
3742 ; GFX10-NEXT: image_store v[0:1], v2, s[0:7] dmask:0xc dim:SQ_RSRC_IMG_1D unorm
3743 ; GFX10-NEXT: s_endpgm
3745 ; GFX11-LABEL: store_1d_V2:
3746 ; GFX11: ; %bb.0: ; %main_body
3747 ; GFX11-NEXT: image_store v[0:1], v2, s[0:7] dmask:0xc dim:SQ_RSRC_IMG_1D unorm
3748 ; GFX11-NEXT: s_nop 0
3749 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3750 ; GFX11-NEXT: s_endpgm
3752 ; GFX12-LABEL: store_1d_V2:
3753 ; GFX12: ; %bb.0: ; %main_body
3754 ; GFX12-NEXT: image_store v[0:1], v2, s[0:7] dmask:0xc dim:SQ_RSRC_IMG_1D
3755 ; GFX12-NEXT: s_nop 0
3756 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3757 ; GFX12-NEXT: s_endpgm
3759 call void @llvm.amdgcn.image.store.1d.v2f32.i32(<2 x float> %vdata, i32 12, i32 %s, <8 x i32> %rsrc, i32 0, i32 0)
3763 define amdgpu_ps <4 x float> @load_1d_glc(<8 x i32> inreg %rsrc, i32 %s) {
3764 ; VERDE-LABEL: load_1d_glc:
3765 ; VERDE: ; %bb.0: ; %main_body
3766 ; VERDE-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc
3767 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3768 ; VERDE-NEXT: ; return to shader part epilog
3770 ; FIJI-LABEL: load_1d_glc:
3771 ; FIJI: ; %bb.0: ; %main_body
3772 ; FIJI-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc
3773 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3774 ; FIJI-NEXT: ; return to shader part epilog
3776 ; GFX6789-LABEL: load_1d_glc:
3777 ; GFX6789: ; %bb.0: ; %main_body
3778 ; GFX6789-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc
3779 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3780 ; GFX6789-NEXT: ; return to shader part epilog
3782 ; NOPRT-LABEL: load_1d_glc:
3783 ; NOPRT: ; %bb.0: ; %main_body
3784 ; NOPRT-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc
3785 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3786 ; NOPRT-NEXT: ; return to shader part epilog
3788 ; GFX10PLUS-LABEL: load_1d_glc:
3789 ; GFX10PLUS: ; %bb.0: ; %main_body
3790 ; GFX10PLUS-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc
3791 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3792 ; GFX10PLUS-NEXT: ; return to shader part epilog
3794 ; GFX12-LABEL: load_1d_glc:
3795 ; GFX12: ; %bb.0: ; %main_body
3796 ; GFX12-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_LOAD_NT
3797 ; GFX12-NEXT: s_wait_loadcnt 0x0
3798 ; GFX12-NEXT: ; return to shader part epilog
3800 %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i32(i32 15, i32 %s, <8 x i32> %rsrc, i32 0, i32 1)
3804 define amdgpu_ps <4 x float> @load_1d_slc(<8 x i32> inreg %rsrc, i32 %s) {
3805 ; VERDE-LABEL: load_1d_slc:
3806 ; VERDE: ; %bb.0: ; %main_body
3807 ; VERDE-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm slc
3808 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3809 ; VERDE-NEXT: ; return to shader part epilog
3811 ; FIJI-LABEL: load_1d_slc:
3812 ; FIJI: ; %bb.0: ; %main_body
3813 ; FIJI-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm slc
3814 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3815 ; FIJI-NEXT: ; return to shader part epilog
3817 ; GFX6789-LABEL: load_1d_slc:
3818 ; GFX6789: ; %bb.0: ; %main_body
3819 ; GFX6789-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm slc
3820 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3821 ; GFX6789-NEXT: ; return to shader part epilog
3823 ; NOPRT-LABEL: load_1d_slc:
3824 ; NOPRT: ; %bb.0: ; %main_body
3825 ; NOPRT-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm slc
3826 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3827 ; NOPRT-NEXT: ; return to shader part epilog
3829 ; GFX10PLUS-LABEL: load_1d_slc:
3830 ; GFX10PLUS: ; %bb.0: ; %main_body
3831 ; GFX10PLUS-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm slc
3832 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3833 ; GFX10PLUS-NEXT: ; return to shader part epilog
3835 ; GFX12-LABEL: load_1d_slc:
3836 ; GFX12: ; %bb.0: ; %main_body
3837 ; GFX12-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_LOAD_HT
3838 ; GFX12-NEXT: s_wait_loadcnt 0x0
3839 ; GFX12-NEXT: ; return to shader part epilog
3841 %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i32(i32 15, i32 %s, <8 x i32> %rsrc, i32 0, i32 2)
3845 define amdgpu_ps <4 x float> @load_1d_glc_slc(<8 x i32> inreg %rsrc, i32 %s) {
3846 ; VERDE-LABEL: load_1d_glc_slc:
3847 ; VERDE: ; %bb.0: ; %main_body
3848 ; VERDE-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc slc
3849 ; VERDE-NEXT: s_waitcnt vmcnt(0)
3850 ; VERDE-NEXT: ; return to shader part epilog
3852 ; FIJI-LABEL: load_1d_glc_slc:
3853 ; FIJI: ; %bb.0: ; %main_body
3854 ; FIJI-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc slc
3855 ; FIJI-NEXT: s_waitcnt vmcnt(0)
3856 ; FIJI-NEXT: ; return to shader part epilog
3858 ; GFX6789-LABEL: load_1d_glc_slc:
3859 ; GFX6789: ; %bb.0: ; %main_body
3860 ; GFX6789-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc slc
3861 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
3862 ; GFX6789-NEXT: ; return to shader part epilog
3864 ; NOPRT-LABEL: load_1d_glc_slc:
3865 ; NOPRT: ; %bb.0: ; %main_body
3866 ; NOPRT-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf unorm glc slc
3867 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
3868 ; NOPRT-NEXT: ; return to shader part epilog
3870 ; GFX10PLUS-LABEL: load_1d_glc_slc:
3871 ; GFX10PLUS: ; %bb.0: ; %main_body
3872 ; GFX10PLUS-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc slc
3873 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
3874 ; GFX10PLUS-NEXT: ; return to shader part epilog
3876 ; GFX12-LABEL: load_1d_glc_slc:
3877 ; GFX12: ; %bb.0: ; %main_body
3878 ; GFX12-NEXT: image_load v[0:3], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_LOAD_LU
3879 ; GFX12-NEXT: s_wait_loadcnt 0x0
3880 ; GFX12-NEXT: ; return to shader part epilog
3882 %v = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i32(i32 15, i32 %s, <8 x i32> %rsrc, i32 0, i32 3)
3886 define amdgpu_ps void @store_1d_glc(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s) {
3887 ; VERDE-LABEL: store_1d_glc:
3888 ; VERDE: ; %bb.0: ; %main_body
3889 ; VERDE-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc
3890 ; VERDE-NEXT: s_endpgm
3892 ; FIJI-LABEL: store_1d_glc:
3893 ; FIJI: ; %bb.0: ; %main_body
3894 ; FIJI-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc
3895 ; FIJI-NEXT: s_endpgm
3897 ; GFX6789-LABEL: store_1d_glc:
3898 ; GFX6789: ; %bb.0: ; %main_body
3899 ; GFX6789-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc
3900 ; GFX6789-NEXT: s_endpgm
3902 ; NOPRT-LABEL: store_1d_glc:
3903 ; NOPRT: ; %bb.0: ; %main_body
3904 ; NOPRT-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc
3905 ; NOPRT-NEXT: s_endpgm
3907 ; GFX10-LABEL: store_1d_glc:
3908 ; GFX10: ; %bb.0: ; %main_body
3909 ; GFX10-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc
3910 ; GFX10-NEXT: s_endpgm
3912 ; GFX11-LABEL: store_1d_glc:
3913 ; GFX11: ; %bb.0: ; %main_body
3914 ; GFX11-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc
3915 ; GFX11-NEXT: s_nop 0
3916 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3917 ; GFX11-NEXT: s_endpgm
3919 ; GFX12-LABEL: store_1d_glc:
3920 ; GFX12: ; %bb.0: ; %main_body
3921 ; GFX12-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_STORE_NT
3922 ; GFX12-NEXT: s_nop 0
3923 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3924 ; GFX12-NEXT: s_endpgm
3926 call void @llvm.amdgcn.image.store.1d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, <8 x i32> %rsrc, i32 0, i32 1)
3930 define amdgpu_ps void @store_1d_slc(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s) {
3931 ; VERDE-LABEL: store_1d_slc:
3932 ; VERDE: ; %bb.0: ; %main_body
3933 ; VERDE-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm slc
3934 ; VERDE-NEXT: s_endpgm
3936 ; FIJI-LABEL: store_1d_slc:
3937 ; FIJI: ; %bb.0: ; %main_body
3938 ; FIJI-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm slc
3939 ; FIJI-NEXT: s_endpgm
3941 ; GFX6789-LABEL: store_1d_slc:
3942 ; GFX6789: ; %bb.0: ; %main_body
3943 ; GFX6789-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm slc
3944 ; GFX6789-NEXT: s_endpgm
3946 ; NOPRT-LABEL: store_1d_slc:
3947 ; NOPRT: ; %bb.0: ; %main_body
3948 ; NOPRT-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm slc
3949 ; NOPRT-NEXT: s_endpgm
3951 ; GFX10-LABEL: store_1d_slc:
3952 ; GFX10: ; %bb.0: ; %main_body
3953 ; GFX10-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm slc
3954 ; GFX10-NEXT: s_endpgm
3956 ; GFX11-LABEL: store_1d_slc:
3957 ; GFX11: ; %bb.0: ; %main_body
3958 ; GFX11-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm slc
3959 ; GFX11-NEXT: s_nop 0
3960 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3961 ; GFX11-NEXT: s_endpgm
3963 ; GFX12-LABEL: store_1d_slc:
3964 ; GFX12: ; %bb.0: ; %main_body
3965 ; GFX12-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_STORE_HT
3966 ; GFX12-NEXT: s_nop 0
3967 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
3968 ; GFX12-NEXT: s_endpgm
3970 call void @llvm.amdgcn.image.store.1d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, <8 x i32> %rsrc, i32 0, i32 2)
3974 define amdgpu_ps void @store_1d_glc_slc(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %s) {
3975 ; VERDE-LABEL: store_1d_glc_slc:
3976 ; VERDE: ; %bb.0: ; %main_body
3977 ; VERDE-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc slc
3978 ; VERDE-NEXT: s_endpgm
3980 ; FIJI-LABEL: store_1d_glc_slc:
3981 ; FIJI: ; %bb.0: ; %main_body
3982 ; FIJI-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc slc
3983 ; FIJI-NEXT: s_endpgm
3985 ; GFX6789-LABEL: store_1d_glc_slc:
3986 ; GFX6789: ; %bb.0: ; %main_body
3987 ; GFX6789-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc slc
3988 ; GFX6789-NEXT: s_endpgm
3990 ; NOPRT-LABEL: store_1d_glc_slc:
3991 ; NOPRT: ; %bb.0: ; %main_body
3992 ; NOPRT-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm glc slc
3993 ; NOPRT-NEXT: s_endpgm
3995 ; GFX10-LABEL: store_1d_glc_slc:
3996 ; GFX10: ; %bb.0: ; %main_body
3997 ; GFX10-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc slc
3998 ; GFX10-NEXT: s_endpgm
4000 ; GFX11-LABEL: store_1d_glc_slc:
4001 ; GFX11: ; %bb.0: ; %main_body
4002 ; GFX11-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc slc
4003 ; GFX11-NEXT: s_nop 0
4004 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
4005 ; GFX11-NEXT: s_endpgm
4007 ; GFX12-LABEL: store_1d_glc_slc:
4008 ; GFX12: ; %bb.0: ; %main_body
4009 ; GFX12-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D th:TH_STORE_RT_WB
4010 ; GFX12-NEXT: s_nop 0
4011 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
4012 ; GFX12-NEXT: s_endpgm
4014 call void @llvm.amdgcn.image.store.1d.v4f32.i32(<4 x float> %vdata, i32 15, i32 %s, <8 x i32> %rsrc, i32 0, i32 3)
4018 define amdgpu_ps <3 x float> @getresinfo_dmask7(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %mip) {
4019 ; VERDE-LABEL: getresinfo_dmask7:
4020 ; VERDE: ; %bb.0: ; %main_body
4021 ; VERDE-NEXT: image_get_resinfo v[0:2], v0, s[0:7] dmask:0x7 unorm
4022 ; VERDE-NEXT: s_waitcnt vmcnt(0)
4023 ; VERDE-NEXT: ; return to shader part epilog
4025 ; FIJI-LABEL: getresinfo_dmask7:
4026 ; FIJI: ; %bb.0: ; %main_body
4027 ; FIJI-NEXT: image_get_resinfo v[0:2], v0, s[0:7] dmask:0x7 unorm
4028 ; FIJI-NEXT: s_waitcnt vmcnt(0)
4029 ; FIJI-NEXT: ; return to shader part epilog
4031 ; GFX6789-LABEL: getresinfo_dmask7:
4032 ; GFX6789: ; %bb.0: ; %main_body
4033 ; GFX6789-NEXT: image_get_resinfo v[0:2], v0, s[0:7] dmask:0x7 unorm
4034 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
4035 ; GFX6789-NEXT: ; return to shader part epilog
4037 ; NOPRT-LABEL: getresinfo_dmask7:
4038 ; NOPRT: ; %bb.0: ; %main_body
4039 ; NOPRT-NEXT: image_get_resinfo v[0:2], v0, s[0:7] dmask:0x7 unorm
4040 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
4041 ; NOPRT-NEXT: ; return to shader part epilog
4043 ; GFX10PLUS-LABEL: getresinfo_dmask7:
4044 ; GFX10PLUS: ; %bb.0: ; %main_body
4045 ; GFX10PLUS-NEXT: image_get_resinfo v[0:2], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D unorm
4046 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
4047 ; GFX10PLUS-NEXT: ; return to shader part epilog
4049 ; GFX12-LABEL: getresinfo_dmask7:
4050 ; GFX12: ; %bb.0: ; %main_body
4051 ; GFX12-NEXT: image_get_resinfo v[0:2], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D
4052 ; GFX12-NEXT: s_wait_loadcnt 0x0
4053 ; GFX12-NEXT: ; return to shader part epilog
4055 %r = call <3 x float> @llvm.amdgcn.image.getresinfo.1d.v3f32.i32(i32 7, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
4059 define amdgpu_ps <2 x float> @getresinfo_dmask3(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %mip) {
4060 ; VERDE-LABEL: getresinfo_dmask3:
4061 ; VERDE: ; %bb.0: ; %main_body
4062 ; VERDE-NEXT: image_get_resinfo v[0:1], v0, s[0:7] dmask:0x3 unorm
4063 ; VERDE-NEXT: s_waitcnt vmcnt(0)
4064 ; VERDE-NEXT: ; return to shader part epilog
4066 ; FIJI-LABEL: getresinfo_dmask3:
4067 ; FIJI: ; %bb.0: ; %main_body
4068 ; FIJI-NEXT: image_get_resinfo v[0:1], v0, s[0:7] dmask:0x3 unorm
4069 ; FIJI-NEXT: s_waitcnt vmcnt(0)
4070 ; FIJI-NEXT: ; return to shader part epilog
4072 ; GFX6789-LABEL: getresinfo_dmask3:
4073 ; GFX6789: ; %bb.0: ; %main_body
4074 ; GFX6789-NEXT: image_get_resinfo v[0:1], v0, s[0:7] dmask:0x3 unorm
4075 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
4076 ; GFX6789-NEXT: ; return to shader part epilog
4078 ; NOPRT-LABEL: getresinfo_dmask3:
4079 ; NOPRT: ; %bb.0: ; %main_body
4080 ; NOPRT-NEXT: image_get_resinfo v[0:1], v0, s[0:7] dmask:0x3 unorm
4081 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
4082 ; NOPRT-NEXT: ; return to shader part epilog
4084 ; GFX10PLUS-LABEL: getresinfo_dmask3:
4085 ; GFX10PLUS: ; %bb.0: ; %main_body
4086 ; GFX10PLUS-NEXT: image_get_resinfo v[0:1], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm
4087 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
4088 ; GFX10PLUS-NEXT: ; return to shader part epilog
4090 ; GFX12-LABEL: getresinfo_dmask3:
4091 ; GFX12: ; %bb.0: ; %main_body
4092 ; GFX12-NEXT: image_get_resinfo v[0:1], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D
4093 ; GFX12-NEXT: s_wait_loadcnt 0x0
4094 ; GFX12-NEXT: ; return to shader part epilog
4096 %r = call <2 x float> @llvm.amdgcn.image.getresinfo.1d.v2f32.i32(i32 3, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
4100 define amdgpu_ps float @getresinfo_dmask1(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %mip) {
4101 ; VERDE-LABEL: getresinfo_dmask1:
4102 ; VERDE: ; %bb.0: ; %main_body
4103 ; VERDE-NEXT: image_get_resinfo v0, v0, s[0:7] dmask:0x1 unorm
4104 ; VERDE-NEXT: s_waitcnt vmcnt(0)
4105 ; VERDE-NEXT: ; return to shader part epilog
4107 ; FIJI-LABEL: getresinfo_dmask1:
4108 ; FIJI: ; %bb.0: ; %main_body
4109 ; FIJI-NEXT: image_get_resinfo v0, v0, s[0:7] dmask:0x1 unorm
4110 ; FIJI-NEXT: s_waitcnt vmcnt(0)
4111 ; FIJI-NEXT: ; return to shader part epilog
4113 ; GFX6789-LABEL: getresinfo_dmask1:
4114 ; GFX6789: ; %bb.0: ; %main_body
4115 ; GFX6789-NEXT: image_get_resinfo v0, v0, s[0:7] dmask:0x1 unorm
4116 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
4117 ; GFX6789-NEXT: ; return to shader part epilog
4119 ; NOPRT-LABEL: getresinfo_dmask1:
4120 ; NOPRT: ; %bb.0: ; %main_body
4121 ; NOPRT-NEXT: image_get_resinfo v0, v0, s[0:7] dmask:0x1 unorm
4122 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
4123 ; NOPRT-NEXT: ; return to shader part epilog
4125 ; GFX10PLUS-LABEL: getresinfo_dmask1:
4126 ; GFX10PLUS: ; %bb.0: ; %main_body
4127 ; GFX10PLUS-NEXT: image_get_resinfo v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm
4128 ; GFX10PLUS-NEXT: s_waitcnt vmcnt(0)
4129 ; GFX10PLUS-NEXT: ; return to shader part epilog
4131 ; GFX12-LABEL: getresinfo_dmask1:
4132 ; GFX12: ; %bb.0: ; %main_body
4133 ; GFX12-NEXT: image_get_resinfo v0, v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D
4134 ; GFX12-NEXT: s_wait_loadcnt 0x0
4135 ; GFX12-NEXT: ; return to shader part epilog
4137 %r = call float @llvm.amdgcn.image.getresinfo.1d.f32.i32(i32 1, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
4141 define amdgpu_ps <4 x float> @getresinfo_dmask0(<8 x i32> inreg %rsrc, <4 x float> %vdata, i32 %mip) #0 {
4142 ; VERDE-LABEL: getresinfo_dmask0:
4143 ; VERDE: ; %bb.0: ; %main_body
4144 ; VERDE-NEXT: ; return to shader part epilog
4146 ; FIJI-LABEL: getresinfo_dmask0:
4147 ; FIJI: ; %bb.0: ; %main_body
4148 ; FIJI-NEXT: ; return to shader part epilog
4150 ; GFX6789-LABEL: getresinfo_dmask0:
4151 ; GFX6789: ; %bb.0: ; %main_body
4152 ; GFX6789-NEXT: ; return to shader part epilog
4154 ; NOPRT-LABEL: getresinfo_dmask0:
4155 ; NOPRT: ; %bb.0: ; %main_body
4156 ; NOPRT-NEXT: ; return to shader part epilog
4158 ; GFX10PLUS-LABEL: getresinfo_dmask0:
4159 ; GFX10PLUS: ; %bb.0: ; %main_body
4160 ; GFX10PLUS-NEXT: ; return to shader part epilog
4162 ; GFX12-LABEL: getresinfo_dmask0:
4163 ; GFX12: ; %bb.0: ; %main_body
4164 ; GFX12-NEXT: ; return to shader part epilog
4166 %r = call <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i32(i32 0, i32 %mip, <8 x i32> %rsrc, i32 0, i32 0)
4171 define amdgpu_ps void @image_store_wait(<8 x i32> inreg %arg, <8 x i32> inreg %arg1, <8 x i32> inreg %arg2, <4 x float> %arg3, i32 %arg4) #0 {
4172 ; VERDE-LABEL: image_store_wait:
4173 ; VERDE: ; %bb.0: ; %main_body
4174 ; VERDE-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm
4175 ; VERDE-NEXT: s_waitcnt expcnt(0)
4176 ; VERDE-NEXT: image_load v[0:3], v4, s[8:15] dmask:0xf unorm
4177 ; VERDE-NEXT: s_waitcnt vmcnt(0)
4178 ; VERDE-NEXT: image_store v[0:3], v4, s[16:23] dmask:0xf unorm
4179 ; VERDE-NEXT: s_endpgm
4181 ; FIJI-LABEL: image_store_wait:
4182 ; FIJI: ; %bb.0: ; %main_body
4183 ; FIJI-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm
4184 ; FIJI-NEXT: image_load v[0:3], v4, s[8:15] dmask:0xf unorm
4185 ; FIJI-NEXT: s_waitcnt vmcnt(0)
4186 ; FIJI-NEXT: image_store v[0:3], v4, s[16:23] dmask:0xf unorm
4187 ; FIJI-NEXT: s_endpgm
4189 ; GFX6789-LABEL: image_store_wait:
4190 ; GFX6789: ; %bb.0: ; %main_body
4191 ; GFX6789-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm
4192 ; GFX6789-NEXT: image_load v[0:3], v4, s[8:15] dmask:0xf unorm
4193 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
4194 ; GFX6789-NEXT: image_store v[0:3], v4, s[16:23] dmask:0xf unorm
4195 ; GFX6789-NEXT: s_endpgm
4197 ; NOPRT-LABEL: image_store_wait:
4198 ; NOPRT: ; %bb.0: ; %main_body
4199 ; NOPRT-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf unorm
4200 ; NOPRT-NEXT: image_load v[0:3], v4, s[8:15] dmask:0xf unorm
4201 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
4202 ; NOPRT-NEXT: image_store v[0:3], v4, s[16:23] dmask:0xf unorm
4203 ; NOPRT-NEXT: s_endpgm
4205 ; GFX10-LABEL: image_store_wait:
4206 ; GFX10: ; %bb.0: ; %main_body
4207 ; GFX10-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
4208 ; GFX10-NEXT: image_load v[0:3], v4, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
4209 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4210 ; GFX10-NEXT: image_store v[0:3], v4, s[16:23] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
4211 ; GFX10-NEXT: s_endpgm
4213 ; GFX11-LABEL: image_store_wait:
4214 ; GFX11: ; %bb.0: ; %main_body
4215 ; GFX11-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
4216 ; GFX11-NEXT: image_load v[0:3], v4, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
4217 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4218 ; GFX11-NEXT: image_store v[0:3], v4, s[16:23] dmask:0xf dim:SQ_RSRC_IMG_1D unorm
4219 ; GFX11-NEXT: s_nop 0
4220 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
4221 ; GFX11-NEXT: s_endpgm
4223 ; GFX12-LABEL: image_store_wait:
4224 ; GFX12: ; %bb.0: ; %main_body
4225 ; GFX12-NEXT: image_store v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D
4226 ; GFX12-NEXT: image_load v[0:3], v4, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D
4227 ; GFX12-NEXT: s_wait_loadcnt 0x0
4228 ; GFX12-NEXT: image_store v[0:3], v4, s[16:23] dmask:0xf dim:SQ_RSRC_IMG_1D
4229 ; GFX12-NEXT: s_nop 0
4230 ; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
4231 ; GFX12-NEXT: s_endpgm
4233 call void @llvm.amdgcn.image.store.1d.v4f32.i32(<4 x float> %arg3, i32 15, i32 %arg4, <8 x i32> %arg, i32 0, i32 0)
4234 %data = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i32(i32 15, i32 %arg4, <8 x i32> %arg1, i32 0, i32 0)
4235 call void @llvm.amdgcn.image.store.1d.v4f32.i32(<4 x float> %data, i32 15, i32 %arg4, <8 x i32> %arg2, i32 0, i32 0)
4239 define amdgpu_ps float @image_load_mmo(<8 x i32> inreg %rsrc, ptr addrspace(3) %lds, <2 x i32> %c) #0 {
4240 ; VERDE-LABEL: image_load_mmo:
4242 ; VERDE-NEXT: image_load v1, v[1:2], s[0:7] dmask:0x1 unorm
4243 ; VERDE-NEXT: v_mov_b32_e32 v2, 0
4244 ; VERDE-NEXT: s_mov_b32 m0, -1
4245 ; VERDE-NEXT: ds_write_b32 v0, v2
4246 ; VERDE-NEXT: v_add_i32_e32 v0, vcc, 16, v0
4247 ; VERDE-NEXT: ds_write_b32 v0, v2
4248 ; VERDE-NEXT: s_waitcnt vmcnt(0)
4249 ; VERDE-NEXT: v_mov_b32_e32 v0, v1
4250 ; VERDE-NEXT: s_waitcnt lgkmcnt(0)
4251 ; VERDE-NEXT: ; return to shader part epilog
4253 ; FIJI-LABEL: image_load_mmo:
4255 ; FIJI-NEXT: image_load v1, v[1:2], s[0:7] dmask:0x1 unorm
4256 ; FIJI-NEXT: v_mov_b32_e32 v2, 0
4257 ; FIJI-NEXT: s_mov_b32 m0, -1
4258 ; FIJI-NEXT: ds_write2_b32 v0, v2, v2 offset1:4
4259 ; FIJI-NEXT: s_waitcnt vmcnt(0)
4260 ; FIJI-NEXT: v_mov_b32_e32 v0, v1
4261 ; FIJI-NEXT: s_waitcnt lgkmcnt(0)
4262 ; FIJI-NEXT: ; return to shader part epilog
4264 ; GFX6789-LABEL: image_load_mmo:
4266 ; GFX6789-NEXT: image_load v1, v[1:2], s[0:7] dmask:0x1 unorm
4267 ; GFX6789-NEXT: v_mov_b32_e32 v2, 0
4268 ; GFX6789-NEXT: ds_write2_b32 v0, v2, v2 offset1:4
4269 ; GFX6789-NEXT: s_waitcnt vmcnt(0)
4270 ; GFX6789-NEXT: v_mov_b32_e32 v0, v1
4271 ; GFX6789-NEXT: s_waitcnt lgkmcnt(0)
4272 ; GFX6789-NEXT: ; return to shader part epilog
4274 ; NOPRT-LABEL: image_load_mmo:
4276 ; NOPRT-NEXT: image_load v1, v[1:2], s[0:7] dmask:0x1 unorm
4277 ; NOPRT-NEXT: v_mov_b32_e32 v2, 0
4278 ; NOPRT-NEXT: ds_write2_b32 v0, v2, v2 offset1:4
4279 ; NOPRT-NEXT: s_waitcnt vmcnt(0)
4280 ; NOPRT-NEXT: v_mov_b32_e32 v0, v1
4281 ; NOPRT-NEXT: s_waitcnt lgkmcnt(0)
4282 ; NOPRT-NEXT: ; return to shader part epilog
4284 ; GFX10-LABEL: image_load_mmo:
4286 ; GFX10-NEXT: image_load v1, v[1:2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm
4287 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
4288 ; GFX10-NEXT: ds_write2_b32 v0, v2, v2 offset1:4
4289 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4290 ; GFX10-NEXT: v_mov_b32_e32 v0, v1
4291 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
4292 ; GFX10-NEXT: ; return to shader part epilog
4294 ; GFX11-LABEL: image_load_mmo:
4296 ; GFX11-NEXT: image_load v1, v[1:2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm
4297 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
4298 ; GFX11-NEXT: ds_store_2addr_b32 v0, v2, v2 offset1:4
4299 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4300 ; GFX11-NEXT: v_mov_b32_e32 v0, v1
4301 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
4302 ; GFX11-NEXT: ; return to shader part epilog
4304 ; GFX12-LABEL: image_load_mmo:
4306 ; GFX12-NEXT: image_load v1, [v1, v2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D
4307 ; GFX12-NEXT: v_mov_b32_e32 v2, 0
4308 ; GFX12-NEXT: ds_store_2addr_b32 v0, v2, v2 offset1:4
4309 ; GFX12-NEXT: s_wait_loadcnt 0x0
4310 ; GFX12-NEXT: v_mov_b32_e32 v0, v1
4311 ; GFX12-NEXT: s_wait_dscnt 0x0
4312 ; GFX12-NEXT: ; return to shader part epilog
4313 store float 0.000000e+00, ptr addrspace(3) %lds
4314 %c0 = extractelement <2 x i32> %c, i32 0
4315 %c1 = extractelement <2 x i32> %c, i32 1
4316 %tex = call float @llvm.amdgcn.image.load.2d.f32.i32(i32 1, i32 %c0, i32 %c1, <8 x i32> %rsrc, i32 0, i32 0)
4317 %tmp2 = getelementptr float, ptr addrspace(3) %lds, i32 4
4318 store float 0.000000e+00, ptr addrspace(3) %tmp2
4322 declare <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #1
4323 declare {float,i32} @llvm.amdgcn.image.load.1d.f32i32.i32(i32, i32, <8 x i32>, i32, i32) #1
4324 declare {<2 x float>,i32} @llvm.amdgcn.image.load.1d.v2f32i32.i32(i32, i32, <8 x i32>, i32, i32) #1
4325 declare {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32, i32, <8 x i32>, i32, i32) #1
4326 declare <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i32(i32, i32, i32, <8 x i32>, i32, i32) #1
4327 declare {<4 x float>,i32} @llvm.amdgcn.image.load.2d.v4f32i32.i32(i32, i32, i32, <8 x i32>, i32, i32) #1
4328 declare <4 x float> @llvm.amdgcn.image.load.3d.v4f32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4329 declare {<4 x float>,i32} @llvm.amdgcn.image.load.3d.v4f32i32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4330 declare <4 x float> @llvm.amdgcn.image.load.cube.v4f32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4331 declare {<4 x float>,i32} @llvm.amdgcn.image.load.cube.v4f32i32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4332 declare <4 x float> @llvm.amdgcn.image.load.1darray.v4f32.i32(i32, i32, i32, <8 x i32>, i32, i32) #1
4333 declare {<4 x float>,i32} @llvm.amdgcn.image.load.1darray.v4f32i32.i32(i32, i32, i32, <8 x i32>, i32, i32) #1
4334 declare <4 x float> @llvm.amdgcn.image.load.2darray.v4f32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4335 declare {<4 x float>,i32} @llvm.amdgcn.image.load.2darray.v4f32i32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4336 declare <4 x float> @llvm.amdgcn.image.load.2dmsaa.v4f32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4337 declare {<4 x float>,i32} @llvm.amdgcn.image.load.2dmsaa.v4f32i32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4338 declare <4 x float> @llvm.amdgcn.image.load.2darraymsaa.v4f32.i32(i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4339 declare {<4 x float>,i32} @llvm.amdgcn.image.load.2darraymsaa.v4f32i32.i32(i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4341 declare <4 x float> @llvm.amdgcn.image.load.mip.1d.v4f32.i32(i32, i32, i32, <8 x i32>, i32, i32) #1
4342 declare <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4343 declare {<4 x float>,i32} @llvm.amdgcn.image.load.mip.1d.v4f32i32.i32(i32, i32, i32, <8 x i32>, i32, i32) #1
4344 declare {<4 x float>,i32} @llvm.amdgcn.image.load.mip.2d.v4f32i32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4345 declare {<2 x float>,i32} @llvm.amdgcn.image.load.mip.2d.v2f32i32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4346 declare {float,i32} @llvm.amdgcn.image.load.mip.2d.f32i32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4347 declare <4 x float> @llvm.amdgcn.image.load.mip.3d.v4f32.i32(i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4348 declare <4 x float> @llvm.amdgcn.image.load.mip.cube.v4f32.i32(i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4349 declare <4 x float> @llvm.amdgcn.image.load.mip.1darray.v4f32.i32(i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4350 declare <4 x float> @llvm.amdgcn.image.load.mip.2darray.v4f32.i32(i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #1
4352 declare void @llvm.amdgcn.image.store.1d.v4f32.i32(<4 x float>, i32, i32, <8 x i32>, i32, i32) #0
4353 declare void @llvm.amdgcn.image.store.2d.v4f32.i32(<4 x float>, i32, i32, i32, <8 x i32>, i32, i32) #0
4354 declare void @llvm.amdgcn.image.store.3d.v4f32.i32(<4 x float>, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4355 declare void @llvm.amdgcn.image.store.cube.v4f32.i32(<4 x float>, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4356 declare void @llvm.amdgcn.image.store.1darray.v4f32.i32(<4 x float>, i32, i32, i32, <8 x i32>, i32, i32) #0
4357 declare void @llvm.amdgcn.image.store.2darray.v4f32.i32(<4 x float>, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4358 declare void @llvm.amdgcn.image.store.2dmsaa.v4f32.i32(<4 x float>, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4359 declare void @llvm.amdgcn.image.store.2darraymsaa.v4f32.i32(<4 x float>, i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4361 declare void @llvm.amdgcn.image.store.mip.1d.v4f32.i32(<4 x float>, i32, i32, i32, <8 x i32>, i32, i32) #0
4362 declare void @llvm.amdgcn.image.store.mip.2d.v4f32.i32(<4 x float>, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4363 declare void @llvm.amdgcn.image.store.mip.3d.v4f32.i32(<4 x float>, i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4364 declare void @llvm.amdgcn.image.store.mip.cube.v4f32.i32(<4 x float>, i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4365 declare void @llvm.amdgcn.image.store.mip.1darray.v4f32.i32(<4 x float>, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4366 declare void @llvm.amdgcn.image.store.mip.2darray.v4f32.i32(<4 x float>, i32, i32, i32, i32, i32, <8 x i32>, i32, i32) #0
4368 declare <4 x float> @llvm.amdgcn.image.getresinfo.1d.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
4369 declare <3 x float> @llvm.amdgcn.image.getresinfo.1d.v3f32.i32(i32 immarg, i32, <8 x i32>, i32 immarg, i32 immarg) #1
4370 declare <2 x float> @llvm.amdgcn.image.getresinfo.1d.v2f32.i32(i32 immarg, i32, <8 x i32>, i32 immarg, i32 immarg) #1
4371 declare float @llvm.amdgcn.image.getresinfo.1d.f32.i32(i32 immarg, i32, <8 x i32>, i32 immarg, i32 immarg) #1
4372 declare <4 x float> @llvm.amdgcn.image.getresinfo.2d.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
4373 declare <4 x float> @llvm.amdgcn.image.getresinfo.3d.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
4374 declare <4 x float> @llvm.amdgcn.image.getresinfo.cube.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
4375 declare <4 x float> @llvm.amdgcn.image.getresinfo.1darray.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
4376 declare <4 x float> @llvm.amdgcn.image.getresinfo.2darray.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
4377 declare <4 x float> @llvm.amdgcn.image.getresinfo.2dmsaa.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
4378 declare <4 x float> @llvm.amdgcn.image.getresinfo.2darraymsaa.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
4380 declare float @llvm.amdgcn.image.load.1d.f32.i32(i32, i32, <8 x i32>, i32, i32) #1
4381 declare float @llvm.amdgcn.image.load.2d.f32.i32(i32, i32, i32, <8 x i32>, i32, i32) #1
4382 declare <2 x float> @llvm.amdgcn.image.load.1d.v2f32.i32(i32, i32, <8 x i32>, i32, i32) #1
4383 declare void @llvm.amdgcn.image.store.1d.f32.i32(float, i32, i32, <8 x i32>, i32, i32) #0
4384 declare void @llvm.amdgcn.image.store.1d.v2f32.i32(<2 x float>, i32, i32, <8 x i32>, i32, i32) #0
4386 attributes #0 = { nounwind }
4387 attributes #1 = { nounwind readonly }
4388 attributes #2 = { nounwind readnone }