1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -o - %s | FileCheck -check-prefix=GFX9 %s
3 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 -o - %s | FileCheck -check-prefix=GFX10 %s
4 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 -o - %s | FileCheck -check-prefix=GFX10 %s
6 define amdgpu_ps float @atomic_swap_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
7 ; GFX9-LABEL: atomic_swap_i32_1d:
8 ; GFX9: ; %bb.0: ; %main_body
9 ; GFX9-NEXT: s_mov_b32 s0, s2
10 ; GFX9-NEXT: s_mov_b32 s1, s3
11 ; GFX9-NEXT: s_mov_b32 s2, s4
12 ; GFX9-NEXT: s_mov_b32 s3, s5
13 ; GFX9-NEXT: s_mov_b32 s4, s6
14 ; GFX9-NEXT: s_mov_b32 s5, s7
15 ; GFX9-NEXT: s_mov_b32 s6, s8
16 ; GFX9-NEXT: s_mov_b32 s7, s9
17 ; GFX9-NEXT: image_atomic_swap v0, v1, s[0:7] dmask:0x1 unorm glc a16
18 ; GFX9-NEXT: s_waitcnt vmcnt(0)
19 ; GFX9-NEXT: ; return to shader part epilog
21 ; GFX10-LABEL: atomic_swap_i32_1d:
22 ; GFX10: ; %bb.0: ; %main_body
23 ; GFX10-NEXT: s_mov_b32 s0, s2
24 ; GFX10-NEXT: s_mov_b32 s1, s3
25 ; GFX10-NEXT: s_mov_b32 s2, s4
26 ; GFX10-NEXT: s_mov_b32 s3, s5
27 ; GFX10-NEXT: s_mov_b32 s4, s6
28 ; GFX10-NEXT: s_mov_b32 s5, s7
29 ; GFX10-NEXT: s_mov_b32 s6, s8
30 ; GFX10-NEXT: s_mov_b32 s7, s9
31 ; GFX10-NEXT: image_atomic_swap v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
32 ; GFX10-NEXT: s_waitcnt vmcnt(0)
33 ; GFX10-NEXT: ; return to shader part epilog
35 %v = call i32 @llvm.amdgcn.image.atomic.swap.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
36 %out = bitcast i32 %v to float
40 define amdgpu_ps float @atomic_add_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
41 ; GFX9-LABEL: atomic_add_i32_1d:
42 ; GFX9: ; %bb.0: ; %main_body
43 ; GFX9-NEXT: s_mov_b32 s0, s2
44 ; GFX9-NEXT: s_mov_b32 s1, s3
45 ; GFX9-NEXT: s_mov_b32 s2, s4
46 ; GFX9-NEXT: s_mov_b32 s3, s5
47 ; GFX9-NEXT: s_mov_b32 s4, s6
48 ; GFX9-NEXT: s_mov_b32 s5, s7
49 ; GFX9-NEXT: s_mov_b32 s6, s8
50 ; GFX9-NEXT: s_mov_b32 s7, s9
51 ; GFX9-NEXT: image_atomic_add v0, v1, s[0:7] dmask:0x1 unorm glc a16
52 ; GFX9-NEXT: s_waitcnt vmcnt(0)
53 ; GFX9-NEXT: ; return to shader part epilog
55 ; GFX10-LABEL: atomic_add_i32_1d:
56 ; GFX10: ; %bb.0: ; %main_body
57 ; GFX10-NEXT: s_mov_b32 s0, s2
58 ; GFX10-NEXT: s_mov_b32 s1, s3
59 ; GFX10-NEXT: s_mov_b32 s2, s4
60 ; GFX10-NEXT: s_mov_b32 s3, s5
61 ; GFX10-NEXT: s_mov_b32 s4, s6
62 ; GFX10-NEXT: s_mov_b32 s5, s7
63 ; GFX10-NEXT: s_mov_b32 s6, s8
64 ; GFX10-NEXT: s_mov_b32 s7, s9
65 ; GFX10-NEXT: image_atomic_add v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
66 ; GFX10-NEXT: s_waitcnt vmcnt(0)
67 ; GFX10-NEXT: ; return to shader part epilog
69 %v = call i32 @llvm.amdgcn.image.atomic.add.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
70 %out = bitcast i32 %v to float
74 define amdgpu_ps float @atomic_sub_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
75 ; GFX9-LABEL: atomic_sub_i32_1d:
76 ; GFX9: ; %bb.0: ; %main_body
77 ; GFX9-NEXT: s_mov_b32 s0, s2
78 ; GFX9-NEXT: s_mov_b32 s1, s3
79 ; GFX9-NEXT: s_mov_b32 s2, s4
80 ; GFX9-NEXT: s_mov_b32 s3, s5
81 ; GFX9-NEXT: s_mov_b32 s4, s6
82 ; GFX9-NEXT: s_mov_b32 s5, s7
83 ; GFX9-NEXT: s_mov_b32 s6, s8
84 ; GFX9-NEXT: s_mov_b32 s7, s9
85 ; GFX9-NEXT: image_atomic_sub v0, v1, s[0:7] dmask:0x1 unorm glc a16
86 ; GFX9-NEXT: s_waitcnt vmcnt(0)
87 ; GFX9-NEXT: ; return to shader part epilog
89 ; GFX10-LABEL: atomic_sub_i32_1d:
90 ; GFX10: ; %bb.0: ; %main_body
91 ; GFX10-NEXT: s_mov_b32 s0, s2
92 ; GFX10-NEXT: s_mov_b32 s1, s3
93 ; GFX10-NEXT: s_mov_b32 s2, s4
94 ; GFX10-NEXT: s_mov_b32 s3, s5
95 ; GFX10-NEXT: s_mov_b32 s4, s6
96 ; GFX10-NEXT: s_mov_b32 s5, s7
97 ; GFX10-NEXT: s_mov_b32 s6, s8
98 ; GFX10-NEXT: s_mov_b32 s7, s9
99 ; GFX10-NEXT: image_atomic_sub v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
100 ; GFX10-NEXT: s_waitcnt vmcnt(0)
101 ; GFX10-NEXT: ; return to shader part epilog
103 %v = call i32 @llvm.amdgcn.image.atomic.sub.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
104 %out = bitcast i32 %v to float
108 define amdgpu_ps float @atomic_smin_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
109 ; GFX9-LABEL: atomic_smin_i32_1d:
110 ; GFX9: ; %bb.0: ; %main_body
111 ; GFX9-NEXT: s_mov_b32 s0, s2
112 ; GFX9-NEXT: s_mov_b32 s1, s3
113 ; GFX9-NEXT: s_mov_b32 s2, s4
114 ; GFX9-NEXT: s_mov_b32 s3, s5
115 ; GFX9-NEXT: s_mov_b32 s4, s6
116 ; GFX9-NEXT: s_mov_b32 s5, s7
117 ; GFX9-NEXT: s_mov_b32 s6, s8
118 ; GFX9-NEXT: s_mov_b32 s7, s9
119 ; GFX9-NEXT: image_atomic_smin v0, v1, s[0:7] dmask:0x1 unorm glc a16
120 ; GFX9-NEXT: s_waitcnt vmcnt(0)
121 ; GFX9-NEXT: ; return to shader part epilog
123 ; GFX10-LABEL: atomic_smin_i32_1d:
124 ; GFX10: ; %bb.0: ; %main_body
125 ; GFX10-NEXT: s_mov_b32 s0, s2
126 ; GFX10-NEXT: s_mov_b32 s1, s3
127 ; GFX10-NEXT: s_mov_b32 s2, s4
128 ; GFX10-NEXT: s_mov_b32 s3, s5
129 ; GFX10-NEXT: s_mov_b32 s4, s6
130 ; GFX10-NEXT: s_mov_b32 s5, s7
131 ; GFX10-NEXT: s_mov_b32 s6, s8
132 ; GFX10-NEXT: s_mov_b32 s7, s9
133 ; GFX10-NEXT: image_atomic_smin v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
134 ; GFX10-NEXT: s_waitcnt vmcnt(0)
135 ; GFX10-NEXT: ; return to shader part epilog
137 %v = call i32 @llvm.amdgcn.image.atomic.smin.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
138 %out = bitcast i32 %v to float
142 define amdgpu_ps float @atomic_umin_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
143 ; GFX9-LABEL: atomic_umin_i32_1d:
144 ; GFX9: ; %bb.0: ; %main_body
145 ; GFX9-NEXT: s_mov_b32 s0, s2
146 ; GFX9-NEXT: s_mov_b32 s1, s3
147 ; GFX9-NEXT: s_mov_b32 s2, s4
148 ; GFX9-NEXT: s_mov_b32 s3, s5
149 ; GFX9-NEXT: s_mov_b32 s4, s6
150 ; GFX9-NEXT: s_mov_b32 s5, s7
151 ; GFX9-NEXT: s_mov_b32 s6, s8
152 ; GFX9-NEXT: s_mov_b32 s7, s9
153 ; GFX9-NEXT: image_atomic_umin v0, v1, s[0:7] dmask:0x1 unorm glc a16
154 ; GFX9-NEXT: s_waitcnt vmcnt(0)
155 ; GFX9-NEXT: ; return to shader part epilog
157 ; GFX10-LABEL: atomic_umin_i32_1d:
158 ; GFX10: ; %bb.0: ; %main_body
159 ; GFX10-NEXT: s_mov_b32 s0, s2
160 ; GFX10-NEXT: s_mov_b32 s1, s3
161 ; GFX10-NEXT: s_mov_b32 s2, s4
162 ; GFX10-NEXT: s_mov_b32 s3, s5
163 ; GFX10-NEXT: s_mov_b32 s4, s6
164 ; GFX10-NEXT: s_mov_b32 s5, s7
165 ; GFX10-NEXT: s_mov_b32 s6, s8
166 ; GFX10-NEXT: s_mov_b32 s7, s9
167 ; GFX10-NEXT: image_atomic_umin v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
168 ; GFX10-NEXT: s_waitcnt vmcnt(0)
169 ; GFX10-NEXT: ; return to shader part epilog
171 %v = call i32 @llvm.amdgcn.image.atomic.umin.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
172 %out = bitcast i32 %v to float
176 define amdgpu_ps float @atomic_smax_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
177 ; GFX9-LABEL: atomic_smax_i32_1d:
178 ; GFX9: ; %bb.0: ; %main_body
179 ; GFX9-NEXT: s_mov_b32 s0, s2
180 ; GFX9-NEXT: s_mov_b32 s1, s3
181 ; GFX9-NEXT: s_mov_b32 s2, s4
182 ; GFX9-NEXT: s_mov_b32 s3, s5
183 ; GFX9-NEXT: s_mov_b32 s4, s6
184 ; GFX9-NEXT: s_mov_b32 s5, s7
185 ; GFX9-NEXT: s_mov_b32 s6, s8
186 ; GFX9-NEXT: s_mov_b32 s7, s9
187 ; GFX9-NEXT: image_atomic_smax v0, v1, s[0:7] dmask:0x1 unorm glc a16
188 ; GFX9-NEXT: s_waitcnt vmcnt(0)
189 ; GFX9-NEXT: ; return to shader part epilog
191 ; GFX10-LABEL: atomic_smax_i32_1d:
192 ; GFX10: ; %bb.0: ; %main_body
193 ; GFX10-NEXT: s_mov_b32 s0, s2
194 ; GFX10-NEXT: s_mov_b32 s1, s3
195 ; GFX10-NEXT: s_mov_b32 s2, s4
196 ; GFX10-NEXT: s_mov_b32 s3, s5
197 ; GFX10-NEXT: s_mov_b32 s4, s6
198 ; GFX10-NEXT: s_mov_b32 s5, s7
199 ; GFX10-NEXT: s_mov_b32 s6, s8
200 ; GFX10-NEXT: s_mov_b32 s7, s9
201 ; GFX10-NEXT: image_atomic_smax v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
202 ; GFX10-NEXT: s_waitcnt vmcnt(0)
203 ; GFX10-NEXT: ; return to shader part epilog
205 %v = call i32 @llvm.amdgcn.image.atomic.smax.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
206 %out = bitcast i32 %v to float
210 define amdgpu_ps float @atomic_umax_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
211 ; GFX9-LABEL: atomic_umax_i32_1d:
212 ; GFX9: ; %bb.0: ; %main_body
213 ; GFX9-NEXT: s_mov_b32 s0, s2
214 ; GFX9-NEXT: s_mov_b32 s1, s3
215 ; GFX9-NEXT: s_mov_b32 s2, s4
216 ; GFX9-NEXT: s_mov_b32 s3, s5
217 ; GFX9-NEXT: s_mov_b32 s4, s6
218 ; GFX9-NEXT: s_mov_b32 s5, s7
219 ; GFX9-NEXT: s_mov_b32 s6, s8
220 ; GFX9-NEXT: s_mov_b32 s7, s9
221 ; GFX9-NEXT: image_atomic_umax v0, v1, s[0:7] dmask:0x1 unorm glc a16
222 ; GFX9-NEXT: s_waitcnt vmcnt(0)
223 ; GFX9-NEXT: ; return to shader part epilog
225 ; GFX10-LABEL: atomic_umax_i32_1d:
226 ; GFX10: ; %bb.0: ; %main_body
227 ; GFX10-NEXT: s_mov_b32 s0, s2
228 ; GFX10-NEXT: s_mov_b32 s1, s3
229 ; GFX10-NEXT: s_mov_b32 s2, s4
230 ; GFX10-NEXT: s_mov_b32 s3, s5
231 ; GFX10-NEXT: s_mov_b32 s4, s6
232 ; GFX10-NEXT: s_mov_b32 s5, s7
233 ; GFX10-NEXT: s_mov_b32 s6, s8
234 ; GFX10-NEXT: s_mov_b32 s7, s9
235 ; GFX10-NEXT: image_atomic_umax v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
236 ; GFX10-NEXT: s_waitcnt vmcnt(0)
237 ; GFX10-NEXT: ; return to shader part epilog
239 %v = call i32 @llvm.amdgcn.image.atomic.umax.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
240 %out = bitcast i32 %v to float
244 define amdgpu_ps float @atomic_and_i321d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
245 ; GFX9-LABEL: atomic_and_i321d:
246 ; GFX9: ; %bb.0: ; %main_body
247 ; GFX9-NEXT: s_mov_b32 s0, s2
248 ; GFX9-NEXT: s_mov_b32 s1, s3
249 ; GFX9-NEXT: s_mov_b32 s2, s4
250 ; GFX9-NEXT: s_mov_b32 s3, s5
251 ; GFX9-NEXT: s_mov_b32 s4, s6
252 ; GFX9-NEXT: s_mov_b32 s5, s7
253 ; GFX9-NEXT: s_mov_b32 s6, s8
254 ; GFX9-NEXT: s_mov_b32 s7, s9
255 ; GFX9-NEXT: image_atomic_and v0, v1, s[0:7] dmask:0x1 unorm glc a16
256 ; GFX9-NEXT: s_waitcnt vmcnt(0)
257 ; GFX9-NEXT: ; return to shader part epilog
259 ; GFX10-LABEL: atomic_and_i321d:
260 ; GFX10: ; %bb.0: ; %main_body
261 ; GFX10-NEXT: s_mov_b32 s0, s2
262 ; GFX10-NEXT: s_mov_b32 s1, s3
263 ; GFX10-NEXT: s_mov_b32 s2, s4
264 ; GFX10-NEXT: s_mov_b32 s3, s5
265 ; GFX10-NEXT: s_mov_b32 s4, s6
266 ; GFX10-NEXT: s_mov_b32 s5, s7
267 ; GFX10-NEXT: s_mov_b32 s6, s8
268 ; GFX10-NEXT: s_mov_b32 s7, s9
269 ; GFX10-NEXT: image_atomic_and v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
270 ; GFX10-NEXT: s_waitcnt vmcnt(0)
271 ; GFX10-NEXT: ; return to shader part epilog
273 %v = call i32 @llvm.amdgcn.image.atomic.and.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
274 %out = bitcast i32 %v to float
278 define amdgpu_ps float @atomic_or_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
279 ; GFX9-LABEL: atomic_or_i32_1d:
280 ; GFX9: ; %bb.0: ; %main_body
281 ; GFX9-NEXT: s_mov_b32 s0, s2
282 ; GFX9-NEXT: s_mov_b32 s1, s3
283 ; GFX9-NEXT: s_mov_b32 s2, s4
284 ; GFX9-NEXT: s_mov_b32 s3, s5
285 ; GFX9-NEXT: s_mov_b32 s4, s6
286 ; GFX9-NEXT: s_mov_b32 s5, s7
287 ; GFX9-NEXT: s_mov_b32 s6, s8
288 ; GFX9-NEXT: s_mov_b32 s7, s9
289 ; GFX9-NEXT: image_atomic_or v0, v1, s[0:7] dmask:0x1 unorm glc a16
290 ; GFX9-NEXT: s_waitcnt vmcnt(0)
291 ; GFX9-NEXT: ; return to shader part epilog
293 ; GFX10-LABEL: atomic_or_i32_1d:
294 ; GFX10: ; %bb.0: ; %main_body
295 ; GFX10-NEXT: s_mov_b32 s0, s2
296 ; GFX10-NEXT: s_mov_b32 s1, s3
297 ; GFX10-NEXT: s_mov_b32 s2, s4
298 ; GFX10-NEXT: s_mov_b32 s3, s5
299 ; GFX10-NEXT: s_mov_b32 s4, s6
300 ; GFX10-NEXT: s_mov_b32 s5, s7
301 ; GFX10-NEXT: s_mov_b32 s6, s8
302 ; GFX10-NEXT: s_mov_b32 s7, s9
303 ; GFX10-NEXT: image_atomic_or v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
304 ; GFX10-NEXT: s_waitcnt vmcnt(0)
305 ; GFX10-NEXT: ; return to shader part epilog
307 %v = call i32 @llvm.amdgcn.image.atomic.or.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
308 %out = bitcast i32 %v to float
312 define amdgpu_ps float @atomic_xor_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
313 ; GFX9-LABEL: atomic_xor_i32_1d:
314 ; GFX9: ; %bb.0: ; %main_body
315 ; GFX9-NEXT: s_mov_b32 s0, s2
316 ; GFX9-NEXT: s_mov_b32 s1, s3
317 ; GFX9-NEXT: s_mov_b32 s2, s4
318 ; GFX9-NEXT: s_mov_b32 s3, s5
319 ; GFX9-NEXT: s_mov_b32 s4, s6
320 ; GFX9-NEXT: s_mov_b32 s5, s7
321 ; GFX9-NEXT: s_mov_b32 s6, s8
322 ; GFX9-NEXT: s_mov_b32 s7, s9
323 ; GFX9-NEXT: image_atomic_xor v0, v1, s[0:7] dmask:0x1 unorm glc a16
324 ; GFX9-NEXT: s_waitcnt vmcnt(0)
325 ; GFX9-NEXT: ; return to shader part epilog
327 ; GFX10-LABEL: atomic_xor_i32_1d:
328 ; GFX10: ; %bb.0: ; %main_body
329 ; GFX10-NEXT: s_mov_b32 s0, s2
330 ; GFX10-NEXT: s_mov_b32 s1, s3
331 ; GFX10-NEXT: s_mov_b32 s2, s4
332 ; GFX10-NEXT: s_mov_b32 s3, s5
333 ; GFX10-NEXT: s_mov_b32 s4, s6
334 ; GFX10-NEXT: s_mov_b32 s5, s7
335 ; GFX10-NEXT: s_mov_b32 s6, s8
336 ; GFX10-NEXT: s_mov_b32 s7, s9
337 ; GFX10-NEXT: image_atomic_xor v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
338 ; GFX10-NEXT: s_waitcnt vmcnt(0)
339 ; GFX10-NEXT: ; return to shader part epilog
341 %v = call i32 @llvm.amdgcn.image.atomic.xor.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
342 %out = bitcast i32 %v to float
346 define amdgpu_ps float @atomic_inc_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
347 ; GFX9-LABEL: atomic_inc_i32_1d:
348 ; GFX9: ; %bb.0: ; %main_body
349 ; GFX9-NEXT: s_mov_b32 s0, s2
350 ; GFX9-NEXT: s_mov_b32 s1, s3
351 ; GFX9-NEXT: s_mov_b32 s2, s4
352 ; GFX9-NEXT: s_mov_b32 s3, s5
353 ; GFX9-NEXT: s_mov_b32 s4, s6
354 ; GFX9-NEXT: s_mov_b32 s5, s7
355 ; GFX9-NEXT: s_mov_b32 s6, s8
356 ; GFX9-NEXT: s_mov_b32 s7, s9
357 ; GFX9-NEXT: image_atomic_inc v0, v1, s[0:7] dmask:0x1 unorm glc a16
358 ; GFX9-NEXT: s_waitcnt vmcnt(0)
359 ; GFX9-NEXT: ; return to shader part epilog
361 ; GFX10-LABEL: atomic_inc_i32_1d:
362 ; GFX10: ; %bb.0: ; %main_body
363 ; GFX10-NEXT: s_mov_b32 s0, s2
364 ; GFX10-NEXT: s_mov_b32 s1, s3
365 ; GFX10-NEXT: s_mov_b32 s2, s4
366 ; GFX10-NEXT: s_mov_b32 s3, s5
367 ; GFX10-NEXT: s_mov_b32 s4, s6
368 ; GFX10-NEXT: s_mov_b32 s5, s7
369 ; GFX10-NEXT: s_mov_b32 s6, s8
370 ; GFX10-NEXT: s_mov_b32 s7, s9
371 ; GFX10-NEXT: image_atomic_inc v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
372 ; GFX10-NEXT: s_waitcnt vmcnt(0)
373 ; GFX10-NEXT: ; return to shader part epilog
375 %v = call i32 @llvm.amdgcn.image.atomic.inc.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
376 %out = bitcast i32 %v to float
380 define amdgpu_ps float @atomic_dec_i32_1d(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
381 ; GFX9-LABEL: atomic_dec_i32_1d:
382 ; GFX9: ; %bb.0: ; %main_body
383 ; GFX9-NEXT: s_mov_b32 s0, s2
384 ; GFX9-NEXT: s_mov_b32 s1, s3
385 ; GFX9-NEXT: s_mov_b32 s2, s4
386 ; GFX9-NEXT: s_mov_b32 s3, s5
387 ; GFX9-NEXT: s_mov_b32 s4, s6
388 ; GFX9-NEXT: s_mov_b32 s5, s7
389 ; GFX9-NEXT: s_mov_b32 s6, s8
390 ; GFX9-NEXT: s_mov_b32 s7, s9
391 ; GFX9-NEXT: image_atomic_dec v0, v1, s[0:7] dmask:0x1 unorm glc a16
392 ; GFX9-NEXT: s_waitcnt vmcnt(0)
393 ; GFX9-NEXT: ; return to shader part epilog
395 ; GFX10-LABEL: atomic_dec_i32_1d:
396 ; GFX10: ; %bb.0: ; %main_body
397 ; GFX10-NEXT: s_mov_b32 s0, s2
398 ; GFX10-NEXT: s_mov_b32 s1, s3
399 ; GFX10-NEXT: s_mov_b32 s2, s4
400 ; GFX10-NEXT: s_mov_b32 s3, s5
401 ; GFX10-NEXT: s_mov_b32 s4, s6
402 ; GFX10-NEXT: s_mov_b32 s5, s7
403 ; GFX10-NEXT: s_mov_b32 s6, s8
404 ; GFX10-NEXT: s_mov_b32 s7, s9
405 ; GFX10-NEXT: image_atomic_dec v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc a16
406 ; GFX10-NEXT: s_waitcnt vmcnt(0)
407 ; GFX10-NEXT: ; return to shader part epilog
409 %v = call i32 @llvm.amdgcn.image.atomic.dec.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
410 %out = bitcast i32 %v to float
414 define amdgpu_ps float @atomic_cmpswap_i32_1d(<8 x i32> inreg %rsrc, i32 %cmp, i32 %swap, i16 %s) {
415 ; GFX9-LABEL: atomic_cmpswap_i32_1d:
416 ; GFX9: ; %bb.0: ; %main_body
417 ; GFX9-NEXT: s_mov_b32 s0, s2
418 ; GFX9-NEXT: s_mov_b32 s1, s3
419 ; GFX9-NEXT: s_mov_b32 s2, s4
420 ; GFX9-NEXT: s_mov_b32 s3, s5
421 ; GFX9-NEXT: s_mov_b32 s4, s6
422 ; GFX9-NEXT: s_mov_b32 s5, s7
423 ; GFX9-NEXT: s_mov_b32 s6, s8
424 ; GFX9-NEXT: s_mov_b32 s7, s9
425 ; GFX9-NEXT: image_atomic_cmpswap v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
426 ; GFX9-NEXT: s_waitcnt vmcnt(0)
427 ; GFX9-NEXT: ; return to shader part epilog
429 ; GFX10-LABEL: atomic_cmpswap_i32_1d:
430 ; GFX10: ; %bb.0: ; %main_body
431 ; GFX10-NEXT: s_mov_b32 s0, s2
432 ; GFX10-NEXT: s_mov_b32 s1, s3
433 ; GFX10-NEXT: s_mov_b32 s2, s4
434 ; GFX10-NEXT: s_mov_b32 s3, s5
435 ; GFX10-NEXT: s_mov_b32 s4, s6
436 ; GFX10-NEXT: s_mov_b32 s5, s7
437 ; GFX10-NEXT: s_mov_b32 s6, s8
438 ; GFX10-NEXT: s_mov_b32 s7, s9
439 ; GFX10-NEXT: image_atomic_cmpswap v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
440 ; GFX10-NEXT: s_waitcnt vmcnt(0)
441 ; GFX10-NEXT: ; return to shader part epilog
443 %v = call i32 @llvm.amdgcn.image.atomic.cmpswap.1d.i32.i16(i32 %cmp, i32 %swap, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
444 %out = bitcast i32 %v to float
448 define amdgpu_ps float @atomic_add_i32_2d(<8 x i32> inreg %rsrc, i32 %data, i16 %s, i16 %t) {
449 ; GFX9-LABEL: atomic_add_i32_2d:
450 ; GFX9: ; %bb.0: ; %main_body
451 ; GFX9-NEXT: v_and_b32_e32 v1, 0xffff, v1
452 ; GFX9-NEXT: s_mov_b32 s0, s2
453 ; GFX9-NEXT: s_mov_b32 s1, s3
454 ; GFX9-NEXT: s_mov_b32 s2, s4
455 ; GFX9-NEXT: s_mov_b32 s3, s5
456 ; GFX9-NEXT: s_mov_b32 s4, s6
457 ; GFX9-NEXT: s_mov_b32 s5, s7
458 ; GFX9-NEXT: s_mov_b32 s6, s8
459 ; GFX9-NEXT: s_mov_b32 s7, s9
460 ; GFX9-NEXT: v_lshl_or_b32 v1, v2, 16, v1
461 ; GFX9-NEXT: image_atomic_add v0, v1, s[0:7] dmask:0x1 unorm glc a16
462 ; GFX9-NEXT: s_waitcnt vmcnt(0)
463 ; GFX9-NEXT: ; return to shader part epilog
465 ; GFX10-LABEL: atomic_add_i32_2d:
466 ; GFX10: ; %bb.0: ; %main_body
467 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1
468 ; GFX10-NEXT: s_mov_b32 s0, s2
469 ; GFX10-NEXT: s_mov_b32 s1, s3
470 ; GFX10-NEXT: s_mov_b32 s2, s4
471 ; GFX10-NEXT: s_mov_b32 s3, s5
472 ; GFX10-NEXT: v_lshl_or_b32 v1, v2, 16, v1
473 ; GFX10-NEXT: s_mov_b32 s4, s6
474 ; GFX10-NEXT: s_mov_b32 s5, s7
475 ; GFX10-NEXT: s_mov_b32 s6, s8
476 ; GFX10-NEXT: s_mov_b32 s7, s9
477 ; GFX10-NEXT: image_atomic_add v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D unorm glc a16
478 ; GFX10-NEXT: s_waitcnt vmcnt(0)
479 ; GFX10-NEXT: ; return to shader part epilog
481 %v = call i32 @llvm.amdgcn.image.atomic.add.2d.i32.i16(i32 %data, i16 %s, i16 %t, <8 x i32> %rsrc, i32 0, i32 0)
482 %out = bitcast i32 %v to float
486 define amdgpu_ps float @atomic_add_i32_3d(<8 x i32> inreg %rsrc, i32 %data, i16 %s, i16 %t, i16 %r) {
487 ; GFX9-LABEL: atomic_add_i32_3d:
488 ; GFX9: ; %bb.0: ; %main_body
489 ; GFX9-NEXT: v_and_b32_e32 v1, 0xffff, v1
490 ; GFX9-NEXT: s_mov_b32 s0, s2
491 ; GFX9-NEXT: s_mov_b32 s1, s3
492 ; GFX9-NEXT: s_mov_b32 s2, s4
493 ; GFX9-NEXT: s_mov_b32 s3, s5
494 ; GFX9-NEXT: s_mov_b32 s4, s6
495 ; GFX9-NEXT: s_mov_b32 s5, s7
496 ; GFX9-NEXT: s_mov_b32 s6, s8
497 ; GFX9-NEXT: s_mov_b32 s7, s9
498 ; GFX9-NEXT: v_lshl_or_b32 v2, v2, 16, v1
499 ; GFX9-NEXT: image_atomic_add v0, v[2:3], s[0:7] dmask:0x1 unorm glc a16
500 ; GFX9-NEXT: s_waitcnt vmcnt(0)
501 ; GFX9-NEXT: ; return to shader part epilog
503 ; GFX10-LABEL: atomic_add_i32_3d:
504 ; GFX10: ; %bb.0: ; %main_body
505 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1
506 ; GFX10-NEXT: s_mov_b32 s0, s2
507 ; GFX10-NEXT: s_mov_b32 s1, s3
508 ; GFX10-NEXT: s_mov_b32 s2, s4
509 ; GFX10-NEXT: s_mov_b32 s3, s5
510 ; GFX10-NEXT: v_lshl_or_b32 v2, v2, 16, v1
511 ; GFX10-NEXT: s_mov_b32 s4, s6
512 ; GFX10-NEXT: s_mov_b32 s5, s7
513 ; GFX10-NEXT: s_mov_b32 s6, s8
514 ; GFX10-NEXT: s_mov_b32 s7, s9
515 ; GFX10-NEXT: image_atomic_add v0, v[2:3], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_3D unorm glc a16
516 ; GFX10-NEXT: s_waitcnt vmcnt(0)
517 ; GFX10-NEXT: ; return to shader part epilog
519 %v = call i32 @llvm.amdgcn.image.atomic.add.3d.i32.i16(i32 %data, i16 %s, i16 %t, i16 %r, <8 x i32> %rsrc, i32 0, i32 0)
520 %out = bitcast i32 %v to float
524 define amdgpu_ps float @atomic_add_i32_cube(<8 x i32> inreg %rsrc, i32 %data, i16 %s, i16 %t, i16 %face) {
525 ; GFX9-LABEL: atomic_add_i32_cube:
526 ; GFX9: ; %bb.0: ; %main_body
527 ; GFX9-NEXT: v_and_b32_e32 v1, 0xffff, v1
528 ; GFX9-NEXT: s_mov_b32 s0, s2
529 ; GFX9-NEXT: s_mov_b32 s1, s3
530 ; GFX9-NEXT: s_mov_b32 s2, s4
531 ; GFX9-NEXT: s_mov_b32 s3, s5
532 ; GFX9-NEXT: s_mov_b32 s4, s6
533 ; GFX9-NEXT: s_mov_b32 s5, s7
534 ; GFX9-NEXT: s_mov_b32 s6, s8
535 ; GFX9-NEXT: s_mov_b32 s7, s9
536 ; GFX9-NEXT: v_lshl_or_b32 v2, v2, 16, v1
537 ; GFX9-NEXT: image_atomic_add v0, v[2:3], s[0:7] dmask:0x1 unorm glc a16 da
538 ; GFX9-NEXT: s_waitcnt vmcnt(0)
539 ; GFX9-NEXT: ; return to shader part epilog
541 ; GFX10-LABEL: atomic_add_i32_cube:
542 ; GFX10: ; %bb.0: ; %main_body
543 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1
544 ; GFX10-NEXT: s_mov_b32 s0, s2
545 ; GFX10-NEXT: s_mov_b32 s1, s3
546 ; GFX10-NEXT: s_mov_b32 s2, s4
547 ; GFX10-NEXT: s_mov_b32 s3, s5
548 ; GFX10-NEXT: v_lshl_or_b32 v2, v2, 16, v1
549 ; GFX10-NEXT: s_mov_b32 s4, s6
550 ; GFX10-NEXT: s_mov_b32 s5, s7
551 ; GFX10-NEXT: s_mov_b32 s6, s8
552 ; GFX10-NEXT: s_mov_b32 s7, s9
553 ; GFX10-NEXT: image_atomic_add v0, v[2:3], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_CUBE unorm glc a16
554 ; GFX10-NEXT: s_waitcnt vmcnt(0)
555 ; GFX10-NEXT: ; return to shader part epilog
557 %v = call i32 @llvm.amdgcn.image.atomic.add.cube.i32.i16(i32 %data, i16 %s, i16 %t, i16 %face, <8 x i32> %rsrc, i32 0, i32 0)
558 %out = bitcast i32 %v to float
562 define amdgpu_ps float @atomic_add_i32_1darray(<8 x i32> inreg %rsrc, i32 %data, i16 %s, i16 %slice) {
563 ; GFX9-LABEL: atomic_add_i32_1darray:
564 ; GFX9: ; %bb.0: ; %main_body
565 ; GFX9-NEXT: v_and_b32_e32 v1, 0xffff, v1
566 ; GFX9-NEXT: s_mov_b32 s0, s2
567 ; GFX9-NEXT: s_mov_b32 s1, s3
568 ; GFX9-NEXT: s_mov_b32 s2, s4
569 ; GFX9-NEXT: s_mov_b32 s3, s5
570 ; GFX9-NEXT: s_mov_b32 s4, s6
571 ; GFX9-NEXT: s_mov_b32 s5, s7
572 ; GFX9-NEXT: s_mov_b32 s6, s8
573 ; GFX9-NEXT: s_mov_b32 s7, s9
574 ; GFX9-NEXT: v_lshl_or_b32 v1, v2, 16, v1
575 ; GFX9-NEXT: image_atomic_add v0, v1, s[0:7] dmask:0x1 unorm glc a16 da
576 ; GFX9-NEXT: s_waitcnt vmcnt(0)
577 ; GFX9-NEXT: ; return to shader part epilog
579 ; GFX10-LABEL: atomic_add_i32_1darray:
580 ; GFX10: ; %bb.0: ; %main_body
581 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1
582 ; GFX10-NEXT: s_mov_b32 s0, s2
583 ; GFX10-NEXT: s_mov_b32 s1, s3
584 ; GFX10-NEXT: s_mov_b32 s2, s4
585 ; GFX10-NEXT: s_mov_b32 s3, s5
586 ; GFX10-NEXT: v_lshl_or_b32 v1, v2, 16, v1
587 ; GFX10-NEXT: s_mov_b32 s4, s6
588 ; GFX10-NEXT: s_mov_b32 s5, s7
589 ; GFX10-NEXT: s_mov_b32 s6, s8
590 ; GFX10-NEXT: s_mov_b32 s7, s9
591 ; GFX10-NEXT: image_atomic_add v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D_ARRAY unorm glc a16
592 ; GFX10-NEXT: s_waitcnt vmcnt(0)
593 ; GFX10-NEXT: ; return to shader part epilog
595 %v = call i32 @llvm.amdgcn.image.atomic.add.1darray.i32.i16(i32 %data, i16 %s, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
596 %out = bitcast i32 %v to float
600 define amdgpu_ps float @atomic_add_i32_2darray(<8 x i32> inreg %rsrc, i32 %data, i16 %s, i16 %t, i16 %slice) {
601 ; GFX9-LABEL: atomic_add_i32_2darray:
602 ; GFX9: ; %bb.0: ; %main_body
603 ; GFX9-NEXT: v_and_b32_e32 v1, 0xffff, v1
604 ; GFX9-NEXT: s_mov_b32 s0, s2
605 ; GFX9-NEXT: s_mov_b32 s1, s3
606 ; GFX9-NEXT: s_mov_b32 s2, s4
607 ; GFX9-NEXT: s_mov_b32 s3, s5
608 ; GFX9-NEXT: s_mov_b32 s4, s6
609 ; GFX9-NEXT: s_mov_b32 s5, s7
610 ; GFX9-NEXT: s_mov_b32 s6, s8
611 ; GFX9-NEXT: s_mov_b32 s7, s9
612 ; GFX9-NEXT: v_lshl_or_b32 v2, v2, 16, v1
613 ; GFX9-NEXT: image_atomic_add v0, v[2:3], s[0:7] dmask:0x1 unorm glc a16 da
614 ; GFX9-NEXT: s_waitcnt vmcnt(0)
615 ; GFX9-NEXT: ; return to shader part epilog
617 ; GFX10-LABEL: atomic_add_i32_2darray:
618 ; GFX10: ; %bb.0: ; %main_body
619 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1
620 ; GFX10-NEXT: s_mov_b32 s0, s2
621 ; GFX10-NEXT: s_mov_b32 s1, s3
622 ; GFX10-NEXT: s_mov_b32 s2, s4
623 ; GFX10-NEXT: s_mov_b32 s3, s5
624 ; GFX10-NEXT: v_lshl_or_b32 v2, v2, 16, v1
625 ; GFX10-NEXT: s_mov_b32 s4, s6
626 ; GFX10-NEXT: s_mov_b32 s5, s7
627 ; GFX10-NEXT: s_mov_b32 s6, s8
628 ; GFX10-NEXT: s_mov_b32 s7, s9
629 ; GFX10-NEXT: image_atomic_add v0, v[2:3], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D_ARRAY unorm glc a16
630 ; GFX10-NEXT: s_waitcnt vmcnt(0)
631 ; GFX10-NEXT: ; return to shader part epilog
633 %v = call i32 @llvm.amdgcn.image.atomic.add.2darray.i32.i16(i32 %data, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
634 %out = bitcast i32 %v to float
638 define amdgpu_ps float @atomic_add_i32_2dmsaa(<8 x i32> inreg %rsrc, i32 %data, i16 %s, i16 %t, i16 %fragid) {
639 ; GFX9-LABEL: atomic_add_i32_2dmsaa:
640 ; GFX9: ; %bb.0: ; %main_body
641 ; GFX9-NEXT: v_and_b32_e32 v1, 0xffff, v1
642 ; GFX9-NEXT: s_mov_b32 s0, s2
643 ; GFX9-NEXT: s_mov_b32 s1, s3
644 ; GFX9-NEXT: s_mov_b32 s2, s4
645 ; GFX9-NEXT: s_mov_b32 s3, s5
646 ; GFX9-NEXT: s_mov_b32 s4, s6
647 ; GFX9-NEXT: s_mov_b32 s5, s7
648 ; GFX9-NEXT: s_mov_b32 s6, s8
649 ; GFX9-NEXT: s_mov_b32 s7, s9
650 ; GFX9-NEXT: v_lshl_or_b32 v2, v2, 16, v1
651 ; GFX9-NEXT: image_atomic_add v0, v[2:3], s[0:7] dmask:0x1 unorm glc a16
652 ; GFX9-NEXT: s_waitcnt vmcnt(0)
653 ; GFX9-NEXT: ; return to shader part epilog
655 ; GFX10-LABEL: atomic_add_i32_2dmsaa:
656 ; GFX10: ; %bb.0: ; %main_body
657 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1
658 ; GFX10-NEXT: s_mov_b32 s0, s2
659 ; GFX10-NEXT: s_mov_b32 s1, s3
660 ; GFX10-NEXT: s_mov_b32 s2, s4
661 ; GFX10-NEXT: s_mov_b32 s3, s5
662 ; GFX10-NEXT: v_lshl_or_b32 v2, v2, 16, v1
663 ; GFX10-NEXT: s_mov_b32 s4, s6
664 ; GFX10-NEXT: s_mov_b32 s5, s7
665 ; GFX10-NEXT: s_mov_b32 s6, s8
666 ; GFX10-NEXT: s_mov_b32 s7, s9
667 ; GFX10-NEXT: image_atomic_add v0, v[2:3], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D_MSAA unorm glc a16
668 ; GFX10-NEXT: s_waitcnt vmcnt(0)
669 ; GFX10-NEXT: ; return to shader part epilog
671 %v = call i32 @llvm.amdgcn.image.atomic.add.2dmsaa.i32.i16(i32 %data, i16 %s, i16 %t, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
672 %out = bitcast i32 %v to float
676 define amdgpu_ps float @atomic_add_i32_2darraymsaa(<8 x i32> inreg %rsrc, i32 %data, i16 %s, i16 %t, i16 %slice, i16 %fragid) {
677 ; GFX9-LABEL: atomic_add_i32_2darraymsaa:
678 ; GFX9: ; %bb.0: ; %main_body
679 ; GFX9-NEXT: v_and_b32_e32 v1, 0xffff, v1
680 ; GFX9-NEXT: v_lshl_or_b32 v1, v2, 16, v1
681 ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v3
682 ; GFX9-NEXT: s_mov_b32 s0, s2
683 ; GFX9-NEXT: s_mov_b32 s1, s3
684 ; GFX9-NEXT: s_mov_b32 s2, s4
685 ; GFX9-NEXT: s_mov_b32 s3, s5
686 ; GFX9-NEXT: s_mov_b32 s4, s6
687 ; GFX9-NEXT: s_mov_b32 s5, s7
688 ; GFX9-NEXT: s_mov_b32 s6, s8
689 ; GFX9-NEXT: s_mov_b32 s7, s9
690 ; GFX9-NEXT: v_lshl_or_b32 v2, v4, 16, v2
691 ; GFX9-NEXT: image_atomic_add v0, v[1:2], s[0:7] dmask:0x1 unorm glc a16 da
692 ; GFX9-NEXT: s_waitcnt vmcnt(0)
693 ; GFX9-NEXT: ; return to shader part epilog
695 ; GFX10-LABEL: atomic_add_i32_2darraymsaa:
696 ; GFX10: ; %bb.0: ; %main_body
697 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff, v1
698 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff, v3
699 ; GFX10-NEXT: s_mov_b32 s0, s2
700 ; GFX10-NEXT: s_mov_b32 s1, s3
701 ; GFX10-NEXT: s_mov_b32 s2, s4
702 ; GFX10-NEXT: v_lshl_or_b32 v1, v2, 16, v1
703 ; GFX10-NEXT: v_lshl_or_b32 v2, v4, 16, v3
704 ; GFX10-NEXT: s_mov_b32 s3, s5
705 ; GFX10-NEXT: s_mov_b32 s4, s6
706 ; GFX10-NEXT: s_mov_b32 s5, s7
707 ; GFX10-NEXT: s_mov_b32 s6, s8
708 ; GFX10-NEXT: s_mov_b32 s7, s9
709 ; GFX10-NEXT: image_atomic_add v0, v[1:2], s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm glc a16
710 ; GFX10-NEXT: s_waitcnt vmcnt(0)
711 ; GFX10-NEXT: ; return to shader part epilog
713 %v = call i32 @llvm.amdgcn.image.atomic.add.2darraymsaa.i32.i16(i32 %data, i16 %s, i16 %t, i16 %slice, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
714 %out = bitcast i32 %v to float
718 define amdgpu_ps float @atomic_add_i32_1d_slc(<8 x i32> inreg %rsrc, i32 %data, i16 %s) {
719 ; GFX9-LABEL: atomic_add_i32_1d_slc:
720 ; GFX9: ; %bb.0: ; %main_body
721 ; GFX9-NEXT: s_mov_b32 s0, s2
722 ; GFX9-NEXT: s_mov_b32 s1, s3
723 ; GFX9-NEXT: s_mov_b32 s2, s4
724 ; GFX9-NEXT: s_mov_b32 s3, s5
725 ; GFX9-NEXT: s_mov_b32 s4, s6
726 ; GFX9-NEXT: s_mov_b32 s5, s7
727 ; GFX9-NEXT: s_mov_b32 s6, s8
728 ; GFX9-NEXT: s_mov_b32 s7, s9
729 ; GFX9-NEXT: image_atomic_add v0, v1, s[0:7] dmask:0x1 unorm glc slc a16
730 ; GFX9-NEXT: s_waitcnt vmcnt(0)
731 ; GFX9-NEXT: ; return to shader part epilog
733 ; GFX10-LABEL: atomic_add_i32_1d_slc:
734 ; GFX10: ; %bb.0: ; %main_body
735 ; GFX10-NEXT: s_mov_b32 s0, s2
736 ; GFX10-NEXT: s_mov_b32 s1, s3
737 ; GFX10-NEXT: s_mov_b32 s2, s4
738 ; GFX10-NEXT: s_mov_b32 s3, s5
739 ; GFX10-NEXT: s_mov_b32 s4, s6
740 ; GFX10-NEXT: s_mov_b32 s5, s7
741 ; GFX10-NEXT: s_mov_b32 s6, s8
742 ; GFX10-NEXT: s_mov_b32 s7, s9
743 ; GFX10-NEXT: image_atomic_add v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm glc slc a16
744 ; GFX10-NEXT: s_waitcnt vmcnt(0)
745 ; GFX10-NEXT: ; return to shader part epilog
747 %v = call i32 @llvm.amdgcn.image.atomic.add.1d.i32.i16(i32 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 2)
748 %out = bitcast i32 %v to float
752 define amdgpu_ps <2 x float> @atomic_swap_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
753 ; GFX9-LABEL: atomic_swap_i64_1d:
754 ; GFX9: ; %bb.0: ; %main_body
755 ; GFX9-NEXT: s_mov_b32 s0, s2
756 ; GFX9-NEXT: s_mov_b32 s1, s3
757 ; GFX9-NEXT: s_mov_b32 s2, s4
758 ; GFX9-NEXT: s_mov_b32 s3, s5
759 ; GFX9-NEXT: s_mov_b32 s4, s6
760 ; GFX9-NEXT: s_mov_b32 s5, s7
761 ; GFX9-NEXT: s_mov_b32 s6, s8
762 ; GFX9-NEXT: s_mov_b32 s7, s9
763 ; GFX9-NEXT: image_atomic_swap v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
764 ; GFX9-NEXT: s_waitcnt vmcnt(0)
765 ; GFX9-NEXT: ; return to shader part epilog
767 ; GFX10-LABEL: atomic_swap_i64_1d:
768 ; GFX10: ; %bb.0: ; %main_body
769 ; GFX10-NEXT: s_mov_b32 s0, s2
770 ; GFX10-NEXT: s_mov_b32 s1, s3
771 ; GFX10-NEXT: s_mov_b32 s2, s4
772 ; GFX10-NEXT: s_mov_b32 s3, s5
773 ; GFX10-NEXT: s_mov_b32 s4, s6
774 ; GFX10-NEXT: s_mov_b32 s5, s7
775 ; GFX10-NEXT: s_mov_b32 s6, s8
776 ; GFX10-NEXT: s_mov_b32 s7, s9
777 ; GFX10-NEXT: image_atomic_swap v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
778 ; GFX10-NEXT: s_waitcnt vmcnt(0)
779 ; GFX10-NEXT: ; return to shader part epilog
781 %v = call i64 @llvm.amdgcn.image.atomic.swap.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
782 %out = bitcast i64 %v to <2 x float>
786 define amdgpu_ps <2 x float> @atomic_add_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
787 ; GFX9-LABEL: atomic_add_i64_1d:
788 ; GFX9: ; %bb.0: ; %main_body
789 ; GFX9-NEXT: s_mov_b32 s0, s2
790 ; GFX9-NEXT: s_mov_b32 s1, s3
791 ; GFX9-NEXT: s_mov_b32 s2, s4
792 ; GFX9-NEXT: s_mov_b32 s3, s5
793 ; GFX9-NEXT: s_mov_b32 s4, s6
794 ; GFX9-NEXT: s_mov_b32 s5, s7
795 ; GFX9-NEXT: s_mov_b32 s6, s8
796 ; GFX9-NEXT: s_mov_b32 s7, s9
797 ; GFX9-NEXT: image_atomic_add v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
798 ; GFX9-NEXT: s_waitcnt vmcnt(0)
799 ; GFX9-NEXT: ; return to shader part epilog
801 ; GFX10-LABEL: atomic_add_i64_1d:
802 ; GFX10: ; %bb.0: ; %main_body
803 ; GFX10-NEXT: s_mov_b32 s0, s2
804 ; GFX10-NEXT: s_mov_b32 s1, s3
805 ; GFX10-NEXT: s_mov_b32 s2, s4
806 ; GFX10-NEXT: s_mov_b32 s3, s5
807 ; GFX10-NEXT: s_mov_b32 s4, s6
808 ; GFX10-NEXT: s_mov_b32 s5, s7
809 ; GFX10-NEXT: s_mov_b32 s6, s8
810 ; GFX10-NEXT: s_mov_b32 s7, s9
811 ; GFX10-NEXT: image_atomic_add v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
812 ; GFX10-NEXT: s_waitcnt vmcnt(0)
813 ; GFX10-NEXT: ; return to shader part epilog
815 %v = call i64 @llvm.amdgcn.image.atomic.add.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
816 %out = bitcast i64 %v to <2 x float>
820 define amdgpu_ps <2 x float> @atomic_sub_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
821 ; GFX9-LABEL: atomic_sub_i64_1d:
822 ; GFX9: ; %bb.0: ; %main_body
823 ; GFX9-NEXT: s_mov_b32 s0, s2
824 ; GFX9-NEXT: s_mov_b32 s1, s3
825 ; GFX9-NEXT: s_mov_b32 s2, s4
826 ; GFX9-NEXT: s_mov_b32 s3, s5
827 ; GFX9-NEXT: s_mov_b32 s4, s6
828 ; GFX9-NEXT: s_mov_b32 s5, s7
829 ; GFX9-NEXT: s_mov_b32 s6, s8
830 ; GFX9-NEXT: s_mov_b32 s7, s9
831 ; GFX9-NEXT: image_atomic_sub v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
832 ; GFX9-NEXT: s_waitcnt vmcnt(0)
833 ; GFX9-NEXT: ; return to shader part epilog
835 ; GFX10-LABEL: atomic_sub_i64_1d:
836 ; GFX10: ; %bb.0: ; %main_body
837 ; GFX10-NEXT: s_mov_b32 s0, s2
838 ; GFX10-NEXT: s_mov_b32 s1, s3
839 ; GFX10-NEXT: s_mov_b32 s2, s4
840 ; GFX10-NEXT: s_mov_b32 s3, s5
841 ; GFX10-NEXT: s_mov_b32 s4, s6
842 ; GFX10-NEXT: s_mov_b32 s5, s7
843 ; GFX10-NEXT: s_mov_b32 s6, s8
844 ; GFX10-NEXT: s_mov_b32 s7, s9
845 ; GFX10-NEXT: image_atomic_sub v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
846 ; GFX10-NEXT: s_waitcnt vmcnt(0)
847 ; GFX10-NEXT: ; return to shader part epilog
849 %v = call i64 @llvm.amdgcn.image.atomic.sub.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
850 %out = bitcast i64 %v to <2 x float>
854 define amdgpu_ps <2 x float> @atomic_smin_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
855 ; GFX9-LABEL: atomic_smin_i64_1d:
856 ; GFX9: ; %bb.0: ; %main_body
857 ; GFX9-NEXT: s_mov_b32 s0, s2
858 ; GFX9-NEXT: s_mov_b32 s1, s3
859 ; GFX9-NEXT: s_mov_b32 s2, s4
860 ; GFX9-NEXT: s_mov_b32 s3, s5
861 ; GFX9-NEXT: s_mov_b32 s4, s6
862 ; GFX9-NEXT: s_mov_b32 s5, s7
863 ; GFX9-NEXT: s_mov_b32 s6, s8
864 ; GFX9-NEXT: s_mov_b32 s7, s9
865 ; GFX9-NEXT: image_atomic_smin v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
866 ; GFX9-NEXT: s_waitcnt vmcnt(0)
867 ; GFX9-NEXT: ; return to shader part epilog
869 ; GFX10-LABEL: atomic_smin_i64_1d:
870 ; GFX10: ; %bb.0: ; %main_body
871 ; GFX10-NEXT: s_mov_b32 s0, s2
872 ; GFX10-NEXT: s_mov_b32 s1, s3
873 ; GFX10-NEXT: s_mov_b32 s2, s4
874 ; GFX10-NEXT: s_mov_b32 s3, s5
875 ; GFX10-NEXT: s_mov_b32 s4, s6
876 ; GFX10-NEXT: s_mov_b32 s5, s7
877 ; GFX10-NEXT: s_mov_b32 s6, s8
878 ; GFX10-NEXT: s_mov_b32 s7, s9
879 ; GFX10-NEXT: image_atomic_smin v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
880 ; GFX10-NEXT: s_waitcnt vmcnt(0)
881 ; GFX10-NEXT: ; return to shader part epilog
883 %v = call i64 @llvm.amdgcn.image.atomic.smin.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
884 %out = bitcast i64 %v to <2 x float>
888 define amdgpu_ps <2 x float> @atomic_umin_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
889 ; GFX9-LABEL: atomic_umin_i64_1d:
890 ; GFX9: ; %bb.0: ; %main_body
891 ; GFX9-NEXT: s_mov_b32 s0, s2
892 ; GFX9-NEXT: s_mov_b32 s1, s3
893 ; GFX9-NEXT: s_mov_b32 s2, s4
894 ; GFX9-NEXT: s_mov_b32 s3, s5
895 ; GFX9-NEXT: s_mov_b32 s4, s6
896 ; GFX9-NEXT: s_mov_b32 s5, s7
897 ; GFX9-NEXT: s_mov_b32 s6, s8
898 ; GFX9-NEXT: s_mov_b32 s7, s9
899 ; GFX9-NEXT: image_atomic_umin v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
900 ; GFX9-NEXT: s_waitcnt vmcnt(0)
901 ; GFX9-NEXT: ; return to shader part epilog
903 ; GFX10-LABEL: atomic_umin_i64_1d:
904 ; GFX10: ; %bb.0: ; %main_body
905 ; GFX10-NEXT: s_mov_b32 s0, s2
906 ; GFX10-NEXT: s_mov_b32 s1, s3
907 ; GFX10-NEXT: s_mov_b32 s2, s4
908 ; GFX10-NEXT: s_mov_b32 s3, s5
909 ; GFX10-NEXT: s_mov_b32 s4, s6
910 ; GFX10-NEXT: s_mov_b32 s5, s7
911 ; GFX10-NEXT: s_mov_b32 s6, s8
912 ; GFX10-NEXT: s_mov_b32 s7, s9
913 ; GFX10-NEXT: image_atomic_umin v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
914 ; GFX10-NEXT: s_waitcnt vmcnt(0)
915 ; GFX10-NEXT: ; return to shader part epilog
917 %v = call i64 @llvm.amdgcn.image.atomic.umin.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
918 %out = bitcast i64 %v to <2 x float>
922 define amdgpu_ps <2 x float> @atomic_smax_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
923 ; GFX9-LABEL: atomic_smax_i64_1d:
924 ; GFX9: ; %bb.0: ; %main_body
925 ; GFX9-NEXT: s_mov_b32 s0, s2
926 ; GFX9-NEXT: s_mov_b32 s1, s3
927 ; GFX9-NEXT: s_mov_b32 s2, s4
928 ; GFX9-NEXT: s_mov_b32 s3, s5
929 ; GFX9-NEXT: s_mov_b32 s4, s6
930 ; GFX9-NEXT: s_mov_b32 s5, s7
931 ; GFX9-NEXT: s_mov_b32 s6, s8
932 ; GFX9-NEXT: s_mov_b32 s7, s9
933 ; GFX9-NEXT: image_atomic_smax v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
934 ; GFX9-NEXT: s_waitcnt vmcnt(0)
935 ; GFX9-NEXT: ; return to shader part epilog
937 ; GFX10-LABEL: atomic_smax_i64_1d:
938 ; GFX10: ; %bb.0: ; %main_body
939 ; GFX10-NEXT: s_mov_b32 s0, s2
940 ; GFX10-NEXT: s_mov_b32 s1, s3
941 ; GFX10-NEXT: s_mov_b32 s2, s4
942 ; GFX10-NEXT: s_mov_b32 s3, s5
943 ; GFX10-NEXT: s_mov_b32 s4, s6
944 ; GFX10-NEXT: s_mov_b32 s5, s7
945 ; GFX10-NEXT: s_mov_b32 s6, s8
946 ; GFX10-NEXT: s_mov_b32 s7, s9
947 ; GFX10-NEXT: image_atomic_smax v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
948 ; GFX10-NEXT: s_waitcnt vmcnt(0)
949 ; GFX10-NEXT: ; return to shader part epilog
951 %v = call i64 @llvm.amdgcn.image.atomic.smax.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
952 %out = bitcast i64 %v to <2 x float>
956 define amdgpu_ps <2 x float> @atomic_umax_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
957 ; GFX9-LABEL: atomic_umax_i64_1d:
958 ; GFX9: ; %bb.0: ; %main_body
959 ; GFX9-NEXT: s_mov_b32 s0, s2
960 ; GFX9-NEXT: s_mov_b32 s1, s3
961 ; GFX9-NEXT: s_mov_b32 s2, s4
962 ; GFX9-NEXT: s_mov_b32 s3, s5
963 ; GFX9-NEXT: s_mov_b32 s4, s6
964 ; GFX9-NEXT: s_mov_b32 s5, s7
965 ; GFX9-NEXT: s_mov_b32 s6, s8
966 ; GFX9-NEXT: s_mov_b32 s7, s9
967 ; GFX9-NEXT: image_atomic_umax v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
968 ; GFX9-NEXT: s_waitcnt vmcnt(0)
969 ; GFX9-NEXT: ; return to shader part epilog
971 ; GFX10-LABEL: atomic_umax_i64_1d:
972 ; GFX10: ; %bb.0: ; %main_body
973 ; GFX10-NEXT: s_mov_b32 s0, s2
974 ; GFX10-NEXT: s_mov_b32 s1, s3
975 ; GFX10-NEXT: s_mov_b32 s2, s4
976 ; GFX10-NEXT: s_mov_b32 s3, s5
977 ; GFX10-NEXT: s_mov_b32 s4, s6
978 ; GFX10-NEXT: s_mov_b32 s5, s7
979 ; GFX10-NEXT: s_mov_b32 s6, s8
980 ; GFX10-NEXT: s_mov_b32 s7, s9
981 ; GFX10-NEXT: image_atomic_umax v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
982 ; GFX10-NEXT: s_waitcnt vmcnt(0)
983 ; GFX10-NEXT: ; return to shader part epilog
985 %v = call i64 @llvm.amdgcn.image.atomic.umax.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
986 %out = bitcast i64 %v to <2 x float>
990 define amdgpu_ps <2 x float> @atomic_and_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
991 ; GFX9-LABEL: atomic_and_i64_1d:
992 ; GFX9: ; %bb.0: ; %main_body
993 ; GFX9-NEXT: s_mov_b32 s0, s2
994 ; GFX9-NEXT: s_mov_b32 s1, s3
995 ; GFX9-NEXT: s_mov_b32 s2, s4
996 ; GFX9-NEXT: s_mov_b32 s3, s5
997 ; GFX9-NEXT: s_mov_b32 s4, s6
998 ; GFX9-NEXT: s_mov_b32 s5, s7
999 ; GFX9-NEXT: s_mov_b32 s6, s8
1000 ; GFX9-NEXT: s_mov_b32 s7, s9
1001 ; GFX9-NEXT: image_atomic_and v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
1002 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1003 ; GFX9-NEXT: ; return to shader part epilog
1005 ; GFX10-LABEL: atomic_and_i64_1d:
1006 ; GFX10: ; %bb.0: ; %main_body
1007 ; GFX10-NEXT: s_mov_b32 s0, s2
1008 ; GFX10-NEXT: s_mov_b32 s1, s3
1009 ; GFX10-NEXT: s_mov_b32 s2, s4
1010 ; GFX10-NEXT: s_mov_b32 s3, s5
1011 ; GFX10-NEXT: s_mov_b32 s4, s6
1012 ; GFX10-NEXT: s_mov_b32 s5, s7
1013 ; GFX10-NEXT: s_mov_b32 s6, s8
1014 ; GFX10-NEXT: s_mov_b32 s7, s9
1015 ; GFX10-NEXT: image_atomic_and v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
1016 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1017 ; GFX10-NEXT: ; return to shader part epilog
1019 %v = call i64 @llvm.amdgcn.image.atomic.and.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
1020 %out = bitcast i64 %v to <2 x float>
1021 ret <2 x float> %out
1024 define amdgpu_ps <2 x float> @atomic_or_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
1025 ; GFX9-LABEL: atomic_or_i64_1d:
1026 ; GFX9: ; %bb.0: ; %main_body
1027 ; GFX9-NEXT: s_mov_b32 s0, s2
1028 ; GFX9-NEXT: s_mov_b32 s1, s3
1029 ; GFX9-NEXT: s_mov_b32 s2, s4
1030 ; GFX9-NEXT: s_mov_b32 s3, s5
1031 ; GFX9-NEXT: s_mov_b32 s4, s6
1032 ; GFX9-NEXT: s_mov_b32 s5, s7
1033 ; GFX9-NEXT: s_mov_b32 s6, s8
1034 ; GFX9-NEXT: s_mov_b32 s7, s9
1035 ; GFX9-NEXT: image_atomic_or v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
1036 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1037 ; GFX9-NEXT: ; return to shader part epilog
1039 ; GFX10-LABEL: atomic_or_i64_1d:
1040 ; GFX10: ; %bb.0: ; %main_body
1041 ; GFX10-NEXT: s_mov_b32 s0, s2
1042 ; GFX10-NEXT: s_mov_b32 s1, s3
1043 ; GFX10-NEXT: s_mov_b32 s2, s4
1044 ; GFX10-NEXT: s_mov_b32 s3, s5
1045 ; GFX10-NEXT: s_mov_b32 s4, s6
1046 ; GFX10-NEXT: s_mov_b32 s5, s7
1047 ; GFX10-NEXT: s_mov_b32 s6, s8
1048 ; GFX10-NEXT: s_mov_b32 s7, s9
1049 ; GFX10-NEXT: image_atomic_or v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
1050 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1051 ; GFX10-NEXT: ; return to shader part epilog
1053 %v = call i64 @llvm.amdgcn.image.atomic.or.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
1054 %out = bitcast i64 %v to <2 x float>
1055 ret <2 x float> %out
1058 define amdgpu_ps <2 x float> @atomic_xor_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
1059 ; GFX9-LABEL: atomic_xor_i64_1d:
1060 ; GFX9: ; %bb.0: ; %main_body
1061 ; GFX9-NEXT: s_mov_b32 s0, s2
1062 ; GFX9-NEXT: s_mov_b32 s1, s3
1063 ; GFX9-NEXT: s_mov_b32 s2, s4
1064 ; GFX9-NEXT: s_mov_b32 s3, s5
1065 ; GFX9-NEXT: s_mov_b32 s4, s6
1066 ; GFX9-NEXT: s_mov_b32 s5, s7
1067 ; GFX9-NEXT: s_mov_b32 s6, s8
1068 ; GFX9-NEXT: s_mov_b32 s7, s9
1069 ; GFX9-NEXT: image_atomic_xor v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
1070 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1071 ; GFX9-NEXT: ; return to shader part epilog
1073 ; GFX10-LABEL: atomic_xor_i64_1d:
1074 ; GFX10: ; %bb.0: ; %main_body
1075 ; GFX10-NEXT: s_mov_b32 s0, s2
1076 ; GFX10-NEXT: s_mov_b32 s1, s3
1077 ; GFX10-NEXT: s_mov_b32 s2, s4
1078 ; GFX10-NEXT: s_mov_b32 s3, s5
1079 ; GFX10-NEXT: s_mov_b32 s4, s6
1080 ; GFX10-NEXT: s_mov_b32 s5, s7
1081 ; GFX10-NEXT: s_mov_b32 s6, s8
1082 ; GFX10-NEXT: s_mov_b32 s7, s9
1083 ; GFX10-NEXT: image_atomic_xor v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
1084 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1085 ; GFX10-NEXT: ; return to shader part epilog
1087 %v = call i64 @llvm.amdgcn.image.atomic.xor.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
1088 %out = bitcast i64 %v to <2 x float>
1089 ret <2 x float> %out
1092 define amdgpu_ps <2 x float> @atomic_inc_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
1093 ; GFX9-LABEL: atomic_inc_i64_1d:
1094 ; GFX9: ; %bb.0: ; %main_body
1095 ; GFX9-NEXT: s_mov_b32 s0, s2
1096 ; GFX9-NEXT: s_mov_b32 s1, s3
1097 ; GFX9-NEXT: s_mov_b32 s2, s4
1098 ; GFX9-NEXT: s_mov_b32 s3, s5
1099 ; GFX9-NEXT: s_mov_b32 s4, s6
1100 ; GFX9-NEXT: s_mov_b32 s5, s7
1101 ; GFX9-NEXT: s_mov_b32 s6, s8
1102 ; GFX9-NEXT: s_mov_b32 s7, s9
1103 ; GFX9-NEXT: image_atomic_inc v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
1104 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1105 ; GFX9-NEXT: ; return to shader part epilog
1107 ; GFX10-LABEL: atomic_inc_i64_1d:
1108 ; GFX10: ; %bb.0: ; %main_body
1109 ; GFX10-NEXT: s_mov_b32 s0, s2
1110 ; GFX10-NEXT: s_mov_b32 s1, s3
1111 ; GFX10-NEXT: s_mov_b32 s2, s4
1112 ; GFX10-NEXT: s_mov_b32 s3, s5
1113 ; GFX10-NEXT: s_mov_b32 s4, s6
1114 ; GFX10-NEXT: s_mov_b32 s5, s7
1115 ; GFX10-NEXT: s_mov_b32 s6, s8
1116 ; GFX10-NEXT: s_mov_b32 s7, s9
1117 ; GFX10-NEXT: image_atomic_inc v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
1118 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1119 ; GFX10-NEXT: ; return to shader part epilog
1121 %v = call i64 @llvm.amdgcn.image.atomic.inc.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
1122 %out = bitcast i64 %v to <2 x float>
1123 ret <2 x float> %out
1126 define amdgpu_ps <2 x float> @atomic_dec_i64_1d(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
1127 ; GFX9-LABEL: atomic_dec_i64_1d:
1128 ; GFX9: ; %bb.0: ; %main_body
1129 ; GFX9-NEXT: s_mov_b32 s0, s2
1130 ; GFX9-NEXT: s_mov_b32 s1, s3
1131 ; GFX9-NEXT: s_mov_b32 s2, s4
1132 ; GFX9-NEXT: s_mov_b32 s3, s5
1133 ; GFX9-NEXT: s_mov_b32 s4, s6
1134 ; GFX9-NEXT: s_mov_b32 s5, s7
1135 ; GFX9-NEXT: s_mov_b32 s6, s8
1136 ; GFX9-NEXT: s_mov_b32 s7, s9
1137 ; GFX9-NEXT: image_atomic_dec v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
1138 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1139 ; GFX9-NEXT: ; return to shader part epilog
1141 ; GFX10-LABEL: atomic_dec_i64_1d:
1142 ; GFX10: ; %bb.0: ; %main_body
1143 ; GFX10-NEXT: s_mov_b32 s0, s2
1144 ; GFX10-NEXT: s_mov_b32 s1, s3
1145 ; GFX10-NEXT: s_mov_b32 s2, s4
1146 ; GFX10-NEXT: s_mov_b32 s3, s5
1147 ; GFX10-NEXT: s_mov_b32 s4, s6
1148 ; GFX10-NEXT: s_mov_b32 s5, s7
1149 ; GFX10-NEXT: s_mov_b32 s6, s8
1150 ; GFX10-NEXT: s_mov_b32 s7, s9
1151 ; GFX10-NEXT: image_atomic_dec v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc a16
1152 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1153 ; GFX10-NEXT: ; return to shader part epilog
1155 %v = call i64 @llvm.amdgcn.image.atomic.dec.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
1156 %out = bitcast i64 %v to <2 x float>
1157 ret <2 x float> %out
1160 define amdgpu_ps <2 x float> @atomic_cmpswap_i64_1d(<8 x i32> inreg %rsrc, i64 %cmp, i64 %swap, i16 %s) {
1161 ; GFX9-LABEL: atomic_cmpswap_i64_1d:
1162 ; GFX9: ; %bb.0: ; %main_body
1163 ; GFX9-NEXT: s_mov_b32 s0, s2
1164 ; GFX9-NEXT: s_mov_b32 s1, s3
1165 ; GFX9-NEXT: s_mov_b32 s2, s4
1166 ; GFX9-NEXT: s_mov_b32 s3, s5
1167 ; GFX9-NEXT: s_mov_b32 s4, s6
1168 ; GFX9-NEXT: s_mov_b32 s5, s7
1169 ; GFX9-NEXT: s_mov_b32 s6, s8
1170 ; GFX9-NEXT: s_mov_b32 s7, s9
1171 ; GFX9-NEXT: image_atomic_cmpswap v[0:3], v4, s[0:7] dmask:0xf unorm glc a16
1172 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1173 ; GFX9-NEXT: ; return to shader part epilog
1175 ; GFX10-LABEL: atomic_cmpswap_i64_1d:
1176 ; GFX10: ; %bb.0: ; %main_body
1177 ; GFX10-NEXT: s_mov_b32 s0, s2
1178 ; GFX10-NEXT: s_mov_b32 s1, s3
1179 ; GFX10-NEXT: s_mov_b32 s2, s4
1180 ; GFX10-NEXT: s_mov_b32 s3, s5
1181 ; GFX10-NEXT: s_mov_b32 s4, s6
1182 ; GFX10-NEXT: s_mov_b32 s5, s7
1183 ; GFX10-NEXT: s_mov_b32 s6, s8
1184 ; GFX10-NEXT: s_mov_b32 s7, s9
1185 ; GFX10-NEXT: image_atomic_cmpswap v[0:3], v4, s[0:7] dmask:0xf dim:SQ_RSRC_IMG_1D unorm glc a16
1186 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1187 ; GFX10-NEXT: ; return to shader part epilog
1189 %v = call i64 @llvm.amdgcn.image.atomic.cmpswap.1d.i64.i16(i64 %cmp, i64 %swap, i16 %s, <8 x i32> %rsrc, i32 0, i32 0)
1190 %out = bitcast i64 %v to <2 x float>
1191 ret <2 x float> %out
1194 define amdgpu_ps <2 x float> @atomic_add_i64_2d(<8 x i32> inreg %rsrc, i64 %data, i16 %s, i16 %t) {
1195 ; GFX9-LABEL: atomic_add_i64_2d:
1196 ; GFX9: ; %bb.0: ; %main_body
1197 ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2
1198 ; GFX9-NEXT: s_mov_b32 s0, s2
1199 ; GFX9-NEXT: s_mov_b32 s1, s3
1200 ; GFX9-NEXT: s_mov_b32 s2, s4
1201 ; GFX9-NEXT: s_mov_b32 s3, s5
1202 ; GFX9-NEXT: s_mov_b32 s4, s6
1203 ; GFX9-NEXT: s_mov_b32 s5, s7
1204 ; GFX9-NEXT: s_mov_b32 s6, s8
1205 ; GFX9-NEXT: s_mov_b32 s7, s9
1206 ; GFX9-NEXT: v_lshl_or_b32 v2, v3, 16, v2
1207 ; GFX9-NEXT: image_atomic_add v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16
1208 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1209 ; GFX9-NEXT: ; return to shader part epilog
1211 ; GFX10-LABEL: atomic_add_i64_2d:
1212 ; GFX10: ; %bb.0: ; %main_body
1213 ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2
1214 ; GFX10-NEXT: s_mov_b32 s0, s2
1215 ; GFX10-NEXT: s_mov_b32 s1, s3
1216 ; GFX10-NEXT: s_mov_b32 s2, s4
1217 ; GFX10-NEXT: s_mov_b32 s3, s5
1218 ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2
1219 ; GFX10-NEXT: s_mov_b32 s4, s6
1220 ; GFX10-NEXT: s_mov_b32 s5, s7
1221 ; GFX10-NEXT: s_mov_b32 s6, s8
1222 ; GFX10-NEXT: s_mov_b32 s7, s9
1223 ; GFX10-NEXT: image_atomic_add v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D unorm glc a16
1224 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1225 ; GFX10-NEXT: ; return to shader part epilog
1227 %v = call i64 @llvm.amdgcn.image.atomic.add.2d.i64.i16(i64 %data, i16 %s, i16 %t, <8 x i32> %rsrc, i32 0, i32 0)
1228 %out = bitcast i64 %v to <2 x float>
1229 ret <2 x float> %out
1232 define amdgpu_ps <2 x float> @atomic_add_i64_3d(<8 x i32> inreg %rsrc, i64 %data, i16 %s, i16 %t, i16 %r) {
1233 ; GFX9-LABEL: atomic_add_i64_3d:
1234 ; GFX9: ; %bb.0: ; %main_body
1235 ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2
1236 ; GFX9-NEXT: s_mov_b32 s0, s2
1237 ; GFX9-NEXT: s_mov_b32 s1, s3
1238 ; GFX9-NEXT: s_mov_b32 s2, s4
1239 ; GFX9-NEXT: s_mov_b32 s3, s5
1240 ; GFX9-NEXT: s_mov_b32 s4, s6
1241 ; GFX9-NEXT: s_mov_b32 s5, s7
1242 ; GFX9-NEXT: s_mov_b32 s6, s8
1243 ; GFX9-NEXT: s_mov_b32 s7, s9
1244 ; GFX9-NEXT: v_lshl_or_b32 v3, v3, 16, v2
1245 ; GFX9-NEXT: image_atomic_add v[0:1], v[3:4], s[0:7] dmask:0x3 unorm glc a16
1246 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1247 ; GFX9-NEXT: ; return to shader part epilog
1249 ; GFX10-LABEL: atomic_add_i64_3d:
1250 ; GFX10: ; %bb.0: ; %main_body
1251 ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2
1252 ; GFX10-NEXT: s_mov_b32 s0, s2
1253 ; GFX10-NEXT: s_mov_b32 s1, s3
1254 ; GFX10-NEXT: s_mov_b32 s2, s4
1255 ; GFX10-NEXT: s_mov_b32 s3, s5
1256 ; GFX10-NEXT: v_lshl_or_b32 v3, v3, 16, v2
1257 ; GFX10-NEXT: s_mov_b32 s4, s6
1258 ; GFX10-NEXT: s_mov_b32 s5, s7
1259 ; GFX10-NEXT: s_mov_b32 s6, s8
1260 ; GFX10-NEXT: s_mov_b32 s7, s9
1261 ; GFX10-NEXT: image_atomic_add v[0:1], v[3:4], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_3D unorm glc a16
1262 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1263 ; GFX10-NEXT: ; return to shader part epilog
1265 %v = call i64 @llvm.amdgcn.image.atomic.add.3d.i64.i16(i64 %data, i16 %s, i16 %t, i16 %r, <8 x i32> %rsrc, i32 0, i32 0)
1266 %out = bitcast i64 %v to <2 x float>
1267 ret <2 x float> %out
1270 define amdgpu_ps <2 x float> @atomic_add_i64_cube(<8 x i32> inreg %rsrc, i64 %data, i16 %s, i16 %t, i16 %face) {
1271 ; GFX9-LABEL: atomic_add_i64_cube:
1272 ; GFX9: ; %bb.0: ; %main_body
1273 ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2
1274 ; GFX9-NEXT: s_mov_b32 s0, s2
1275 ; GFX9-NEXT: s_mov_b32 s1, s3
1276 ; GFX9-NEXT: s_mov_b32 s2, s4
1277 ; GFX9-NEXT: s_mov_b32 s3, s5
1278 ; GFX9-NEXT: s_mov_b32 s4, s6
1279 ; GFX9-NEXT: s_mov_b32 s5, s7
1280 ; GFX9-NEXT: s_mov_b32 s6, s8
1281 ; GFX9-NEXT: s_mov_b32 s7, s9
1282 ; GFX9-NEXT: v_lshl_or_b32 v3, v3, 16, v2
1283 ; GFX9-NEXT: image_atomic_add v[0:1], v[3:4], s[0:7] dmask:0x3 unorm glc a16 da
1284 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1285 ; GFX9-NEXT: ; return to shader part epilog
1287 ; GFX10-LABEL: atomic_add_i64_cube:
1288 ; GFX10: ; %bb.0: ; %main_body
1289 ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2
1290 ; GFX10-NEXT: s_mov_b32 s0, s2
1291 ; GFX10-NEXT: s_mov_b32 s1, s3
1292 ; GFX10-NEXT: s_mov_b32 s2, s4
1293 ; GFX10-NEXT: s_mov_b32 s3, s5
1294 ; GFX10-NEXT: v_lshl_or_b32 v3, v3, 16, v2
1295 ; GFX10-NEXT: s_mov_b32 s4, s6
1296 ; GFX10-NEXT: s_mov_b32 s5, s7
1297 ; GFX10-NEXT: s_mov_b32 s6, s8
1298 ; GFX10-NEXT: s_mov_b32 s7, s9
1299 ; GFX10-NEXT: image_atomic_add v[0:1], v[3:4], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_CUBE unorm glc a16
1300 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1301 ; GFX10-NEXT: ; return to shader part epilog
1303 %v = call i64 @llvm.amdgcn.image.atomic.add.cube.i64.i16(i64 %data, i16 %s, i16 %t, i16 %face , <8 x i32> %rsrc, i32 0, i32 0)
1304 %out = bitcast i64 %v to <2 x float>
1305 ret <2 x float> %out
1308 define amdgpu_ps <2 x float> @atomic_add_i64_1darray(<8 x i32> inreg %rsrc, i64 %data, i16 %s, i16 %slice) {
1309 ; GFX9-LABEL: atomic_add_i64_1darray:
1310 ; GFX9: ; %bb.0: ; %main_body
1311 ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2
1312 ; GFX9-NEXT: s_mov_b32 s0, s2
1313 ; GFX9-NEXT: s_mov_b32 s1, s3
1314 ; GFX9-NEXT: s_mov_b32 s2, s4
1315 ; GFX9-NEXT: s_mov_b32 s3, s5
1316 ; GFX9-NEXT: s_mov_b32 s4, s6
1317 ; GFX9-NEXT: s_mov_b32 s5, s7
1318 ; GFX9-NEXT: s_mov_b32 s6, s8
1319 ; GFX9-NEXT: s_mov_b32 s7, s9
1320 ; GFX9-NEXT: v_lshl_or_b32 v2, v3, 16, v2
1321 ; GFX9-NEXT: image_atomic_add v[0:1], v2, s[0:7] dmask:0x3 unorm glc a16 da
1322 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1323 ; GFX9-NEXT: ; return to shader part epilog
1325 ; GFX10-LABEL: atomic_add_i64_1darray:
1326 ; GFX10: ; %bb.0: ; %main_body
1327 ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2
1328 ; GFX10-NEXT: s_mov_b32 s0, s2
1329 ; GFX10-NEXT: s_mov_b32 s1, s3
1330 ; GFX10-NEXT: s_mov_b32 s2, s4
1331 ; GFX10-NEXT: s_mov_b32 s3, s5
1332 ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2
1333 ; GFX10-NEXT: s_mov_b32 s4, s6
1334 ; GFX10-NEXT: s_mov_b32 s5, s7
1335 ; GFX10-NEXT: s_mov_b32 s6, s8
1336 ; GFX10-NEXT: s_mov_b32 s7, s9
1337 ; GFX10-NEXT: image_atomic_add v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D_ARRAY unorm glc a16
1338 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1339 ; GFX10-NEXT: ; return to shader part epilog
1341 %v = call i64 @llvm.amdgcn.image.atomic.add.1darray.i64.i16(i64 %data, i16 %s, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
1342 %out = bitcast i64 %v to <2 x float>
1343 ret <2 x float> %out
1346 define amdgpu_ps <2 x float> @atomic_add_i64_2darray(<8 x i32> inreg %rsrc, i64 %data, i16 %s, i16 %t, i16 %slice) {
1347 ; GFX9-LABEL: atomic_add_i64_2darray:
1348 ; GFX9: ; %bb.0: ; %main_body
1349 ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2
1350 ; GFX9-NEXT: s_mov_b32 s0, s2
1351 ; GFX9-NEXT: s_mov_b32 s1, s3
1352 ; GFX9-NEXT: s_mov_b32 s2, s4
1353 ; GFX9-NEXT: s_mov_b32 s3, s5
1354 ; GFX9-NEXT: s_mov_b32 s4, s6
1355 ; GFX9-NEXT: s_mov_b32 s5, s7
1356 ; GFX9-NEXT: s_mov_b32 s6, s8
1357 ; GFX9-NEXT: s_mov_b32 s7, s9
1358 ; GFX9-NEXT: v_lshl_or_b32 v3, v3, 16, v2
1359 ; GFX9-NEXT: image_atomic_add v[0:1], v[3:4], s[0:7] dmask:0x3 unorm glc a16 da
1360 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1361 ; GFX9-NEXT: ; return to shader part epilog
1363 ; GFX10-LABEL: atomic_add_i64_2darray:
1364 ; GFX10: ; %bb.0: ; %main_body
1365 ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2
1366 ; GFX10-NEXT: s_mov_b32 s0, s2
1367 ; GFX10-NEXT: s_mov_b32 s1, s3
1368 ; GFX10-NEXT: s_mov_b32 s2, s4
1369 ; GFX10-NEXT: s_mov_b32 s3, s5
1370 ; GFX10-NEXT: v_lshl_or_b32 v3, v3, 16, v2
1371 ; GFX10-NEXT: s_mov_b32 s4, s6
1372 ; GFX10-NEXT: s_mov_b32 s5, s7
1373 ; GFX10-NEXT: s_mov_b32 s6, s8
1374 ; GFX10-NEXT: s_mov_b32 s7, s9
1375 ; GFX10-NEXT: image_atomic_add v[0:1], v[3:4], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D_ARRAY unorm glc a16
1376 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1377 ; GFX10-NEXT: ; return to shader part epilog
1379 %v = call i64 @llvm.amdgcn.image.atomic.add.2darray.i64.i16(i64 %data, i16 %s, i16 %t, i16 %slice, <8 x i32> %rsrc, i32 0, i32 0)
1380 %out = bitcast i64 %v to <2 x float>
1381 ret <2 x float> %out
1384 define amdgpu_ps <2 x float> @atomic_add_i64_2dmsaa(<8 x i32> inreg %rsrc, i64 %data, i16 %s, i16 %t, i16 %fragid) {
1385 ; GFX9-LABEL: atomic_add_i64_2dmsaa:
1386 ; GFX9: ; %bb.0: ; %main_body
1387 ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2
1388 ; GFX9-NEXT: s_mov_b32 s0, s2
1389 ; GFX9-NEXT: s_mov_b32 s1, s3
1390 ; GFX9-NEXT: s_mov_b32 s2, s4
1391 ; GFX9-NEXT: s_mov_b32 s3, s5
1392 ; GFX9-NEXT: s_mov_b32 s4, s6
1393 ; GFX9-NEXT: s_mov_b32 s5, s7
1394 ; GFX9-NEXT: s_mov_b32 s6, s8
1395 ; GFX9-NEXT: s_mov_b32 s7, s9
1396 ; GFX9-NEXT: v_lshl_or_b32 v3, v3, 16, v2
1397 ; GFX9-NEXT: image_atomic_add v[0:1], v[3:4], s[0:7] dmask:0x3 unorm glc a16
1398 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1399 ; GFX9-NEXT: ; return to shader part epilog
1401 ; GFX10-LABEL: atomic_add_i64_2dmsaa:
1402 ; GFX10: ; %bb.0: ; %main_body
1403 ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2
1404 ; GFX10-NEXT: s_mov_b32 s0, s2
1405 ; GFX10-NEXT: s_mov_b32 s1, s3
1406 ; GFX10-NEXT: s_mov_b32 s2, s4
1407 ; GFX10-NEXT: s_mov_b32 s3, s5
1408 ; GFX10-NEXT: v_lshl_or_b32 v3, v3, 16, v2
1409 ; GFX10-NEXT: s_mov_b32 s4, s6
1410 ; GFX10-NEXT: s_mov_b32 s5, s7
1411 ; GFX10-NEXT: s_mov_b32 s6, s8
1412 ; GFX10-NEXT: s_mov_b32 s7, s9
1413 ; GFX10-NEXT: image_atomic_add v[0:1], v[3:4], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D_MSAA unorm glc a16
1414 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1415 ; GFX10-NEXT: ; return to shader part epilog
1417 %v = call i64 @llvm.amdgcn.image.atomic.add.2dmsaa.i64.i16(i64 %data, i16 %s, i16 %t, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
1418 %out = bitcast i64 %v to <2 x float>
1419 ret <2 x float> %out
1422 define amdgpu_ps <2 x float> @atomic_add_i64_2darraymsaa(<8 x i32> inreg %rsrc, i64 %data, i16 %s, i16 %t, i16 %slice, i16 %fragid) {
1423 ; GFX9-LABEL: atomic_add_i64_2darraymsaa:
1424 ; GFX9: ; %bb.0: ; %main_body
1425 ; GFX9-NEXT: v_and_b32_e32 v2, 0xffff, v2
1426 ; GFX9-NEXT: v_lshl_or_b32 v2, v3, 16, v2
1427 ; GFX9-NEXT: v_and_b32_e32 v3, 0xffff, v4
1428 ; GFX9-NEXT: s_mov_b32 s0, s2
1429 ; GFX9-NEXT: s_mov_b32 s1, s3
1430 ; GFX9-NEXT: s_mov_b32 s2, s4
1431 ; GFX9-NEXT: s_mov_b32 s3, s5
1432 ; GFX9-NEXT: s_mov_b32 s4, s6
1433 ; GFX9-NEXT: s_mov_b32 s5, s7
1434 ; GFX9-NEXT: s_mov_b32 s6, s8
1435 ; GFX9-NEXT: s_mov_b32 s7, s9
1436 ; GFX9-NEXT: v_lshl_or_b32 v3, v5, 16, v3
1437 ; GFX9-NEXT: image_atomic_add v[0:1], v[2:3], s[0:7] dmask:0x3 unorm glc a16 da
1438 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1439 ; GFX9-NEXT: ; return to shader part epilog
1441 ; GFX10-LABEL: atomic_add_i64_2darraymsaa:
1442 ; GFX10: ; %bb.0: ; %main_body
1443 ; GFX10-NEXT: v_and_b32_e32 v2, 0xffff, v2
1444 ; GFX10-NEXT: v_and_b32_e32 v4, 0xffff, v4
1445 ; GFX10-NEXT: s_mov_b32 s0, s2
1446 ; GFX10-NEXT: s_mov_b32 s1, s3
1447 ; GFX10-NEXT: s_mov_b32 s2, s4
1448 ; GFX10-NEXT: v_lshl_or_b32 v2, v3, 16, v2
1449 ; GFX10-NEXT: v_lshl_or_b32 v3, v5, 16, v4
1450 ; GFX10-NEXT: s_mov_b32 s3, s5
1451 ; GFX10-NEXT: s_mov_b32 s4, s6
1452 ; GFX10-NEXT: s_mov_b32 s5, s7
1453 ; GFX10-NEXT: s_mov_b32 s6, s8
1454 ; GFX10-NEXT: s_mov_b32 s7, s9
1455 ; GFX10-NEXT: image_atomic_add v[0:1], v[2:3], s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_2D_MSAA_ARRAY unorm glc a16
1456 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1457 ; GFX10-NEXT: ; return to shader part epilog
1459 %v = call i64 @llvm.amdgcn.image.atomic.add.2darraymsaa.i64.i16(i64 %data, i16 %s, i16 %t, i16 %slice, i16 %fragid, <8 x i32> %rsrc, i32 0, i32 0)
1460 %out = bitcast i64 %v to <2 x float>
1461 ret <2 x float> %out
1464 define amdgpu_ps <2 x float> @atomic_add_i64_1d_slc(<8 x i32> inreg %rsrc, i64 %data, i16 %s) {
1465 ; GFX9-LABEL: atomic_add_i64_1d_slc:
1466 ; GFX9: ; %bb.0: ; %main_body
1467 ; GFX9-NEXT: s_mov_b32 s0, s2
1468 ; GFX9-NEXT: s_mov_b32 s1, s3
1469 ; GFX9-NEXT: s_mov_b32 s2, s4
1470 ; GFX9-NEXT: s_mov_b32 s3, s5
1471 ; GFX9-NEXT: s_mov_b32 s4, s6
1472 ; GFX9-NEXT: s_mov_b32 s5, s7
1473 ; GFX9-NEXT: s_mov_b32 s6, s8
1474 ; GFX9-NEXT: s_mov_b32 s7, s9
1475 ; GFX9-NEXT: image_atomic_add v[0:1], v2, s[0:7] dmask:0x3 unorm glc slc a16
1476 ; GFX9-NEXT: s_waitcnt vmcnt(0)
1477 ; GFX9-NEXT: ; return to shader part epilog
1479 ; GFX10-LABEL: atomic_add_i64_1d_slc:
1480 ; GFX10: ; %bb.0: ; %main_body
1481 ; GFX10-NEXT: s_mov_b32 s0, s2
1482 ; GFX10-NEXT: s_mov_b32 s1, s3
1483 ; GFX10-NEXT: s_mov_b32 s2, s4
1484 ; GFX10-NEXT: s_mov_b32 s3, s5
1485 ; GFX10-NEXT: s_mov_b32 s4, s6
1486 ; GFX10-NEXT: s_mov_b32 s5, s7
1487 ; GFX10-NEXT: s_mov_b32 s6, s8
1488 ; GFX10-NEXT: s_mov_b32 s7, s9
1489 ; GFX10-NEXT: image_atomic_add v[0:1], v2, s[0:7] dmask:0x3 dim:SQ_RSRC_IMG_1D unorm glc slc a16
1490 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1491 ; GFX10-NEXT: ; return to shader part epilog
1493 %v = call i64 @llvm.amdgcn.image.atomic.add.1d.i64.i16(i64 %data, i16 %s, <8 x i32> %rsrc, i32 0, i32 2)
1494 %out = bitcast i64 %v to <2 x float>
1495 ret <2 x float> %out
1498 declare i32 @llvm.amdgcn.image.atomic.swap.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1499 declare i32 @llvm.amdgcn.image.atomic.add.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1500 declare i32 @llvm.amdgcn.image.atomic.sub.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1501 declare i32 @llvm.amdgcn.image.atomic.smin.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1502 declare i32 @llvm.amdgcn.image.atomic.umin.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1503 declare i32 @llvm.amdgcn.image.atomic.smax.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1504 declare i32 @llvm.amdgcn.image.atomic.umax.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1505 declare i32 @llvm.amdgcn.image.atomic.and.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1506 declare i32 @llvm.amdgcn.image.atomic.or.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1507 declare i32 @llvm.amdgcn.image.atomic.xor.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1508 declare i32 @llvm.amdgcn.image.atomic.inc.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1509 declare i32 @llvm.amdgcn.image.atomic.dec.1d.i32.i16(i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1510 declare i32 @llvm.amdgcn.image.atomic.cmpswap.1d.i32.i16(i32, i32, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1511 declare i32 @llvm.amdgcn.image.atomic.add.2d.i32.i16(i32, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1512 declare i32 @llvm.amdgcn.image.atomic.add.3d.i32.i16(i32, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1513 declare i32 @llvm.amdgcn.image.atomic.add.cube.i32.i16(i32, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1514 declare i32 @llvm.amdgcn.image.atomic.add.1darray.i32.i16(i32, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1515 declare i32 @llvm.amdgcn.image.atomic.add.2darray.i32.i16(i32, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1516 declare i32 @llvm.amdgcn.image.atomic.add.2dmsaa.i32.i16(i32, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1517 declare i32 @llvm.amdgcn.image.atomic.add.2darraymsaa.i32.i16(i32, i16, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1519 declare i64 @llvm.amdgcn.image.atomic.swap.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1520 declare i64 @llvm.amdgcn.image.atomic.add.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1521 declare i64 @llvm.amdgcn.image.atomic.sub.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1522 declare i64 @llvm.amdgcn.image.atomic.smin.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1523 declare i64 @llvm.amdgcn.image.atomic.umin.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1524 declare i64 @llvm.amdgcn.image.atomic.smax.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1525 declare i64 @llvm.amdgcn.image.atomic.umax.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1526 declare i64 @llvm.amdgcn.image.atomic.and.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1527 declare i64 @llvm.amdgcn.image.atomic.or.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1528 declare i64 @llvm.amdgcn.image.atomic.xor.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1529 declare i64 @llvm.amdgcn.image.atomic.inc.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1530 declare i64 @llvm.amdgcn.image.atomic.dec.1d.i64.i16(i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1531 declare i64 @llvm.amdgcn.image.atomic.cmpswap.1d.i64.i16(i64, i64, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1532 declare i64 @llvm.amdgcn.image.atomic.add.2d.i64.i16(i64, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1533 declare i64 @llvm.amdgcn.image.atomic.add.3d.i64.i16(i64, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1534 declare i64 @llvm.amdgcn.image.atomic.add.cube.i64.i16(i64, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1535 declare i64 @llvm.amdgcn.image.atomic.add.1darray.i64.i16(i64, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1536 declare i64 @llvm.amdgcn.image.atomic.add.2darray.i64.i16(i64, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1537 declare i64 @llvm.amdgcn.image.atomic.add.2dmsaa.i64.i16(i64, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1538 declare i64 @llvm.amdgcn.image.atomic.add.2darraymsaa.i64.i16(i64, i16, i16, i16, i16, <8 x i32>, i32 immarg, i32 immarg) #0
1540 attributes #0 = { nounwind }