R600/SI: Store immediate offsets > 12-bits in soffset
[oota-llvm.git] / test / CodeGen / R600 / local-atomics64.ll
1 ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -strict-whitespace -check-prefix=SI %s
2
3 ; FUNC-LABEL: {{^}}lds_atomic_xchg_ret_i64:
4 ; SI: ds_wrxchg_rtn_b64
5 ; SI: s_endpgm
6 define void @lds_atomic_xchg_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
7   %result = atomicrmw xchg i64 addrspace(3)* %ptr, i64 4 seq_cst
8   store i64 %result, i64 addrspace(1)* %out, align 8
9   ret void
10 }
11
12 ; FUNC-LABEL: {{^}}lds_atomic_xchg_ret_i64_offset:
13 ; SI: ds_wrxchg_rtn_b64 {{.*}} offset:32
14 ; SI: s_endpgm
15 define void @lds_atomic_xchg_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
16   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
17   %result = atomicrmw xchg i64 addrspace(3)* %gep, i64 4 seq_cst
18   store i64 %result, i64 addrspace(1)* %out, align 8
19   ret void
20 }
21
22 ; FUNC-LABEL: {{^}}lds_atomic_add_ret_i64:
23 ; SI: ds_add_rtn_u64
24 ; SI: s_endpgm
25 define void @lds_atomic_add_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
26   %result = atomicrmw add i64 addrspace(3)* %ptr, i64 4 seq_cst
27   store i64 %result, i64 addrspace(1)* %out, align 8
28   ret void
29 }
30
31 ; FUNC-LABEL: {{^}}lds_atomic_add_ret_i64_offset:
32 ; SI: v_mov_b32_e32 v[[LOVDATA:[0-9]+]], 9
33 ; SI: v_mov_b32_e32 v[[HIVDATA:[0-9]+]], 0
34 ; SI: s_load_dword [[PTR:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0xb
35 ; SI-DAG: v_mov_b32_e32 [[VPTR:v[0-9]+]], [[PTR]]
36 ; SI: ds_add_rtn_u64 [[RESULT:v\[[0-9]+:[0-9]+\]]], [[VPTR]], v{{\[}}[[LOVDATA]]:[[HIVDATA]]{{\]}} offset:32 [M0]
37 ; SI: buffer_store_dwordx2 [[RESULT]],
38 ; SI: s_endpgm
39 define void @lds_atomic_add_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
40   %gep = getelementptr i64 addrspace(3)* %ptr, i64 4
41   %result = atomicrmw add i64 addrspace(3)* %gep, i64 9 seq_cst
42   store i64 %result, i64 addrspace(1)* %out, align 8
43   ret void
44 }
45
46 ; FUNC-LABEL: {{^}}lds_atomic_inc_ret_i64:
47 ; SI: v_mov_b32_e32 v[[LOVDATA:[0-9]+]], -1
48 ; SI: v_mov_b32_e32 v[[HIVDATA:[0-9]+]], -1
49 ; SI: ds_inc_rtn_u64 [[RESULT:v\[[0-9]+:[0-9]+\]]], [[VPTR]], v{{\[}}[[LOVDATA]]:[[HIVDATA]]{{\]}}
50 ; SI: buffer_store_dwordx2 [[RESULT]],
51 ; SI: s_endpgm
52 define void @lds_atomic_inc_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
53   %result = atomicrmw add i64 addrspace(3)* %ptr, i64 1 seq_cst
54   store i64 %result, i64 addrspace(1)* %out, align 8
55   ret void
56 }
57
58 ; FUNC-LABEL: {{^}}lds_atomic_inc_ret_i64_offset:
59 ; SI: ds_inc_rtn_u64 {{.*}} offset:32
60 ; SI: s_endpgm
61 define void @lds_atomic_inc_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
62   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
63   %result = atomicrmw add i64 addrspace(3)* %gep, i64 1 seq_cst
64   store i64 %result, i64 addrspace(1)* %out, align 8
65   ret void
66 }
67
68 ; FUNC-LABEL: {{^}}lds_atomic_sub_ret_i64:
69 ; SI: ds_sub_rtn_u64
70 ; SI: s_endpgm
71 define void @lds_atomic_sub_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
72   %result = atomicrmw sub i64 addrspace(3)* %ptr, i64 4 seq_cst
73   store i64 %result, i64 addrspace(1)* %out, align 8
74   ret void
75 }
76
77 ; FUNC-LABEL: {{^}}lds_atomic_sub_ret_i64_offset:
78 ; SI: ds_sub_rtn_u64 {{.*}} offset:32
79 ; SI: s_endpgm
80 define void @lds_atomic_sub_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
81   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
82   %result = atomicrmw sub i64 addrspace(3)* %gep, i64 4 seq_cst
83   store i64 %result, i64 addrspace(1)* %out, align 8
84   ret void
85 }
86
87 ; FUNC-LABEL: {{^}}lds_atomic_dec_ret_i64:
88 ; SI: v_mov_b32_e32 v[[LOVDATA:[0-9]+]], -1
89 ; SI: v_mov_b32_e32 v[[HIVDATA:[0-9]+]], -1
90 ; SI: ds_dec_rtn_u64 [[RESULT:v\[[0-9]+:[0-9]+\]]], [[VPTR]], v{{\[}}[[LOVDATA]]:[[HIVDATA]]{{\]}}
91 ; SI: buffer_store_dwordx2 [[RESULT]],
92 ; SI: s_endpgm
93 define void @lds_atomic_dec_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
94   %result = atomicrmw sub i64 addrspace(3)* %ptr, i64 1 seq_cst
95   store i64 %result, i64 addrspace(1)* %out, align 8
96   ret void
97 }
98
99 ; FUNC-LABEL: {{^}}lds_atomic_dec_ret_i64_offset:
100 ; SI: ds_dec_rtn_u64 {{.*}} offset:32
101 ; SI: s_endpgm
102 define void @lds_atomic_dec_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
103   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
104   %result = atomicrmw sub i64 addrspace(3)* %gep, i64 1 seq_cst
105   store i64 %result, i64 addrspace(1)* %out, align 8
106   ret void
107 }
108
109 ; FUNC-LABEL: {{^}}lds_atomic_and_ret_i64:
110 ; SI: ds_and_rtn_b64
111 ; SI: s_endpgm
112 define void @lds_atomic_and_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
113   %result = atomicrmw and i64 addrspace(3)* %ptr, i64 4 seq_cst
114   store i64 %result, i64 addrspace(1)* %out, align 8
115   ret void
116 }
117
118 ; FUNC-LABEL: {{^}}lds_atomic_and_ret_i64_offset:
119 ; SI: ds_and_rtn_b64 {{.*}} offset:32
120 ; SI: s_endpgm
121 define void @lds_atomic_and_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
122   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
123   %result = atomicrmw and i64 addrspace(3)* %gep, i64 4 seq_cst
124   store i64 %result, i64 addrspace(1)* %out, align 8
125   ret void
126 }
127
128 ; FUNC-LABEL: {{^}}lds_atomic_or_ret_i64:
129 ; SI: ds_or_rtn_b64
130 ; SI: s_endpgm
131 define void @lds_atomic_or_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
132   %result = atomicrmw or i64 addrspace(3)* %ptr, i64 4 seq_cst
133   store i64 %result, i64 addrspace(1)* %out, align 8
134   ret void
135 }
136
137 ; FUNC-LABEL: {{^}}lds_atomic_or_ret_i64_offset:
138 ; SI: ds_or_rtn_b64 {{.*}} offset:32
139 ; SI: s_endpgm
140 define void @lds_atomic_or_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
141   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
142   %result = atomicrmw or i64 addrspace(3)* %gep, i64 4 seq_cst
143   store i64 %result, i64 addrspace(1)* %out, align 8
144   ret void
145 }
146
147 ; FUNC-LABEL: {{^}}lds_atomic_xor_ret_i64:
148 ; SI: ds_xor_rtn_b64
149 ; SI: s_endpgm
150 define void @lds_atomic_xor_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
151   %result = atomicrmw xor i64 addrspace(3)* %ptr, i64 4 seq_cst
152   store i64 %result, i64 addrspace(1)* %out, align 8
153   ret void
154 }
155
156 ; FUNC-LABEL: {{^}}lds_atomic_xor_ret_i64_offset:
157 ; SI: ds_xor_rtn_b64 {{.*}} offset:32
158 ; SI: s_endpgm
159 define void @lds_atomic_xor_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
160   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
161   %result = atomicrmw xor i64 addrspace(3)* %gep, i64 4 seq_cst
162   store i64 %result, i64 addrspace(1)* %out, align 8
163   ret void
164 }
165
166 ; FIXME: There is no atomic nand instr
167 ; XFUNC-LABEL: {{^}}lds_atomic_nand_ret_i64:uction, so we somehow need to expand this.
168 ; define void @lds_atomic_nand_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
169 ;   %result = atomicrmw nand i64 addrspace(3)* %ptr, i32 4 seq_cst
170 ;   store i64 %result, i64 addrspace(1)* %out, align 8
171 ;   ret void
172 ; }
173
174 ; FUNC-LABEL: {{^}}lds_atomic_min_ret_i64:
175 ; SI: ds_min_rtn_i64
176 ; SI: s_endpgm
177 define void @lds_atomic_min_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
178   %result = atomicrmw min i64 addrspace(3)* %ptr, i64 4 seq_cst
179   store i64 %result, i64 addrspace(1)* %out, align 8
180   ret void
181 }
182
183 ; FUNC-LABEL: {{^}}lds_atomic_min_ret_i64_offset:
184 ; SI: ds_min_rtn_i64 {{.*}} offset:32
185 ; SI: s_endpgm
186 define void @lds_atomic_min_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
187   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
188   %result = atomicrmw min i64 addrspace(3)* %gep, i64 4 seq_cst
189   store i64 %result, i64 addrspace(1)* %out, align 8
190   ret void
191 }
192
193 ; FUNC-LABEL: {{^}}lds_atomic_max_ret_i64:
194 ; SI: ds_max_rtn_i64
195 ; SI: s_endpgm
196 define void @lds_atomic_max_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
197   %result = atomicrmw max i64 addrspace(3)* %ptr, i64 4 seq_cst
198   store i64 %result, i64 addrspace(1)* %out, align 8
199   ret void
200 }
201
202 ; FUNC-LABEL: {{^}}lds_atomic_max_ret_i64_offset:
203 ; SI: ds_max_rtn_i64 {{.*}} offset:32
204 ; SI: s_endpgm
205 define void @lds_atomic_max_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
206   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
207   %result = atomicrmw max i64 addrspace(3)* %gep, i64 4 seq_cst
208   store i64 %result, i64 addrspace(1)* %out, align 8
209   ret void
210 }
211
212 ; FUNC-LABEL: {{^}}lds_atomic_umin_ret_i64:
213 ; SI: ds_min_rtn_u64
214 ; SI: s_endpgm
215 define void @lds_atomic_umin_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
216   %result = atomicrmw umin i64 addrspace(3)* %ptr, i64 4 seq_cst
217   store i64 %result, i64 addrspace(1)* %out, align 8
218   ret void
219 }
220
221 ; FUNC-LABEL: {{^}}lds_atomic_umin_ret_i64_offset:
222 ; SI: ds_min_rtn_u64 {{.*}} offset:32
223 ; SI: s_endpgm
224 define void @lds_atomic_umin_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
225   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
226   %result = atomicrmw umin i64 addrspace(3)* %gep, i64 4 seq_cst
227   store i64 %result, i64 addrspace(1)* %out, align 8
228   ret void
229 }
230
231 ; FUNC-LABEL: {{^}}lds_atomic_umax_ret_i64:
232 ; SI: ds_max_rtn_u64
233 ; SI: s_endpgm
234 define void @lds_atomic_umax_ret_i64(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
235   %result = atomicrmw umax i64 addrspace(3)* %ptr, i64 4 seq_cst
236   store i64 %result, i64 addrspace(1)* %out, align 8
237   ret void
238 }
239
240 ; FUNC-LABEL: {{^}}lds_atomic_umax_ret_i64_offset:
241 ; SI: ds_max_rtn_u64 {{.*}} offset:32
242 ; SI: s_endpgm
243 define void @lds_atomic_umax_ret_i64_offset(i64 addrspace(1)* %out, i64 addrspace(3)* %ptr) nounwind {
244   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
245   %result = atomicrmw umax i64 addrspace(3)* %gep, i64 4 seq_cst
246   store i64 %result, i64 addrspace(1)* %out, align 8
247   ret void
248 }
249
250 ; FUNC-LABEL: {{^}}lds_atomic_xchg_noret_i64:
251 ; SI: ds_wrxchg_rtn_b64
252 ; SI: s_endpgm
253 define void @lds_atomic_xchg_noret_i64(i64 addrspace(3)* %ptr) nounwind {
254   %result = atomicrmw xchg i64 addrspace(3)* %ptr, i64 4 seq_cst
255   ret void
256 }
257
258 ; FUNC-LABEL: {{^}}lds_atomic_xchg_noret_i64_offset:
259 ; SI: ds_wrxchg_rtn_b64 {{.*}} offset:32
260 ; SI: s_endpgm
261 define void @lds_atomic_xchg_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
262   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
263   %result = atomicrmw xchg i64 addrspace(3)* %gep, i64 4 seq_cst
264   ret void
265 }
266
267 ; FUNC-LABEL: {{^}}lds_atomic_add_noret_i64:
268 ; SI: ds_add_u64
269 ; SI: s_endpgm
270 define void @lds_atomic_add_noret_i64(i64 addrspace(3)* %ptr) nounwind {
271   %result = atomicrmw add i64 addrspace(3)* %ptr, i64 4 seq_cst
272   ret void
273 }
274
275 ; FUNC-LABEL: {{^}}lds_atomic_add_noret_i64_offset:
276 ; SI: s_load_dword [[PTR:s[0-9]+]], s{{\[[0-9]+:[0-9]+\]}}, 0x9
277 ; SI: v_mov_b32_e32 v[[LOVDATA:[0-9]+]], 9
278 ; SI: v_mov_b32_e32 v[[HIVDATA:[0-9]+]], 0
279 ; SI: v_mov_b32_e32 [[VPTR:v[0-9]+]], [[PTR]]
280 ; SI: ds_add_u64 [[VPTR]], v{{\[}}[[LOVDATA]]:[[HIVDATA]]{{\]}} offset:32 [M0]
281 ; SI: s_endpgm
282 define void @lds_atomic_add_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
283   %gep = getelementptr i64 addrspace(3)* %ptr, i64 4
284   %result = atomicrmw add i64 addrspace(3)* %gep, i64 9 seq_cst
285   ret void
286 }
287
288 ; FUNC-LABEL: {{^}}lds_atomic_inc_noret_i64:
289 ; SI: v_mov_b32_e32 v[[LOVDATA:[0-9]+]], -1
290 ; SI: v_mov_b32_e32 v[[HIVDATA:[0-9]+]], -1
291 ; SI: ds_inc_u64 [[VPTR]], v{{\[}}[[LOVDATA]]:[[HIVDATA]]{{\]}}
292 ; SI: s_endpgm
293 define void @lds_atomic_inc_noret_i64(i64 addrspace(3)* %ptr) nounwind {
294   %result = atomicrmw add i64 addrspace(3)* %ptr, i64 1 seq_cst
295   ret void
296 }
297
298 ; FUNC-LABEL: {{^}}lds_atomic_inc_noret_i64_offset:
299 ; SI: ds_inc_u64 {{.*}} offset:32
300 ; SI: s_endpgm
301 define void @lds_atomic_inc_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
302   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
303   %result = atomicrmw add i64 addrspace(3)* %gep, i64 1 seq_cst
304   ret void
305 }
306
307 ; FUNC-LABEL: {{^}}lds_atomic_sub_noret_i64:
308 ; SI: ds_sub_u64
309 ; SI: s_endpgm
310 define void @lds_atomic_sub_noret_i64(i64 addrspace(3)* %ptr) nounwind {
311   %result = atomicrmw sub i64 addrspace(3)* %ptr, i64 4 seq_cst
312   ret void
313 }
314
315 ; FUNC-LABEL: {{^}}lds_atomic_sub_noret_i64_offset:
316 ; SI: ds_sub_u64 {{.*}} offset:32
317 ; SI: s_endpgm
318 define void @lds_atomic_sub_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
319   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
320   %result = atomicrmw sub i64 addrspace(3)* %gep, i64 4 seq_cst
321   ret void
322 }
323
324 ; FUNC-LABEL: {{^}}lds_atomic_dec_noret_i64:
325 ; SI: v_mov_b32_e32 v[[LOVDATA:[0-9]+]], -1
326 ; SI: v_mov_b32_e32 v[[HIVDATA:[0-9]+]], -1
327 ; SI: ds_dec_u64 [[VPTR]], v{{\[}}[[LOVDATA]]:[[HIVDATA]]{{\]}}
328 ; SI: s_endpgm
329 define void @lds_atomic_dec_noret_i64(i64 addrspace(3)* %ptr) nounwind {
330   %result = atomicrmw sub i64 addrspace(3)* %ptr, i64 1 seq_cst
331   ret void
332 }
333
334 ; FUNC-LABEL: {{^}}lds_atomic_dec_noret_i64_offset:
335 ; SI: ds_dec_u64 {{.*}} offset:32
336 ; SI: s_endpgm
337 define void @lds_atomic_dec_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
338   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
339   %result = atomicrmw sub i64 addrspace(3)* %gep, i64 1 seq_cst
340   ret void
341 }
342
343 ; FUNC-LABEL: {{^}}lds_atomic_and_noret_i64:
344 ; SI: ds_and_b64
345 ; SI: s_endpgm
346 define void @lds_atomic_and_noret_i64(i64 addrspace(3)* %ptr) nounwind {
347   %result = atomicrmw and i64 addrspace(3)* %ptr, i64 4 seq_cst
348   ret void
349 }
350
351 ; FUNC-LABEL: {{^}}lds_atomic_and_noret_i64_offset:
352 ; SI: ds_and_b64 {{.*}} offset:32
353 ; SI: s_endpgm
354 define void @lds_atomic_and_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
355   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
356   %result = atomicrmw and i64 addrspace(3)* %gep, i64 4 seq_cst
357   ret void
358 }
359
360 ; FUNC-LABEL: {{^}}lds_atomic_or_noret_i64:
361 ; SI: ds_or_b64
362 ; SI: s_endpgm
363 define void @lds_atomic_or_noret_i64(i64 addrspace(3)* %ptr) nounwind {
364   %result = atomicrmw or i64 addrspace(3)* %ptr, i64 4 seq_cst
365   ret void
366 }
367
368 ; FUNC-LABEL: {{^}}lds_atomic_or_noret_i64_offset:
369 ; SI: ds_or_b64 {{.*}} offset:32
370 ; SI: s_endpgm
371 define void @lds_atomic_or_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
372   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
373   %result = atomicrmw or i64 addrspace(3)* %gep, i64 4 seq_cst
374   ret void
375 }
376
377 ; FUNC-LABEL: {{^}}lds_atomic_xor_noret_i64:
378 ; SI: ds_xor_b64
379 ; SI: s_endpgm
380 define void @lds_atomic_xor_noret_i64(i64 addrspace(3)* %ptr) nounwind {
381   %result = atomicrmw xor i64 addrspace(3)* %ptr, i64 4 seq_cst
382   ret void
383 }
384
385 ; FUNC-LABEL: {{^}}lds_atomic_xor_noret_i64_offset:
386 ; SI: ds_xor_b64 {{.*}} offset:32
387 ; SI: s_endpgm
388 define void @lds_atomic_xor_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
389   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
390   %result = atomicrmw xor i64 addrspace(3)* %gep, i64 4 seq_cst
391   ret void
392 }
393
394 ; FIXME: There is no atomic nand instr
395 ; XFUNC-LABEL: {{^}}lds_atomic_nand_noret_i64:uction, so we somehow need to expand this.
396 ; define void @lds_atomic_nand_noret_i64(i64 addrspace(3)* %ptr) nounwind {
397 ;   %result = atomicrmw nand i64 addrspace(3)* %ptr, i32 4 seq_cst
398 ;   ret void
399 ; }
400
401 ; FUNC-LABEL: {{^}}lds_atomic_min_noret_i64:
402 ; SI: ds_min_i64
403 ; SI: s_endpgm
404 define void @lds_atomic_min_noret_i64(i64 addrspace(3)* %ptr) nounwind {
405   %result = atomicrmw min i64 addrspace(3)* %ptr, i64 4 seq_cst
406   ret void
407 }
408
409 ; FUNC-LABEL: {{^}}lds_atomic_min_noret_i64_offset:
410 ; SI: ds_min_i64 {{.*}} offset:32
411 ; SI: s_endpgm
412 define void @lds_atomic_min_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
413   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
414   %result = atomicrmw min i64 addrspace(3)* %gep, i64 4 seq_cst
415   ret void
416 }
417
418 ; FUNC-LABEL: {{^}}lds_atomic_max_noret_i64:
419 ; SI: ds_max_i64
420 ; SI: s_endpgm
421 define void @lds_atomic_max_noret_i64(i64 addrspace(3)* %ptr) nounwind {
422   %result = atomicrmw max i64 addrspace(3)* %ptr, i64 4 seq_cst
423   ret void
424 }
425
426 ; FUNC-LABEL: {{^}}lds_atomic_max_noret_i64_offset:
427 ; SI: ds_max_i64 {{.*}} offset:32
428 ; SI: s_endpgm
429 define void @lds_atomic_max_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
430   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
431   %result = atomicrmw max i64 addrspace(3)* %gep, i64 4 seq_cst
432   ret void
433 }
434
435 ; FUNC-LABEL: {{^}}lds_atomic_umin_noret_i64:
436 ; SI: ds_min_u64
437 ; SI: s_endpgm
438 define void @lds_atomic_umin_noret_i64(i64 addrspace(3)* %ptr) nounwind {
439   %result = atomicrmw umin i64 addrspace(3)* %ptr, i64 4 seq_cst
440   ret void
441 }
442
443 ; FUNC-LABEL: {{^}}lds_atomic_umin_noret_i64_offset:
444 ; SI: ds_min_u64 {{.*}} offset:32
445 ; SI: s_endpgm
446 define void @lds_atomic_umin_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
447   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
448   %result = atomicrmw umin i64 addrspace(3)* %gep, i64 4 seq_cst
449   ret void
450 }
451
452 ; FUNC-LABEL: {{^}}lds_atomic_umax_noret_i64:
453 ; SI: ds_max_u64
454 ; SI: s_endpgm
455 define void @lds_atomic_umax_noret_i64(i64 addrspace(3)* %ptr) nounwind {
456   %result = atomicrmw umax i64 addrspace(3)* %ptr, i64 4 seq_cst
457   ret void
458 }
459
460 ; FUNC-LABEL: {{^}}lds_atomic_umax_noret_i64_offset:
461 ; SI: ds_max_u64 {{.*}} offset:32
462 ; SI: s_endpgm
463 define void @lds_atomic_umax_noret_i64_offset(i64 addrspace(3)* %ptr) nounwind {
464   %gep = getelementptr i64 addrspace(3)* %ptr, i32 4
465   %result = atomicrmw umax i64 addrspace(3)* %gep, i64 4 seq_cst
466   ret void
467 }