1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX9 %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10 %s
4 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11 %s
5 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX12 %s
7 define amdgpu_ps void @store_f32_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <4 x float> %val) {
8 ; GFX9-LABEL: store_f32_1d:
9 ; GFX9: ; %bb.0: ; %main_body
10 ; GFX9-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x1 unorm a16
13 ; GFX10-LABEL: store_f32_1d:
14 ; GFX10: ; %bb.0: ; %main_body
15 ; GFX10-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm a16
16 ; GFX10-NEXT: s_endpgm
18 ; GFX11-LABEL: store_f32_1d:
19 ; GFX11: ; %bb.0: ; %main_body
20 ; GFX11-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm a16
21 ; GFX11-NEXT: s_endpgm
23 ; GFX12-LABEL: store_f32_1d:
24 ; GFX12: ; %bb.0: ; %main_body
25 ; GFX12-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D a16
26 ; GFX12-NEXT: s_endpgm
28 %x = extractelement <2 x i16> %coords, i32 0
29 call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %val, i32 1, i16 %x, <8 x i32> %rsrc, i32 0, i32 0)
33 define amdgpu_ps void @store_v2f32_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <4 x float> %val) {
34 ; GFX9-LABEL: store_v2f32_1d:
35 ; GFX9: ; %bb.0: ; %main_body
36 ; GFX9-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x3 unorm a16
39 ; GFX10-LABEL: store_v2f32_1d:
40 ; GFX10: ; %bb.0: ; %main_body
41 ; GFX10-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm a16
42 ; GFX10-NEXT: s_endpgm
44 ; GFX11-LABEL: store_v2f32_1d:
45 ; GFX11: ; %bb.0: ; %main_body
46 ; GFX11-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm a16
47 ; GFX11-NEXT: s_endpgm
49 ; GFX12-LABEL: store_v2f32_1d:
50 ; GFX12: ; %bb.0: ; %main_body
51 ; GFX12-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D a16
52 ; GFX12-NEXT: s_endpgm
54 %x = extractelement <2 x i16> %coords, i32 0
55 call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %val, i32 3, i16 %x, <8 x i32> %rsrc, i32 0, i32 0)
59 define amdgpu_ps void @store_v3f32_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <4 x float> %val) {
60 ; GFX9-LABEL: store_v3f32_1d:
61 ; GFX9: ; %bb.0: ; %main_body
62 ; GFX9-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x7 unorm a16
65 ; GFX10-LABEL: store_v3f32_1d:
66 ; GFX10: ; %bb.0: ; %main_body
67 ; GFX10-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D unorm a16
68 ; GFX10-NEXT: s_endpgm
70 ; GFX11-LABEL: store_v3f32_1d:
71 ; GFX11: ; %bb.0: ; %main_body
72 ; GFX11-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D unorm a16
73 ; GFX11-NEXT: s_endpgm
75 ; GFX12-LABEL: store_v3f32_1d:
76 ; GFX12: ; %bb.0: ; %main_body
77 ; GFX12-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_1D a16
78 ; GFX12-NEXT: s_endpgm
80 %x = extractelement <2 x i16> %coords, i32 0
81 call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %val, i32 7, i16 %x, <8 x i32> %rsrc, i32 0, i32 0)
85 define amdgpu_ps void @store_v4f32_1d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <4 x float> %val) {
86 ; GFX9-LABEL: store_v4f32_1d:
87 ; GFX9: ; %bb.0: ; %main_body
88 ; GFX9-NEXT: image_store v[1:4], v0, s[0:7] dmask:0xf unorm a16
91 ; GFX10-LABEL: store_v4f32_1d:
92 ; GFX10: ; %bb.0: ; %main_body
93 ; GFX10-NEXT: image_store v[1:4], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16
94 ; GFX10-NEXT: s_endpgm
96 ; GFX11-LABEL: store_v4f32_1d:
97 ; GFX11: ; %bb.0: ; %main_body
98 ; GFX11-NEXT: image_store v[1:4], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm a16
99 ; GFX11-NEXT: s_endpgm
101 ; GFX12-LABEL: store_v4f32_1d:
102 ; GFX12: ; %bb.0: ; %main_body
103 ; GFX12-NEXT: image_store v[1:4], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D a16
104 ; GFX12-NEXT: s_endpgm
106 %x = extractelement <2 x i16> %coords, i32 0
107 call void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float> %val, i32 15, i16 %x, <8 x i32> %rsrc, i32 0, i32 0)
111 define amdgpu_ps void @store_f32_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <4 x float> %val) {
112 ; GFX9-LABEL: store_f32_2d:
113 ; GFX9: ; %bb.0: ; %main_body
114 ; GFX9-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x1 unorm a16
115 ; GFX9-NEXT: s_endpgm
117 ; GFX10-LABEL: store_f32_2d:
118 ; GFX10: ; %bb.0: ; %main_body
119 ; GFX10-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm a16
120 ; GFX10-NEXT: s_endpgm
122 ; GFX11-LABEL: store_f32_2d:
123 ; GFX11: ; %bb.0: ; %main_body
124 ; GFX11-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm a16
125 ; GFX11-NEXT: s_endpgm
127 ; GFX12-LABEL: store_f32_2d:
128 ; GFX12: ; %bb.0: ; %main_body
129 ; GFX12-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D a16
130 ; GFX12-NEXT: s_endpgm
132 %x = extractelement <2 x i16> %coords, i32 0
133 %y = extractelement <2 x i16> %coords, i32 1
134 call void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float> %val, i32 1, i16 %x, i16 %y, <8 x i32> %rsrc, i32 0, i32 0)
138 define amdgpu_ps void @store_v2f32_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <4 x float> %val) {
139 ; GFX9-LABEL: store_v2f32_2d:
140 ; GFX9: ; %bb.0: ; %main_body
141 ; GFX9-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x3 unorm a16
142 ; GFX9-NEXT: s_endpgm
144 ; GFX10-LABEL: store_v2f32_2d:
145 ; GFX10: ; %bb.0: ; %main_body
146 ; GFX10-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D unorm a16
147 ; GFX10-NEXT: s_endpgm
149 ; GFX11-LABEL: store_v2f32_2d:
150 ; GFX11: ; %bb.0: ; %main_body
151 ; GFX11-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D unorm a16
152 ; GFX11-NEXT: s_endpgm
154 ; GFX12-LABEL: store_v2f32_2d:
155 ; GFX12: ; %bb.0: ; %main_body
156 ; GFX12-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D a16
157 ; GFX12-NEXT: s_endpgm
159 %x = extractelement <2 x i16> %coords, i32 0
160 %y = extractelement <2 x i16> %coords, i32 1
161 call void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float> %val, i32 3, i16 %x, i16 %y, <8 x i32> %rsrc, i32 0, i32 0)
165 define amdgpu_ps void @store_v3f32_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <4 x float> %val) {
166 ; GFX9-LABEL: store_v3f32_2d:
167 ; GFX9: ; %bb.0: ; %main_body
168 ; GFX9-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x7 unorm a16
169 ; GFX9-NEXT: s_endpgm
171 ; GFX10-LABEL: store_v3f32_2d:
172 ; GFX10: ; %bb.0: ; %main_body
173 ; GFX10-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_2D unorm a16
174 ; GFX10-NEXT: s_endpgm
176 ; GFX11-LABEL: store_v3f32_2d:
177 ; GFX11: ; %bb.0: ; %main_body
178 ; GFX11-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_2D unorm a16
179 ; GFX11-NEXT: s_endpgm
181 ; GFX12-LABEL: store_v3f32_2d:
182 ; GFX12: ; %bb.0: ; %main_body
183 ; GFX12-NEXT: image_store v[1:4], v0, s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_2D a16
184 ; GFX12-NEXT: s_endpgm
186 %x = extractelement <2 x i16> %coords, i32 0
187 %y = extractelement <2 x i16> %coords, i32 1
188 call void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float> %val, i32 7, i16 %x, i16 %y, <8 x i32> %rsrc, i32 0, i32 0)
192 define amdgpu_ps void @store_v4f32_2d(<8 x i32> inreg %rsrc, <2 x i16> %coords, <4 x float> %val) {
193 ; GFX9-LABEL: store_v4f32_2d:
194 ; GFX9: ; %bb.0: ; %main_body
195 ; GFX9-NEXT: image_store v[1:4], v0, s[0:7] dmask:0xf unorm a16
196 ; GFX9-NEXT: s_endpgm
198 ; GFX10-LABEL: store_v4f32_2d:
199 ; GFX10: ; %bb.0: ; %main_body
200 ; GFX10-NEXT: image_store v[1:4], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16
201 ; GFX10-NEXT: s_endpgm
203 ; GFX11-LABEL: store_v4f32_2d:
204 ; GFX11: ; %bb.0: ; %main_body
205 ; GFX11-NEXT: image_store v[1:4], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm a16
206 ; GFX11-NEXT: s_endpgm
208 ; GFX12-LABEL: store_v4f32_2d:
209 ; GFX12: ; %bb.0: ; %main_body
210 ; GFX12-NEXT: image_store v[1:4], v0, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D a16
211 ; GFX12-NEXT: s_endpgm
213 %x = extractelement <2 x i16> %coords, i32 0
214 %y = extractelement <2 x i16> %coords, i32 1
215 call void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float> %val, i32 15, i16 %x, i16 %y, <8 x i32> %rsrc, i32 0, i32 0)
219 define amdgpu_ps void @store_f32_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi, <4 x float> %val) {
220 ; GFX9-LABEL: store_f32_3d:
221 ; GFX9: ; %bb.0: ; %main_body
222 ; GFX9-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x1 unorm a16
223 ; GFX9-NEXT: s_endpgm
225 ; GFX10-LABEL: store_f32_3d:
226 ; GFX10: ; %bb.0: ; %main_body
227 ; GFX10-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_3D unorm a16
228 ; GFX10-NEXT: s_endpgm
230 ; GFX11-LABEL: store_f32_3d:
231 ; GFX11: ; %bb.0: ; %main_body
232 ; GFX11-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_3D unorm a16
233 ; GFX11-NEXT: s_endpgm
235 ; GFX12-LABEL: store_f32_3d:
236 ; GFX12: ; %bb.0: ; %main_body
237 ; GFX12-NEXT: image_store v[2:5], [v0, v1], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_3D a16
238 ; GFX12-NEXT: s_endpgm
240 %x = extractelement <2 x i16> %coords_lo, i32 0
241 %y = extractelement <2 x i16> %coords_lo, i32 1
242 %z = extractelement <2 x i16> %coords_hi, i32 0
243 call void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float> %val, i32 1, i16 %x, i16 %y, i16 %z, <8 x i32> %rsrc, i32 0, i32 0)
247 define amdgpu_ps void @store_v2f32_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi, <4 x float> %val) {
248 ; GFX9-LABEL: store_v2f32_3d:
249 ; GFX9: ; %bb.0: ; %main_body
250 ; GFX9-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x3 unorm a16
251 ; GFX9-NEXT: s_endpgm
253 ; GFX10-LABEL: store_v2f32_3d:
254 ; GFX10: ; %bb.0: ; %main_body
255 ; GFX10-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_3D unorm a16
256 ; GFX10-NEXT: s_endpgm
258 ; GFX11-LABEL: store_v2f32_3d:
259 ; GFX11: ; %bb.0: ; %main_body
260 ; GFX11-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_3D unorm a16
261 ; GFX11-NEXT: s_endpgm
263 ; GFX12-LABEL: store_v2f32_3d:
264 ; GFX12: ; %bb.0: ; %main_body
265 ; GFX12-NEXT: image_store v[2:5], [v0, v1], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_3D a16
266 ; GFX12-NEXT: s_endpgm
268 %x = extractelement <2 x i16> %coords_lo, i32 0
269 %y = extractelement <2 x i16> %coords_lo, i32 1
270 %z = extractelement <2 x i16> %coords_hi, i32 0
271 call void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float> %val, i32 3, i16 %x, i16 %y, i16 %z, <8 x i32> %rsrc, i32 0, i32 0)
275 define amdgpu_ps void @store_v3f32_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi, <4 x float> %val) {
276 ; GFX9-LABEL: store_v3f32_3d:
277 ; GFX9: ; %bb.0: ; %main_body
278 ; GFX9-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x7 unorm a16
279 ; GFX9-NEXT: s_endpgm
281 ; GFX10-LABEL: store_v3f32_3d:
282 ; GFX10: ; %bb.0: ; %main_body
283 ; GFX10-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_3D unorm a16
284 ; GFX10-NEXT: s_endpgm
286 ; GFX11-LABEL: store_v3f32_3d:
287 ; GFX11: ; %bb.0: ; %main_body
288 ; GFX11-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_3D unorm a16
289 ; GFX11-NEXT: s_endpgm
291 ; GFX12-LABEL: store_v3f32_3d:
292 ; GFX12: ; %bb.0: ; %main_body
293 ; GFX12-NEXT: image_store v[2:5], [v0, v1], s[0:7] dmask:0x7 dim:SQ_RSRC_IMG_3D a16
294 ; GFX12-NEXT: s_endpgm
296 %x = extractelement <2 x i16> %coords_lo, i32 0
297 %y = extractelement <2 x i16> %coords_lo, i32 1
298 %z = extractelement <2 x i16> %coords_hi, i32 0
299 call void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float> %val, i32 7, i16 %x, i16 %y, i16 %z, <8 x i32> %rsrc, i32 0, i32 0)
303 define amdgpu_ps void @store_v4f32_3d(<8 x i32> inreg %rsrc, <2 x i16> %coords_lo, <2 x i16> %coords_hi, <4 x float> %val) {
304 ; GFX9-LABEL: store_v4f32_3d:
305 ; GFX9: ; %bb.0: ; %main_body
306 ; GFX9-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0xf unorm a16
307 ; GFX9-NEXT: s_endpgm
309 ; GFX10-LABEL: store_v4f32_3d:
310 ; GFX10: ; %bb.0: ; %main_body
311 ; GFX10-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16
312 ; GFX10-NEXT: s_endpgm
314 ; GFX11-LABEL: store_v4f32_3d:
315 ; GFX11: ; %bb.0: ; %main_body
316 ; GFX11-NEXT: image_store v[2:5], v[0:1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D unorm a16
317 ; GFX11-NEXT: s_endpgm
319 ; GFX12-LABEL: store_v4f32_3d:
320 ; GFX12: ; %bb.0: ; %main_body
321 ; GFX12-NEXT: image_store v[2:5], [v0, v1], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_3D a16
322 ; GFX12-NEXT: s_endpgm
324 %x = extractelement <2 x i16> %coords_lo, i32 0
325 %y = extractelement <2 x i16> %coords_lo, i32 1
326 %z = extractelement <2 x i16> %coords_hi, i32 0
327 call void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float> %val, i32 15, i16 %x, i16 %y, i16 %z, <8 x i32> %rsrc, i32 0, i32 0)
331 declare void @llvm.amdgcn.image.store.1d.v4f32.i16(<4 x float>, i32, i16, <8 x i32>, i32, i32) #2
332 declare void @llvm.amdgcn.image.store.2d.v4f32.i16(<4 x float>, i32, i16, i16, <8 x i32>, i32, i32) #2
333 declare void @llvm.amdgcn.image.store.3d.v4f32.i16(<4 x float>, i32, i16, i16, i16, <8 x i32>, i32, i32) #2
335 attributes #0 = { nounwind }
336 attributes #1 = { nounwind readonly }