1 ; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
4 ; GCN-LABEL: {{^}}atomic_add_i64_offset:
5 ; GCN: flat_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}{{$}}
6 define amdgpu_kernel void @atomic_add_i64_offset(i64* %out, i64 %in) {
8 %gep = getelementptr i64, i64* %out, i64 4
9 %tmp0 = atomicrmw volatile add i64* %gep, i64 %in seq_cst
13 ; GCN-LABEL: {{^}}atomic_add_i64_ret_offset:
14 ; GCN: flat_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
15 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
16 define amdgpu_kernel void @atomic_add_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
18 %gep = getelementptr i64, i64* %out, i64 4
19 %tmp0 = atomicrmw volatile add i64* %gep, i64 %in seq_cst
20 store i64 %tmp0, i64* %out2
24 ; GCN-LABEL: {{^}}atomic_add_i64_addr64_offset:
25 ; GCN: flat_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}}{{$}}
26 define amdgpu_kernel void @atomic_add_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
28 %ptr = getelementptr i64, i64* %out, i64 %index
29 %gep = getelementptr i64, i64* %ptr, i64 4
30 %tmp0 = atomicrmw volatile add i64* %gep, i64 %in seq_cst
34 ; GCN-LABEL: {{^}}atomic_add_i64_ret_addr64_offset:
35 ; GCN: flat_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
36 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
37 define amdgpu_kernel void @atomic_add_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
39 %ptr = getelementptr i64, i64* %out, i64 %index
40 %gep = getelementptr i64, i64* %ptr, i64 4
41 %tmp0 = atomicrmw volatile add i64* %gep, i64 %in seq_cst
42 store i64 %tmp0, i64* %out2
46 ; GCN-LABEL: {{^}}atomic_add_i64:
47 ; GCN: flat_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
48 define amdgpu_kernel void @atomic_add_i64(i64* %out, i64 %in) {
50 %tmp0 = atomicrmw volatile add i64* %out, i64 %in seq_cst
54 ; GCN-LABEL: {{^}}atomic_add_i64_ret:
55 ; GCN: flat_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
56 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
57 define amdgpu_kernel void @atomic_add_i64_ret(i64* %out, i64* %out2, i64 %in) {
59 %tmp0 = atomicrmw volatile add i64* %out, i64 %in seq_cst
60 store i64 %tmp0, i64* %out2
64 ; GCN-LABEL: {{^}}atomic_add_i64_addr64:
65 ; GCN: flat_atomic_add_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
66 define amdgpu_kernel void @atomic_add_i64_addr64(i64* %out, i64 %in, i64 %index) {
68 %ptr = getelementptr i64, i64* %out, i64 %index
69 %tmp0 = atomicrmw volatile add i64* %ptr, i64 %in seq_cst
73 ; GCN-LABEL: {{^}}atomic_add_i64_ret_addr64:
74 ; GCN: flat_atomic_add_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
75 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
76 define amdgpu_kernel void @atomic_add_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
78 %ptr = getelementptr i64, i64* %out, i64 %index
79 %tmp0 = atomicrmw volatile add i64* %ptr, i64 %in seq_cst
80 store i64 %tmp0, i64* %out2
84 ; GCN-LABEL: {{^}}atomic_and_i64_offset:
85 ; GCN: flat_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
86 define amdgpu_kernel void @atomic_and_i64_offset(i64* %out, i64 %in) {
88 %gep = getelementptr i64, i64* %out, i64 4
89 %tmp0 = atomicrmw volatile and i64* %gep, i64 %in seq_cst
93 ; GCN-LABEL: {{^}}atomic_and_i64_ret_offset:
94 ; GCN: flat_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
95 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
96 define amdgpu_kernel void @atomic_and_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
98 %gep = getelementptr i64, i64* %out, i64 4
99 %tmp0 = atomicrmw volatile and i64* %gep, i64 %in seq_cst
100 store i64 %tmp0, i64* %out2
104 ; GCN-LABEL: {{^}}atomic_and_i64_addr64_offset:
105 ; GCN: flat_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
106 define amdgpu_kernel void @atomic_and_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
108 %ptr = getelementptr i64, i64* %out, i64 %index
109 %gep = getelementptr i64, i64* %ptr, i64 4
110 %tmp0 = atomicrmw volatile and i64* %gep, i64 %in seq_cst
114 ; GCN-LABEL: {{^}}atomic_and_i64_ret_addr64_offset:
115 ; GCN: flat_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
116 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
117 define amdgpu_kernel void @atomic_and_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
119 %ptr = getelementptr i64, i64* %out, i64 %index
120 %gep = getelementptr i64, i64* %ptr, i64 4
121 %tmp0 = atomicrmw volatile and i64* %gep, i64 %in seq_cst
122 store i64 %tmp0, i64* %out2
126 ; GCN-LABEL: {{^}}atomic_and_i64:
127 ; GCN: flat_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
128 define amdgpu_kernel void @atomic_and_i64(i64* %out, i64 %in) {
130 %tmp0 = atomicrmw volatile and i64* %out, i64 %in seq_cst
134 ; GCN-LABEL: {{^}}atomic_and_i64_ret:
135 ; GCN: flat_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
136 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
137 define amdgpu_kernel void @atomic_and_i64_ret(i64* %out, i64* %out2, i64 %in) {
139 %tmp0 = atomicrmw volatile and i64* %out, i64 %in seq_cst
140 store i64 %tmp0, i64* %out2
144 ; GCN-LABEL: {{^}}atomic_and_i64_addr64:
145 ; GCN: flat_atomic_and_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
146 define amdgpu_kernel void @atomic_and_i64_addr64(i64* %out, i64 %in, i64 %index) {
148 %ptr = getelementptr i64, i64* %out, i64 %index
149 %tmp0 = atomicrmw volatile and i64* %ptr, i64 %in seq_cst
153 ; GCN-LABEL: {{^}}atomic_and_i64_ret_addr64:
154 ; GCN: flat_atomic_and_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
155 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
156 define amdgpu_kernel void @atomic_and_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
158 %ptr = getelementptr i64, i64* %out, i64 %index
159 %tmp0 = atomicrmw volatile and i64* %ptr, i64 %in seq_cst
160 store i64 %tmp0, i64* %out2
164 ; GCN-LABEL: {{^}}atomic_sub_i64_offset:
165 ; GCN: flat_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
166 define amdgpu_kernel void @atomic_sub_i64_offset(i64* %out, i64 %in) {
168 %gep = getelementptr i64, i64* %out, i64 4
169 %tmp0 = atomicrmw volatile sub i64* %gep, i64 %in seq_cst
173 ; GCN-LABEL: {{^}}atomic_sub_i64_ret_offset:
174 ; GCN: flat_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
175 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
176 define amdgpu_kernel void @atomic_sub_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
178 %gep = getelementptr i64, i64* %out, i64 4
179 %tmp0 = atomicrmw volatile sub i64* %gep, i64 %in seq_cst
180 store i64 %tmp0, i64* %out2
184 ; GCN-LABEL: {{^}}atomic_sub_i64_addr64_offset:
185 ; GCN: flat_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
186 define amdgpu_kernel void @atomic_sub_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
188 %ptr = getelementptr i64, i64* %out, i64 %index
189 %gep = getelementptr i64, i64* %ptr, i64 4
190 %tmp0 = atomicrmw volatile sub i64* %gep, i64 %in seq_cst
194 ; GCN-LABEL: {{^}}atomic_sub_i64_ret_addr64_offset:
195 ; GCN: flat_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
196 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
197 define amdgpu_kernel void @atomic_sub_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
199 %ptr = getelementptr i64, i64* %out, i64 %index
200 %gep = getelementptr i64, i64* %ptr, i64 4
201 %tmp0 = atomicrmw volatile sub i64* %gep, i64 %in seq_cst
202 store i64 %tmp0, i64* %out2
206 ; GCN-LABEL: {{^}}atomic_sub_i64:
207 ; GCN: flat_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
208 define amdgpu_kernel void @atomic_sub_i64(i64* %out, i64 %in) {
210 %tmp0 = atomicrmw volatile sub i64* %out, i64 %in seq_cst
214 ; GCN-LABEL: {{^}}atomic_sub_i64_ret:
215 ; GCN: flat_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
216 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
217 define amdgpu_kernel void @atomic_sub_i64_ret(i64* %out, i64* %out2, i64 %in) {
219 %tmp0 = atomicrmw volatile sub i64* %out, i64 %in seq_cst
220 store i64 %tmp0, i64* %out2
224 ; GCN-LABEL: {{^}}atomic_sub_i64_addr64:
225 ; GCN: flat_atomic_sub_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
226 define amdgpu_kernel void @atomic_sub_i64_addr64(i64* %out, i64 %in, i64 %index) {
228 %ptr = getelementptr i64, i64* %out, i64 %index
229 %tmp0 = atomicrmw volatile sub i64* %ptr, i64 %in seq_cst
233 ; GCN-LABEL: {{^}}atomic_sub_i64_ret_addr64:
234 ; GCN: flat_atomic_sub_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
235 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
236 define amdgpu_kernel void @atomic_sub_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
238 %ptr = getelementptr i64, i64* %out, i64 %index
239 %tmp0 = atomicrmw volatile sub i64* %ptr, i64 %in seq_cst
240 store i64 %tmp0, i64* %out2
244 ; GCN-LABEL: {{^}}atomic_max_i64_offset:
245 ; GCN: flat_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
246 define amdgpu_kernel void @atomic_max_i64_offset(i64* %out, i64 %in) {
248 %gep = getelementptr i64, i64* %out, i64 4
249 %tmp0 = atomicrmw volatile max i64* %gep, i64 %in seq_cst
253 ; GCN-LABEL: {{^}}atomic_max_i64_ret_offset:
254 ; GCN: flat_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
255 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
256 define amdgpu_kernel void @atomic_max_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
258 %gep = getelementptr i64, i64* %out, i64 4
259 %tmp0 = atomicrmw volatile max i64* %gep, i64 %in seq_cst
260 store i64 %tmp0, i64* %out2
264 ; GCN-LABEL: {{^}}atomic_max_i64_addr64_offset:
265 ; GCN: flat_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
266 define amdgpu_kernel void @atomic_max_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
268 %ptr = getelementptr i64, i64* %out, i64 %index
269 %gep = getelementptr i64, i64* %ptr, i64 4
270 %tmp0 = atomicrmw volatile max i64* %gep, i64 %in seq_cst
274 ; GCN-LABEL: {{^}}atomic_max_i64_ret_addr64_offset:
275 ; GCN: flat_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
276 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
277 define amdgpu_kernel void @atomic_max_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
279 %ptr = getelementptr i64, i64* %out, i64 %index
280 %gep = getelementptr i64, i64* %ptr, i64 4
281 %tmp0 = atomicrmw volatile max i64* %gep, i64 %in seq_cst
282 store i64 %tmp0, i64* %out2
286 ; GCN-LABEL: {{^}}atomic_max_i64:
287 ; GCN: flat_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
288 define amdgpu_kernel void @atomic_max_i64(i64* %out, i64 %in) {
290 %tmp0 = atomicrmw volatile max i64* %out, i64 %in seq_cst
294 ; GCN-LABEL: {{^}}atomic_max_i64_ret:
295 ; GCN: flat_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
296 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
297 define amdgpu_kernel void @atomic_max_i64_ret(i64* %out, i64* %out2, i64 %in) {
299 %tmp0 = atomicrmw volatile max i64* %out, i64 %in seq_cst
300 store i64 %tmp0, i64* %out2
304 ; GCN-LABEL: {{^}}atomic_max_i64_addr64:
305 ; GCN: flat_atomic_smax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
306 define amdgpu_kernel void @atomic_max_i64_addr64(i64* %out, i64 %in, i64 %index) {
308 %ptr = getelementptr i64, i64* %out, i64 %index
309 %tmp0 = atomicrmw volatile max i64* %ptr, i64 %in seq_cst
313 ; GCN-LABEL: {{^}}atomic_max_i64_ret_addr64:
314 ; GCN: flat_atomic_smax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
315 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
316 define amdgpu_kernel void @atomic_max_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
318 %ptr = getelementptr i64, i64* %out, i64 %index
319 %tmp0 = atomicrmw volatile max i64* %ptr, i64 %in seq_cst
320 store i64 %tmp0, i64* %out2
324 ; GCN-LABEL: {{^}}atomic_umax_i64_offset:
325 ; GCN: flat_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
326 define amdgpu_kernel void @atomic_umax_i64_offset(i64* %out, i64 %in) {
328 %gep = getelementptr i64, i64* %out, i64 4
329 %tmp0 = atomicrmw volatile umax i64* %gep, i64 %in seq_cst
333 ; GCN-LABEL: {{^}}atomic_umax_i64_ret_offset:
334 ; GCN: flat_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
335 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
336 define amdgpu_kernel void @atomic_umax_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
338 %gep = getelementptr i64, i64* %out, i64 4
339 %tmp0 = atomicrmw volatile umax i64* %gep, i64 %in seq_cst
340 store i64 %tmp0, i64* %out2
344 ; GCN-LABEL: {{^}}atomic_umax_i64_addr64_offset:
345 ; GCN: flat_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
346 define amdgpu_kernel void @atomic_umax_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
348 %ptr = getelementptr i64, i64* %out, i64 %index
349 %gep = getelementptr i64, i64* %ptr, i64 4
350 %tmp0 = atomicrmw volatile umax i64* %gep, i64 %in seq_cst
354 ; GCN-LABEL: {{^}}atomic_umax_i64_ret_addr64_offset:
355 ; GCN: flat_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
356 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
357 define amdgpu_kernel void @atomic_umax_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
359 %ptr = getelementptr i64, i64* %out, i64 %index
360 %gep = getelementptr i64, i64* %ptr, i64 4
361 %tmp0 = atomicrmw volatile umax i64* %gep, i64 %in seq_cst
362 store i64 %tmp0, i64* %out2
366 ; GCN-LABEL: {{^}}atomic_umax_i64:
367 ; GCN: flat_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
368 define amdgpu_kernel void @atomic_umax_i64(i64* %out, i64 %in) {
370 %tmp0 = atomicrmw volatile umax i64* %out, i64 %in seq_cst
374 ; GCN-LABEL: {{^}}atomic_umax_i64_ret:
375 ; GCN: flat_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
376 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
377 define amdgpu_kernel void @atomic_umax_i64_ret(i64* %out, i64* %out2, i64 %in) {
379 %tmp0 = atomicrmw volatile umax i64* %out, i64 %in seq_cst
380 store i64 %tmp0, i64* %out2
384 ; GCN-LABEL: {{^}}atomic_umax_i64_addr64:
385 ; GCN: flat_atomic_umax_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
386 define amdgpu_kernel void @atomic_umax_i64_addr64(i64* %out, i64 %in, i64 %index) {
388 %ptr = getelementptr i64, i64* %out, i64 %index
389 %tmp0 = atomicrmw volatile umax i64* %ptr, i64 %in seq_cst
393 ; GCN-LABEL: {{^}}atomic_umax_i64_ret_addr64:
394 ; GCN: flat_atomic_umax_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
395 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
396 define amdgpu_kernel void @atomic_umax_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
398 %ptr = getelementptr i64, i64* %out, i64 %index
399 %tmp0 = atomicrmw volatile umax i64* %ptr, i64 %in seq_cst
400 store i64 %tmp0, i64* %out2
404 ; GCN-LABEL: {{^}}atomic_min_i64_offset:
405 ; GCN: flat_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
406 define amdgpu_kernel void @atomic_min_i64_offset(i64* %out, i64 %in) {
408 %gep = getelementptr i64, i64* %out, i64 4
409 %tmp0 = atomicrmw volatile min i64* %gep, i64 %in seq_cst
413 ; GCN-LABEL: {{^}}atomic_min_i64_ret_offset:
414 ; GCN: flat_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
415 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
416 define amdgpu_kernel void @atomic_min_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
418 %gep = getelementptr i64, i64* %out, i64 4
419 %tmp0 = atomicrmw volatile min i64* %gep, i64 %in seq_cst
420 store i64 %tmp0, i64* %out2
424 ; GCN-LABEL: {{^}}atomic_min_i64_addr64_offset:
425 ; GCN: flat_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
426 define amdgpu_kernel void @atomic_min_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
428 %ptr = getelementptr i64, i64* %out, i64 %index
429 %gep = getelementptr i64, i64* %ptr, i64 4
430 %tmp0 = atomicrmw volatile min i64* %gep, i64 %in seq_cst
434 ; GCN-LABEL: {{^}}atomic_min_i64_ret_addr64_offset:
435 ; GCN: flat_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
436 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
437 define amdgpu_kernel void @atomic_min_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
439 %ptr = getelementptr i64, i64* %out, i64 %index
440 %gep = getelementptr i64, i64* %ptr, i64 4
441 %tmp0 = atomicrmw volatile min i64* %gep, i64 %in seq_cst
442 store i64 %tmp0, i64* %out2
446 ; GCN-LABEL: {{^}}atomic_min_i64:
447 ; GCN: flat_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
448 define amdgpu_kernel void @atomic_min_i64(i64* %out, i64 %in) {
450 %tmp0 = atomicrmw volatile min i64* %out, i64 %in seq_cst
454 ; GCN-LABEL: {{^}}atomic_min_i64_ret:
455 ; GCN: flat_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
456 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
457 define amdgpu_kernel void @atomic_min_i64_ret(i64* %out, i64* %out2, i64 %in) {
459 %tmp0 = atomicrmw volatile min i64* %out, i64 %in seq_cst
460 store i64 %tmp0, i64* %out2
464 ; GCN-LABEL: {{^}}atomic_min_i64_addr64:
465 ; GCN: flat_atomic_smin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
466 define amdgpu_kernel void @atomic_min_i64_addr64(i64* %out, i64 %in, i64 %index) {
468 %ptr = getelementptr i64, i64* %out, i64 %index
469 %tmp0 = atomicrmw volatile min i64* %ptr, i64 %in seq_cst
473 ; GCN-LABEL: {{^}}atomic_min_i64_ret_addr64:
474 ; GCN: flat_atomic_smin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
475 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
476 define amdgpu_kernel void @atomic_min_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
478 %ptr = getelementptr i64, i64* %out, i64 %index
479 %tmp0 = atomicrmw volatile min i64* %ptr, i64 %in seq_cst
480 store i64 %tmp0, i64* %out2
484 ; GCN-LABEL: {{^}}atomic_umin_i64_offset:
485 ; GCN: flat_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
486 define amdgpu_kernel void @atomic_umin_i64_offset(i64* %out, i64 %in) {
488 %gep = getelementptr i64, i64* %out, i64 4
489 %tmp0 = atomicrmw volatile umin i64* %gep, i64 %in seq_cst
493 ; GCN-LABEL: {{^}}atomic_umin_i64_ret_offset:
494 ; GCN: flat_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
495 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
496 define amdgpu_kernel void @atomic_umin_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
498 %gep = getelementptr i64, i64* %out, i64 4
499 %tmp0 = atomicrmw volatile umin i64* %gep, i64 %in seq_cst
500 store i64 %tmp0, i64* %out2
504 ; GCN-LABEL: {{^}}atomic_umin_i64_addr64_offset:
505 ; GCN: flat_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
506 define amdgpu_kernel void @atomic_umin_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
508 %ptr = getelementptr i64, i64* %out, i64 %index
509 %gep = getelementptr i64, i64* %ptr, i64 4
510 %tmp0 = atomicrmw volatile umin i64* %gep, i64 %in seq_cst
514 ; GCN-LABEL: {{^}}atomic_umin_i64_ret_addr64_offset:
515 ; GCN: flat_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
516 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
517 define amdgpu_kernel void @atomic_umin_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
519 %ptr = getelementptr i64, i64* %out, i64 %index
520 %gep = getelementptr i64, i64* %ptr, i64 4
521 %tmp0 = atomicrmw volatile umin i64* %gep, i64 %in seq_cst
522 store i64 %tmp0, i64* %out2
526 ; GCN-LABEL: {{^}}atomic_umin_i64:
527 ; GCN: flat_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
528 define amdgpu_kernel void @atomic_umin_i64(i64* %out, i64 %in) {
530 %tmp0 = atomicrmw volatile umin i64* %out, i64 %in seq_cst
534 ; GCN-LABEL: {{^}}atomic_umin_i64_ret:
535 ; GCN: flat_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
536 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
537 define amdgpu_kernel void @atomic_umin_i64_ret(i64* %out, i64* %out2, i64 %in) {
539 %tmp0 = atomicrmw volatile umin i64* %out, i64 %in seq_cst
540 store i64 %tmp0, i64* %out2
544 ; GCN-LABEL: {{^}}atomic_umin_i64_addr64:
545 ; GCN: flat_atomic_umin_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
546 define amdgpu_kernel void @atomic_umin_i64_addr64(i64* %out, i64 %in, i64 %index) {
548 %ptr = getelementptr i64, i64* %out, i64 %index
549 %tmp0 = atomicrmw volatile umin i64* %ptr, i64 %in seq_cst
553 ; GCN-LABEL: {{^}}atomic_umin_i64_ret_addr64:
554 ; GCN: flat_atomic_umin_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
555 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
556 define amdgpu_kernel void @atomic_umin_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
558 %ptr = getelementptr i64, i64* %out, i64 %index
559 %tmp0 = atomicrmw volatile umin i64* %ptr, i64 %in seq_cst
560 store i64 %tmp0, i64* %out2
564 ; GCN-LABEL: {{^}}atomic_or_i64_offset:
565 ; GCN: flat_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
566 define amdgpu_kernel void @atomic_or_i64_offset(i64* %out, i64 %in) {
568 %gep = getelementptr i64, i64* %out, i64 4
569 %tmp0 = atomicrmw volatile or i64* %gep, i64 %in seq_cst
573 ; GCN-LABEL: {{^}}atomic_or_i64_ret_offset:
574 ; GCN: flat_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
575 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
576 define amdgpu_kernel void @atomic_or_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
578 %gep = getelementptr i64, i64* %out, i64 4
579 %tmp0 = atomicrmw volatile or i64* %gep, i64 %in seq_cst
580 store i64 %tmp0, i64* %out2
584 ; GCN-LABEL: {{^}}atomic_or_i64_addr64_offset:
585 ; GCN: flat_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
586 define amdgpu_kernel void @atomic_or_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
588 %ptr = getelementptr i64, i64* %out, i64 %index
589 %gep = getelementptr i64, i64* %ptr, i64 4
590 %tmp0 = atomicrmw volatile or i64* %gep, i64 %in seq_cst
594 ; GCN-LABEL: {{^}}atomic_or_i64_ret_addr64_offset:
595 ; GCN: flat_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
596 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
597 define amdgpu_kernel void @atomic_or_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
599 %ptr = getelementptr i64, i64* %out, i64 %index
600 %gep = getelementptr i64, i64* %ptr, i64 4
601 %tmp0 = atomicrmw volatile or i64* %gep, i64 %in seq_cst
602 store i64 %tmp0, i64* %out2
606 ; GCN-LABEL: {{^}}atomic_or_i64:
607 ; GCN: flat_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
608 define amdgpu_kernel void @atomic_or_i64(i64* %out, i64 %in) {
610 %tmp0 = atomicrmw volatile or i64* %out, i64 %in seq_cst
614 ; GCN-LABEL: {{^}}atomic_or_i64_ret:
615 ; GCN: flat_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
616 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
617 define amdgpu_kernel void @atomic_or_i64_ret(i64* %out, i64* %out2, i64 %in) {
619 %tmp0 = atomicrmw volatile or i64* %out, i64 %in seq_cst
620 store i64 %tmp0, i64* %out2
624 ; GCN-LABEL: {{^}}atomic_or_i64_addr64:
625 ; GCN: flat_atomic_or_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
626 define amdgpu_kernel void @atomic_or_i64_addr64(i64* %out, i64 %in, i64 %index) {
628 %ptr = getelementptr i64, i64* %out, i64 %index
629 %tmp0 = atomicrmw volatile or i64* %ptr, i64 %in seq_cst
633 ; GCN-LABEL: {{^}}atomic_or_i64_ret_addr64:
634 ; GCN: flat_atomic_or_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
635 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
636 define amdgpu_kernel void @atomic_or_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
638 %ptr = getelementptr i64, i64* %out, i64 %index
639 %tmp0 = atomicrmw volatile or i64* %ptr, i64 %in seq_cst
640 store i64 %tmp0, i64* %out2
644 ; GCN-LABEL: {{^}}atomic_xchg_i64_offset:
645 ; GCN: flat_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
646 define amdgpu_kernel void @atomic_xchg_i64_offset(i64* %out, i64 %in) {
648 %gep = getelementptr i64, i64* %out, i64 4
649 %tmp0 = atomicrmw volatile xchg i64* %gep, i64 %in seq_cst
653 ; GCN-LABEL: {{^}}atomic_xchg_f64_offset:
654 ; GCN: flat_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
655 define amdgpu_kernel void @atomic_xchg_f64_offset(double* %out, double %in) {
657 %gep = getelementptr double, double* %out, i64 4
658 %tmp0 = atomicrmw volatile xchg double* %gep, double %in seq_cst
662 ; GCN-LABEL: {{^}}atomic_xchg_i64_ret_offset:
663 ; GCN: flat_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
664 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
665 define amdgpu_kernel void @atomic_xchg_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
667 %gep = getelementptr i64, i64* %out, i64 4
668 %tmp0 = atomicrmw volatile xchg i64* %gep, i64 %in seq_cst
669 store i64 %tmp0, i64* %out2
673 ; GCN-LABEL: {{^}}atomic_xchg_i64_addr64_offset:
674 ; GCN: flat_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
675 define amdgpu_kernel void @atomic_xchg_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
677 %ptr = getelementptr i64, i64* %out, i64 %index
678 %gep = getelementptr i64, i64* %ptr, i64 4
679 %tmp0 = atomicrmw volatile xchg i64* %gep, i64 %in seq_cst
683 ; GCN-LABEL: {{^}}atomic_xchg_i64_ret_addr64_offset:
684 ; GCN: flat_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
685 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
686 define amdgpu_kernel void @atomic_xchg_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
688 %ptr = getelementptr i64, i64* %out, i64 %index
689 %gep = getelementptr i64, i64* %ptr, i64 4
690 %tmp0 = atomicrmw volatile xchg i64* %gep, i64 %in seq_cst
691 store i64 %tmp0, i64* %out2
695 ; GCN-LABEL: {{^}}atomic_xchg_i64:
696 ; GCN: flat_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
697 define amdgpu_kernel void @atomic_xchg_i64(i64* %out, i64 %in) {
699 %tmp0 = atomicrmw volatile xchg i64* %out, i64 %in seq_cst
703 ; GCN-LABEL: {{^}}atomic_xchg_i64_ret:
704 ; GCN: flat_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
705 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
706 define amdgpu_kernel void @atomic_xchg_i64_ret(i64* %out, i64* %out2, i64 %in) {
708 %tmp0 = atomicrmw volatile xchg i64* %out, i64 %in seq_cst
709 store i64 %tmp0, i64* %out2
713 ; GCN-LABEL: {{^}}atomic_xchg_i64_addr64:
714 ; GCN: flat_atomic_swap_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
715 define amdgpu_kernel void @atomic_xchg_i64_addr64(i64* %out, i64 %in, i64 %index) {
717 %ptr = getelementptr i64, i64* %out, i64 %index
718 %tmp0 = atomicrmw volatile xchg i64* %ptr, i64 %in seq_cst
722 ; GCN-LABEL: {{^}}atomic_xchg_i64_ret_addr64:
723 ; GCN: flat_atomic_swap_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
724 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
725 define amdgpu_kernel void @atomic_xchg_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
727 %ptr = getelementptr i64, i64* %out, i64 %index
728 %tmp0 = atomicrmw volatile xchg i64* %ptr, i64 %in seq_cst
729 store i64 %tmp0, i64* %out2
733 ; GCN-LABEL: {{^}}atomic_xor_i64_offset:
734 ; GCN: flat_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
735 define amdgpu_kernel void @atomic_xor_i64_offset(i64* %out, i64 %in) {
737 %gep = getelementptr i64, i64* %out, i64 4
738 %tmp0 = atomicrmw volatile xor i64* %gep, i64 %in seq_cst
742 ; GCN-LABEL: {{^}}atomic_xor_i64_ret_offset:
743 ; GCN: flat_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
744 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
745 define amdgpu_kernel void @atomic_xor_i64_ret_offset(i64* %out, i64* %out2, i64 %in) {
747 %gep = getelementptr i64, i64* %out, i64 4
748 %tmp0 = atomicrmw volatile xor i64* %gep, i64 %in seq_cst
749 store i64 %tmp0, i64* %out2
753 ; GCN-LABEL: {{^}}atomic_xor_i64_addr64_offset:
754 ; GCN: flat_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
755 define amdgpu_kernel void @atomic_xor_i64_addr64_offset(i64* %out, i64 %in, i64 %index) {
757 %ptr = getelementptr i64, i64* %out, i64 %index
758 %gep = getelementptr i64, i64* %ptr, i64 4
759 %tmp0 = atomicrmw volatile xor i64* %gep, i64 %in seq_cst
763 ; GCN-LABEL: {{^}}atomic_xor_i64_ret_addr64_offset:
764 ; GCN: flat_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
765 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
766 define amdgpu_kernel void @atomic_xor_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index) {
768 %ptr = getelementptr i64, i64* %out, i64 %index
769 %gep = getelementptr i64, i64* %ptr, i64 4
770 %tmp0 = atomicrmw volatile xor i64* %gep, i64 %in seq_cst
771 store i64 %tmp0, i64* %out2
775 ; GCN-LABEL: {{^}}atomic_xor_i64:
776 ; GCN: flat_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
777 define amdgpu_kernel void @atomic_xor_i64(i64* %out, i64 %in) {
779 %tmp0 = atomicrmw volatile xor i64* %out, i64 %in seq_cst
783 ; GCN-LABEL: {{^}}atomic_xor_i64_ret:
784 ; GCN: flat_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
785 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
786 define amdgpu_kernel void @atomic_xor_i64_ret(i64* %out, i64* %out2, i64 %in) {
788 %tmp0 = atomicrmw volatile xor i64* %out, i64 %in seq_cst
789 store i64 %tmp0, i64* %out2
793 ; GCN-LABEL: {{^}}atomic_xor_i64_addr64:
794 ; GCN: flat_atomic_xor_x2 v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]$}}
795 define amdgpu_kernel void @atomic_xor_i64_addr64(i64* %out, i64 %in, i64 %index) {
797 %ptr = getelementptr i64, i64* %out, i64 %index
798 %tmp0 = atomicrmw volatile xor i64* %ptr, i64 %in seq_cst
802 ; GCN-LABEL: {{^}}atomic_xor_i64_ret_addr64:
803 ; GCN: flat_atomic_xor_x2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}], v{{\[[0-9]+:[0-9]+\]}} glc{{$}}
804 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
805 define amdgpu_kernel void @atomic_xor_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index) {
807 %ptr = getelementptr i64, i64* %out, i64 %index
808 %tmp0 = atomicrmw volatile xor i64* %ptr, i64 %in seq_cst
809 store i64 %tmp0, i64* %out2
813 ; GCN-LABEL: {{^}}atomic_load_i64_offset:
814 ; GCN: flat_load_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}] glc{{$}}
815 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
816 define amdgpu_kernel void @atomic_load_i64_offset(i64* %in, i64* %out) {
818 %gep = getelementptr i64, i64* %in, i64 4
819 %val = load atomic i64, i64* %gep seq_cst, align 8
820 store i64 %val, i64* %out
824 ; GCN-LABEL: {{^}}atomic_load_i64:
825 ; GCN: flat_load_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}] glc
826 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
827 define amdgpu_kernel void @atomic_load_i64(i64* %in, i64* %out) {
829 %val = load atomic i64, i64* %in seq_cst, align 8
830 store i64 %val, i64* %out
834 ; GCN-LABEL: {{^}}atomic_load_i64_addr64_offset:
835 ; GCN: flat_load_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}] glc{{$}}
836 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
837 define amdgpu_kernel void @atomic_load_i64_addr64_offset(i64* %in, i64* %out, i64 %index) {
839 %ptr = getelementptr i64, i64* %in, i64 %index
840 %gep = getelementptr i64, i64* %ptr, i64 4
841 %val = load atomic i64, i64* %gep seq_cst, align 8
842 store i64 %val, i64* %out
846 ; GCN-LABEL: {{^}}atomic_load_i64_addr64:
847 ; GCN: flat_load_dwordx2 [[RET:v\[[0-9]+:[0-9]+\]]], v[{{[0-9]+:[0-9]+}}] glc{{$}}
848 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
849 define amdgpu_kernel void @atomic_load_i64_addr64(i64* %in, i64* %out, i64 %index) {
851 %ptr = getelementptr i64, i64* %in, i64 %index
852 %val = load atomic i64, i64* %ptr seq_cst, align 8
853 store i64 %val, i64* %out
857 ; GCN-LABEL: {{^}}atomic_store_i64_offset:
858 ; GCN: flat_store_dwordx2 [[RET:v\[[0-9]+:[0-9]\]]], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
859 define amdgpu_kernel void @atomic_store_i64_offset(i64 %in, i64* %out) {
861 %gep = getelementptr i64, i64* %out, i64 4
862 store atomic i64 %in, i64* %gep seq_cst, align 8
866 ; GCN-LABEL: {{^}}atomic_store_i64:
867 ; GCN: flat_store_dwordx2 {{v\[[0-9]+:[0-9]\]}}, v[{{[0-9]+}}:{{[0-9]+}}]
868 define amdgpu_kernel void @atomic_store_i64(i64 %in, i64* %out) {
870 store atomic i64 %in, i64* %out seq_cst, align 8
874 ; GCN-LABEL: {{^}}atomic_store_i64_addr64_offset:
875 ; GCN: flat_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}]{{$}}
876 define amdgpu_kernel void @atomic_store_i64_addr64_offset(i64 %in, i64* %out, i64 %index) {
878 %ptr = getelementptr i64, i64* %out, i64 %index
879 %gep = getelementptr i64, i64* %ptr, i64 4
880 store atomic i64 %in, i64* %gep seq_cst, align 8
884 ; GCN-LABEL: {{^}}atomic_store_i64_addr64:
885 ; GCN: flat_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}]{{$}}
886 define amdgpu_kernel void @atomic_store_i64_addr64(i64 %in, i64* %out, i64 %index) {
888 %ptr = getelementptr i64, i64* %out, i64 %index
889 store atomic i64 %in, i64* %ptr seq_cst, align 8
893 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_offset:
894 ; GCN: flat_atomic_cmpswap_x2 v[{{[0-9]+\:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
895 define amdgpu_kernel void @atomic_cmpxchg_i64_offset(i64* %out, i64 %in, i64 %old) {
897 %gep = getelementptr i64, i64* %out, i64 4
898 %val = cmpxchg volatile i64* %gep, i64 %old, i64 %in seq_cst seq_cst
902 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_soffset:
903 ; GCN: flat_atomic_cmpswap_x2 v[{{[0-9]+}}:{{[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
904 define amdgpu_kernel void @atomic_cmpxchg_i64_soffset(i64* %out, i64 %in, i64 %old) {
906 %gep = getelementptr i64, i64* %out, i64 9000
907 %val = cmpxchg volatile i64* %gep, i64 %old, i64 %in seq_cst seq_cst
911 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_ret_offset:
912 ; GCN: flat_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]{{:[0-9]+}}], v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}] glc{{$}}
913 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, v{{\[}}[[RET]]:
914 define amdgpu_kernel void @atomic_cmpxchg_i64_ret_offset(i64* %out, i64* %out2, i64 %in, i64 %old) {
916 %gep = getelementptr i64, i64* %out, i64 4
917 %val = cmpxchg volatile i64* %gep, i64 %old, i64 %in seq_cst seq_cst
918 %extract0 = extractvalue { i64, i1 } %val, 0
919 store i64 %extract0, i64* %out2
923 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_addr64_offset:
924 ; GCN: flat_atomic_cmpswap_x2 v[{{[0-9]+\:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
925 define amdgpu_kernel void @atomic_cmpxchg_i64_addr64_offset(i64* %out, i64 %in, i64 %index, i64 %old) {
927 %ptr = getelementptr i64, i64* %out, i64 %index
928 %gep = getelementptr i64, i64* %ptr, i64 4
929 %val = cmpxchg volatile i64* %gep, i64 %old, i64 %in seq_cst seq_cst
933 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_ret_addr64_offset:
934 ; GCN: flat_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}] glc{{$}}
935 ; GCN: flat_store_dwordx2 v{{\[[0-9]+:[0-9]+\]}}, v{{\[}}[[RET]]:
936 define amdgpu_kernel void @atomic_cmpxchg_i64_ret_addr64_offset(i64* %out, i64* %out2, i64 %in, i64 %index, i64 %old) {
938 %ptr = getelementptr i64, i64* %out, i64 %index
939 %gep = getelementptr i64, i64* %ptr, i64 4
940 %val = cmpxchg volatile i64* %gep, i64 %old, i64 %in seq_cst seq_cst
941 %extract0 = extractvalue { i64, i1 } %val, 0
942 store i64 %extract0, i64* %out2
946 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64:
947 ; GCN: flat_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}]{{$}}
948 define amdgpu_kernel void @atomic_cmpxchg_i64(i64* %out, i64 %in, i64 %old) {
950 %val = cmpxchg volatile i64* %out, i64 %old, i64 %in seq_cst seq_cst
954 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_ret:
955 ; GCN: flat_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}] glc{{$}}
956 ; GCN: flat_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v{{\[}}[[RET]]:
957 define amdgpu_kernel void @atomic_cmpxchg_i64_ret(i64* %out, i64* %out2, i64 %in, i64 %old) {
959 %val = cmpxchg volatile i64* %out, i64 %old, i64 %in seq_cst seq_cst
960 %extract0 = extractvalue { i64, i1 } %val, 0
961 store i64 %extract0, i64* %out2
965 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_addr64:
966 ; GCN: flat_atomic_cmpswap_x2 v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}]{{$}}
967 define amdgpu_kernel void @atomic_cmpxchg_i64_addr64(i64* %out, i64 %in, i64 %index, i64 %old) {
969 %ptr = getelementptr i64, i64* %out, i64 %index
970 %val = cmpxchg volatile i64* %ptr, i64 %old, i64 %in seq_cst seq_cst
974 ; GCN-LABEL: {{^}}atomic_cmpxchg_i64_ret_addr64:
975 ; GCN: flat_atomic_cmpswap_x2 v{{\[}}[[RET:[0-9]+]]:{{[0-9]+\]}}, v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}] glc{{$}}
976 ; GCN: flat_store_dwordx2 {{v\[[0-9]+:[0-9]+\]}}, v{{\[}}[[RET]]:
977 define amdgpu_kernel void @atomic_cmpxchg_i64_ret_addr64(i64* %out, i64* %out2, i64 %in, i64 %index, i64 %old) {
979 %ptr = getelementptr i64, i64* %out, i64 %index
980 %val = cmpxchg volatile i64* %ptr, i64 %old, i64 %in seq_cst seq_cst
981 %extract0 = extractvalue { i64, i1 } %val, 0
982 store i64 %extract0, i64* %out2