1; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=SI -check-prefix=FUNC %s
2; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=VI -check-prefix=FUNC %s
3
4; FUNC-LABEL: {{^}}atomic_add_i32_offset:
5; GCN: buffer_atomic_add v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
6define void @atomic_add_i32_offset(i32 addrspace(1)* %out, i32 %in) {
7entry:
8  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
9  %val = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
10  ret void
11}
12
13; FUNC-LABEL: {{^}}atomic_add_i32_soffset:
14; GCN: s_mov_b32 [[SREG:s[0-9]+]], 0x8ca0
15; GCN: buffer_atomic_add v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], [[SREG]]{{$}}
16define void @atomic_add_i32_soffset(i32 addrspace(1)* %out, i32 %in) {
17entry:
18  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 9000
19  %val = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
20  ret void
21}
22
23; FUNC-LABEL: {{^}}atomic_add_i32_huge_offset:
24; SI-DAG: v_mov_b32_e32 v[[PTRLO:[0-9]+]], 0xdeac
25; SI-DAG: v_mov_b32_e32 v[[PTRHI:[0-9]+]], 0xabcd
26; SI: buffer_atomic_add v{{[0-9]+}}, v{{\[}}[[PTRLO]]:[[PTRHI]]{{\]}}, s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
27; VI: flat_atomic_add
28define void @atomic_add_i32_huge_offset(i32 addrspace(1)* %out, i32 %in) {
29entry:
30  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 47224239175595
31
32  %val = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
33  ret void
34}
35
36; FUNC-LABEL: {{^}}atomic_add_i32_ret_offset:
37; GCN: buffer_atomic_add [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
38; GCN: buffer_store_dword [[RET]]
39define void @atomic_add_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
40entry:
41  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
42  %val = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
43  store i32 %val, i32 addrspace(1)* %out2
44  ret void
45}
46
47; FUNC-LABEL: {{^}}atomic_add_i32_addr64_offset:
48; SI: buffer_atomic_add v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
49; VI: flat_atomic_add v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
50define void @atomic_add_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
51entry:
52  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
53  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
54  %val = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
55  ret void
56}
57
58; FUNC-LABEL: {{^}}atomic_add_i32_ret_addr64_offset:
59; SI: buffer_atomic_add [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
60; VI: flat_atomic_add [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
61; GCN: buffer_store_dword [[RET]]
62define void @atomic_add_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
63entry:
64  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
65  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
66  %val = atomicrmw volatile add i32 addrspace(1)* %gep, i32 %in seq_cst
67  store i32 %val, i32 addrspace(1)* %out2
68  ret void
69}
70
71; FUNC-LABEL: {{^}}atomic_add_i32:
72; GCN: buffer_atomic_add v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
73define void @atomic_add_i32(i32 addrspace(1)* %out, i32 %in) {
74entry:
75  %val = atomicrmw volatile add i32 addrspace(1)* %out, i32 %in seq_cst
76  ret void
77}
78
79; FUNC-LABEL: {{^}}atomic_add_i32_ret:
80; GCN: buffer_atomic_add [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
81; GCN: buffer_store_dword [[RET]]
82define void @atomic_add_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
83entry:
84  %val = atomicrmw volatile add i32 addrspace(1)* %out, i32 %in seq_cst
85  store i32 %val, i32 addrspace(1)* %out2
86  ret void
87}
88
89; FUNC-LABEL: {{^}}atomic_add_i32_addr64:
90; SI: buffer_atomic_add v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
91; VI: flat_atomic_add v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
92define void @atomic_add_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
93entry:
94  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
95  %val = atomicrmw volatile add i32 addrspace(1)* %ptr, i32 %in seq_cst
96  ret void
97}
98
99; FUNC-LABEL: {{^}}atomic_add_i32_ret_addr64:
100; SI: buffer_atomic_add [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
101; VI: flat_atomic_add [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
102; GCN: buffer_store_dword [[RET]]
103define void @atomic_add_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
104entry:
105  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
106  %val = atomicrmw volatile add i32 addrspace(1)* %ptr, i32 %in seq_cst
107  store i32 %val, i32 addrspace(1)* %out2
108  ret void
109}
110
111; FUNC-LABEL: {{^}}atomic_and_i32_offset:
112; GCN: buffer_atomic_and v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
113define void @atomic_and_i32_offset(i32 addrspace(1)* %out, i32 %in) {
114entry:
115  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
116  %val = atomicrmw volatile and i32 addrspace(1)* %gep, i32 %in seq_cst
117  ret void
118}
119
120; FUNC-LABEL: {{^}}atomic_and_i32_ret_offset:
121; GCN: buffer_atomic_and [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
122; GCN: buffer_store_dword [[RET]]
123define void @atomic_and_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
124entry:
125  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
126  %val = atomicrmw volatile and i32 addrspace(1)* %gep, i32 %in seq_cst
127  store i32 %val, i32 addrspace(1)* %out2
128  ret void
129}
130
131; FUNC-LABEL: {{^}}atomic_and_i32_addr64_offset:
132; SI: buffer_atomic_and v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
133; VI: flat_atomic_and v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
134define void @atomic_and_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
135entry:
136  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
137  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
138  %val = atomicrmw volatile and i32 addrspace(1)* %gep, i32 %in seq_cst
139  ret void
140}
141
142; FUNC-LABEL: {{^}}atomic_and_i32_ret_addr64_offset:
143; SI: buffer_atomic_and [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
144; VI: flat_atomic_and [[RET:v[0-9]]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
145; GCN: buffer_store_dword [[RET]]
146define void @atomic_and_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
147entry:
148  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
149  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
150  %val = atomicrmw volatile and i32 addrspace(1)* %gep, i32 %in seq_cst
151  store i32 %val, i32 addrspace(1)* %out2
152  ret void
153}
154
155; FUNC-LABEL: {{^}}atomic_and_i32:
156; GCN: buffer_atomic_and v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
157define void @atomic_and_i32(i32 addrspace(1)* %out, i32 %in) {
158entry:
159  %val = atomicrmw volatile and i32 addrspace(1)* %out, i32 %in seq_cst
160  ret void
161}
162
163; FUNC-LABEL: {{^}}atomic_and_i32_ret:
164; GCN: buffer_atomic_and [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
165; GCN: buffer_store_dword [[RET]]
166define void @atomic_and_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
167entry:
168  %val = atomicrmw volatile and i32 addrspace(1)* %out, i32 %in seq_cst
169  store i32 %val, i32 addrspace(1)* %out2
170  ret void
171}
172
173; FUNC-LABEL: {{^}}atomic_and_i32_addr64:
174; SI: buffer_atomic_and v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
175; VI: flat_atomic_and v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
176define void @atomic_and_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
177entry:
178  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
179  %val = atomicrmw volatile and i32 addrspace(1)* %ptr, i32 %in seq_cst
180  ret void
181}
182
183; FUNC-LABEL: {{^}}atomic_and_i32_ret_addr64:
184; SI: buffer_atomic_and [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
185; VI: flat_atomic_and [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
186; GCN: buffer_store_dword [[RET]]
187define void @atomic_and_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
188entry:
189  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
190  %val = atomicrmw volatile and i32 addrspace(1)* %ptr, i32 %in seq_cst
191  store i32 %val, i32 addrspace(1)* %out2
192  ret void
193}
194
195; FUNC-LABEL: {{^}}atomic_sub_i32_offset:
196; GCN: buffer_atomic_sub v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
197define void @atomic_sub_i32_offset(i32 addrspace(1)* %out, i32 %in) {
198entry:
199  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
200  %val = atomicrmw volatile sub i32 addrspace(1)* %gep, i32 %in seq_cst
201  ret void
202}
203
204; FUNC-LABEL: {{^}}atomic_sub_i32_ret_offset:
205; GCN: buffer_atomic_sub [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
206; GCN: buffer_store_dword [[RET]]
207define void @atomic_sub_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
208entry:
209  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
210  %val = atomicrmw volatile sub i32 addrspace(1)* %gep, i32 %in seq_cst
211  store i32 %val, i32 addrspace(1)* %out2
212  ret void
213}
214
215; FUNC-LABEL: {{^}}atomic_sub_i32_addr64_offset:
216; SI: buffer_atomic_sub v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
217; VI: flat_atomic_sub v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
218define void @atomic_sub_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
219entry:
220  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
221  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
222  %val = atomicrmw volatile sub i32 addrspace(1)* %gep, i32 %in seq_cst
223  ret void
224}
225
226; FUNC-LABEL: {{^}}atomic_sub_i32_ret_addr64_offset:
227; SI: buffer_atomic_sub [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
228; VI: flat_atomic_sub [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
229; GCN: buffer_store_dword [[RET]]
230define void @atomic_sub_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
231entry:
232  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
233  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
234  %val = atomicrmw volatile sub i32 addrspace(1)* %gep, i32 %in seq_cst
235  store i32 %val, i32 addrspace(1)* %out2
236  ret void
237}
238
239; FUNC-LABEL: {{^}}atomic_sub_i32:
240; GCN: buffer_atomic_sub v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
241define void @atomic_sub_i32(i32 addrspace(1)* %out, i32 %in) {
242entry:
243  %val = atomicrmw volatile sub i32 addrspace(1)* %out, i32 %in seq_cst
244  ret void
245}
246
247; FUNC-LABEL: {{^}}atomic_sub_i32_ret:
248; GCN: buffer_atomic_sub [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
249; GCN: buffer_store_dword [[RET]]
250define void @atomic_sub_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
251entry:
252  %val = atomicrmw volatile sub i32 addrspace(1)* %out, i32 %in seq_cst
253  store i32 %val, i32 addrspace(1)* %out2
254  ret void
255}
256
257; FUNC-LABEL: {{^}}atomic_sub_i32_addr64:
258; SI: buffer_atomic_sub v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
259; VI: flat_atomic_sub v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
260define void @atomic_sub_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
261entry:
262  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
263  %val = atomicrmw volatile sub i32 addrspace(1)* %ptr, i32 %in seq_cst
264  ret void
265}
266
267; FUNC-LABEL: {{^}}atomic_sub_i32_ret_addr64:
268; SI: buffer_atomic_sub [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
269; VI: flat_atomic_sub [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
270; GCN: buffer_store_dword [[RET]]
271define void @atomic_sub_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
272entry:
273  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
274  %val = atomicrmw volatile sub i32 addrspace(1)* %ptr, i32 %in seq_cst
275  store i32 %val, i32 addrspace(1)* %out2
276  ret void
277}
278
279; FUNC-LABEL: {{^}}atomic_max_i32_offset:
280; GCN: buffer_atomic_smax v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
281define void @atomic_max_i32_offset(i32 addrspace(1)* %out, i32 %in) {
282entry:
283  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
284  %val = atomicrmw volatile max i32 addrspace(1)* %gep, i32 %in seq_cst
285  ret void
286}
287
288; FUNC-LABEL: {{^}}atomic_max_i32_ret_offset:
289; GCN: buffer_atomic_smax [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
290; GCN: buffer_store_dword [[RET]]
291define void @atomic_max_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
292entry:
293  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
294  %val = atomicrmw volatile max i32 addrspace(1)* %gep, i32 %in seq_cst
295  store i32 %val, i32 addrspace(1)* %out2
296  ret void
297}
298
299; FUNC-LABEL: {{^}}atomic_max_i32_addr64_offset:
300; SI: buffer_atomic_smax v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
301; VI: flat_atomic_smax v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
302define void @atomic_max_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
303entry:
304  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
305  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
306  %val = atomicrmw volatile max i32 addrspace(1)* %gep, i32 %in seq_cst
307  ret void
308}
309
310; FUNC-LABEL: {{^}}atomic_max_i32_ret_addr64_offset:
311; SI: buffer_atomic_smax [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
312; VI: flat_atomic_smax [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
313; GCN: buffer_store_dword [[RET]]
314define void @atomic_max_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
315entry:
316  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
317  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
318  %val = atomicrmw volatile max i32 addrspace(1)* %gep, i32 %in seq_cst
319  store i32 %val, i32 addrspace(1)* %out2
320  ret void
321}
322
323; FUNC-LABEL: {{^}}atomic_max_i32:
324; GCN: buffer_atomic_smax v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
325define void @atomic_max_i32(i32 addrspace(1)* %out, i32 %in) {
326entry:
327  %val = atomicrmw volatile max i32 addrspace(1)* %out, i32 %in seq_cst
328  ret void
329}
330
331; FUNC-LABEL: {{^}}atomic_max_i32_ret:
332; GCN: buffer_atomic_smax [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
333; GCN: buffer_store_dword [[RET]]
334define void @atomic_max_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
335entry:
336  %val = atomicrmw volatile max i32 addrspace(1)* %out, i32 %in seq_cst
337  store i32 %val, i32 addrspace(1)* %out2
338  ret void
339}
340
341; FUNC-LABEL: {{^}}atomic_max_i32_addr64:
342; SI: buffer_atomic_smax v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
343; VI: flat_atomic_smax v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
344define void @atomic_max_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
345entry:
346  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
347  %val = atomicrmw volatile max i32 addrspace(1)* %ptr, i32 %in seq_cst
348  ret void
349}
350
351; FUNC-LABEL: {{^}}atomic_max_i32_ret_addr64:
352; SI: buffer_atomic_smax [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
353; VI: flat_atomic_smax [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
354; GCN: buffer_store_dword [[RET]]
355define void @atomic_max_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
356entry:
357  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
358  %val = atomicrmw volatile max i32 addrspace(1)* %ptr, i32 %in seq_cst
359  store i32 %val, i32 addrspace(1)* %out2
360  ret void
361}
362
363; FUNC-LABEL: {{^}}atomic_umax_i32_offset:
364; GCN: buffer_atomic_umax v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
365define void @atomic_umax_i32_offset(i32 addrspace(1)* %out, i32 %in) {
366entry:
367  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
368  %val = atomicrmw volatile umax i32 addrspace(1)* %gep, i32 %in seq_cst
369  ret void
370}
371
372; FUNC-LABEL: {{^}}atomic_umax_i32_ret_offset:
373; GCN: buffer_atomic_umax [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
374; GCN: buffer_store_dword [[RET]]
375define void @atomic_umax_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
376entry:
377  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
378  %val = atomicrmw volatile umax i32 addrspace(1)* %gep, i32 %in seq_cst
379  store i32 %val, i32 addrspace(1)* %out2
380  ret void
381}
382
383; FUNC-LABEL: {{^}}atomic_umax_i32_addr64_offset:
384; SI: buffer_atomic_umax v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
385; VI: flat_atomic_umax v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
386define void @atomic_umax_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
387entry:
388  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
389  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
390  %val = atomicrmw volatile umax i32 addrspace(1)* %gep, i32 %in seq_cst
391  ret void
392}
393
394; FUNC-LABEL: {{^}}atomic_umax_i32_ret_addr64_offset:
395; SI: buffer_atomic_umax [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
396; VI: flat_atomic_umax [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
397; GCN: buffer_store_dword [[RET]]
398define void @atomic_umax_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
399entry:
400  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
401  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
402  %val = atomicrmw volatile umax i32 addrspace(1)* %gep, i32 %in seq_cst
403  store i32 %val, i32 addrspace(1)* %out2
404  ret void
405}
406
407; FUNC-LABEL: {{^}}atomic_umax_i32:
408; GCN: buffer_atomic_umax v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
409define void @atomic_umax_i32(i32 addrspace(1)* %out, i32 %in) {
410entry:
411  %val = atomicrmw volatile umax i32 addrspace(1)* %out, i32 %in seq_cst
412  ret void
413}
414
415; FUNC-LABEL: {{^}}atomic_umax_i32_ret:
416; GCN: buffer_atomic_umax [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
417; GCN: buffer_store_dword [[RET]]
418define void @atomic_umax_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
419entry:
420  %val = atomicrmw volatile umax i32 addrspace(1)* %out, i32 %in seq_cst
421  store i32 %val, i32 addrspace(1)* %out2
422  ret void
423}
424
425; FUNC-LABEL: {{^}}atomic_umax_i32_addr64:
426; SI: buffer_atomic_umax v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
427; VI: flat_atomic_umax v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
428define void @atomic_umax_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
429entry:
430  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
431  %val = atomicrmw volatile umax i32 addrspace(1)* %ptr, i32 %in seq_cst
432  ret void
433}
434
435; FUNC-LABEL: {{^}}atomic_umax_i32_ret_addr64:
436; SI: buffer_atomic_umax [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
437; VI: flat_atomic_umax [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
438; GCN: buffer_store_dword [[RET]]
439define void @atomic_umax_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
440entry:
441  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
442  %val = atomicrmw volatile umax i32 addrspace(1)* %ptr, i32 %in seq_cst
443  store i32 %val, i32 addrspace(1)* %out2
444  ret void
445}
446
447; FUNC-LABEL: {{^}}atomic_min_i32_offset:
448; GCN: buffer_atomic_smin v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
449define void @atomic_min_i32_offset(i32 addrspace(1)* %out, i32 %in) {
450entry:
451  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
452  %val = atomicrmw volatile min i32 addrspace(1)* %gep, i32 %in seq_cst
453  ret void
454}
455
456; FUNC-LABEL: {{^}}atomic_min_i32_ret_offset:
457; GCN: buffer_atomic_smin [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
458; GCN: buffer_store_dword [[RET]]
459define void @atomic_min_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
460entry:
461  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
462  %val = atomicrmw volatile min i32 addrspace(1)* %gep, i32 %in seq_cst
463  store i32 %val, i32 addrspace(1)* %out2
464  ret void
465}
466
467; FUNC-LABEL: {{^}}atomic_min_i32_addr64_offset:
468; SI: buffer_atomic_smin v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
469; VI: flat_atomic_smin v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
470define void @atomic_min_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
471entry:
472  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
473  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
474  %val = atomicrmw volatile min i32 addrspace(1)* %gep, i32 %in seq_cst
475  ret void
476}
477
478; FUNC-LABEL: {{^}}atomic_min_i32_ret_addr64_offset:
479; SI: buffer_atomic_smin [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
480; VI: flat_atomic_smin [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
481; GCN: buffer_store_dword [[RET]]
482define void @atomic_min_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
483entry:
484  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
485  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
486  %val = atomicrmw volatile min i32 addrspace(1)* %gep, i32 %in seq_cst
487  store i32 %val, i32 addrspace(1)* %out2
488  ret void
489}
490
491; FUNC-LABEL: {{^}}atomic_min_i32:
492; GCN: buffer_atomic_smin v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
493define void @atomic_min_i32(i32 addrspace(1)* %out, i32 %in) {
494entry:
495  %val = atomicrmw volatile min i32 addrspace(1)* %out, i32 %in seq_cst
496  ret void
497}
498
499; FUNC-LABEL: {{^}}atomic_min_i32_ret:
500; GCN: buffer_atomic_smin [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
501; GCN: buffer_store_dword [[RET]]
502define void @atomic_min_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
503entry:
504  %val = atomicrmw volatile min i32 addrspace(1)* %out, i32 %in seq_cst
505  store i32 %val, i32 addrspace(1)* %out2
506  ret void
507}
508
509; FUNC-LABEL: {{^}}atomic_min_i32_addr64:
510; SI: buffer_atomic_smin v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
511; VI: flat_atomic_smin v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
512define void @atomic_min_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
513entry:
514  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
515  %val = atomicrmw volatile min i32 addrspace(1)* %ptr, i32 %in seq_cst
516  ret void
517}
518
519; FUNC-LABEL: {{^}}atomic_min_i32_ret_addr64:
520; SI: buffer_atomic_smin [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
521; VI: flat_atomic_smin [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
522; GCN: buffer_store_dword [[RET]]
523define void @atomic_min_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
524entry:
525  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
526  %val = atomicrmw volatile min i32 addrspace(1)* %ptr, i32 %in seq_cst
527  store i32 %val, i32 addrspace(1)* %out2
528  ret void
529}
530
531; FUNC-LABEL: {{^}}atomic_umin_i32_offset:
532; GCN: buffer_atomic_umin v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
533define void @atomic_umin_i32_offset(i32 addrspace(1)* %out, i32 %in) {
534entry:
535  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
536  %val = atomicrmw volatile umin i32 addrspace(1)* %gep, i32 %in seq_cst
537  ret void
538}
539
540; FUNC-LABEL: {{^}}atomic_umin_i32_ret_offset:
541; GCN: buffer_atomic_umin [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
542; GCN: buffer_store_dword [[RET]]
543define void @atomic_umin_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
544entry:
545  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
546  %val = atomicrmw volatile umin i32 addrspace(1)* %gep, i32 %in seq_cst
547  store i32 %val, i32 addrspace(1)* %out2
548  ret void
549}
550
551; FUNC-LABEL: {{^}}atomic_umin_i32_addr64_offset:
552; SI: buffer_atomic_umin v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
553; VI: flat_atomic_umin v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
554define void @atomic_umin_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
555entry:
556  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
557  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
558  %val = atomicrmw volatile umin i32 addrspace(1)* %gep, i32 %in seq_cst
559  ret void
560}
561
562; FUNC-LABEL: {{^}}atomic_umin_i32_ret_addr64_offset:
563; SI: buffer_atomic_umin [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
564; VI: flat_atomic_umin [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
565; GCN: buffer_store_dword [[RET]]
566define void @atomic_umin_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
567entry:
568  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
569  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
570  %val = atomicrmw volatile umin i32 addrspace(1)* %gep, i32 %in seq_cst
571  store i32 %val, i32 addrspace(1)* %out2
572  ret void
573}
574
575; FUNC-LABEL: {{^}}atomic_umin_i32:
576; GCN: buffer_atomic_umin v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
577define void @atomic_umin_i32(i32 addrspace(1)* %out, i32 %in) {
578entry:
579  %val = atomicrmw volatile umin i32 addrspace(1)* %out, i32 %in seq_cst
580  ret void
581}
582
583; FUNC-LABEL: {{^}}atomic_umin_i32_ret:
584; SI: buffer_atomic_umin [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
585; GCN: buffer_store_dword [[RET]]
586define void @atomic_umin_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
587entry:
588  %val = atomicrmw volatile umin i32 addrspace(1)* %out, i32 %in seq_cst
589  store i32 %val, i32 addrspace(1)* %out2
590  ret void
591}
592
593; FUNC-LABEL: {{^}}atomic_umin_i32_addr64:
594; SI: buffer_atomic_umin v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
595; VI: flat_atomic_umin v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
596define void @atomic_umin_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
597entry:
598  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
599  %val = atomicrmw volatile umin i32 addrspace(1)* %ptr, i32 %in seq_cst
600  ret void
601}
602
603; FUNC-LABEL: {{^}}atomic_umin_i32_ret_addr64:
604; SI: buffer_atomic_umin [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
605; VI: flat_atomic_umin [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
606; GCN: buffer_store_dword [[RET]]
607define void @atomic_umin_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
608entry:
609  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
610  %val = atomicrmw volatile umin i32 addrspace(1)* %ptr, i32 %in seq_cst
611  store i32 %val, i32 addrspace(1)* %out2
612  ret void
613}
614
615; FUNC-LABEL: {{^}}atomic_or_i32_offset:
616; GCN: buffer_atomic_or v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
617define void @atomic_or_i32_offset(i32 addrspace(1)* %out, i32 %in) {
618entry:
619  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
620  %val = atomicrmw volatile or i32 addrspace(1)* %gep, i32 %in seq_cst
621  ret void
622}
623
624; FUNC-LABEL: {{^}}atomic_or_i32_ret_offset:
625; GCN: buffer_atomic_or [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
626; GCN: buffer_store_dword [[RET]]
627define void @atomic_or_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
628entry:
629  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
630  %val = atomicrmw volatile or i32 addrspace(1)* %gep, i32 %in seq_cst
631  store i32 %val, i32 addrspace(1)* %out2
632  ret void
633}
634
635; FUNC-LABEL: {{^}}atomic_or_i32_addr64_offset:
636; SI: buffer_atomic_or v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
637; VI: flat_atomic_or v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
638define void @atomic_or_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
639entry:
640  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
641  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
642  %val = atomicrmw volatile or i32 addrspace(1)* %gep, i32 %in seq_cst
643  ret void
644}
645
646; FUNC-LABEL: {{^}}atomic_or_i32_ret_addr64_offset:
647; SI: buffer_atomic_or [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
648; VI: flat_atomic_or [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
649; GCN: buffer_store_dword [[RET]]
650define void @atomic_or_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
651entry:
652  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
653  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
654  %val = atomicrmw volatile or i32 addrspace(1)* %gep, i32 %in seq_cst
655  store i32 %val, i32 addrspace(1)* %out2
656  ret void
657}
658
659; FUNC-LABEL: {{^}}atomic_or_i32:
660; GCN: buffer_atomic_or v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
661define void @atomic_or_i32(i32 addrspace(1)* %out, i32 %in) {
662entry:
663  %val = atomicrmw volatile or i32 addrspace(1)* %out, i32 %in seq_cst
664  ret void
665}
666
667; FUNC-LABEL: {{^}}atomic_or_i32_ret:
668; GCN: buffer_atomic_or [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
669; GCN: buffer_store_dword [[RET]]
670define void @atomic_or_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
671entry:
672  %val = atomicrmw volatile or i32 addrspace(1)* %out, i32 %in seq_cst
673  store i32 %val, i32 addrspace(1)* %out2
674  ret void
675}
676
677; FUNC-LABEL: {{^}}atomic_or_i32_addr64:
678; SI: buffer_atomic_or v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
679; VI: flat_atomic_or v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
680define void @atomic_or_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
681entry:
682  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
683  %val = atomicrmw volatile or i32 addrspace(1)* %ptr, i32 %in seq_cst
684  ret void
685}
686
687; FUNC-LABEL: {{^}}atomic_or_i32_ret_addr64:
688; SI: buffer_atomic_or [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
689; VI: flat_atomic_or [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
690; GCN: buffer_store_dword [[RET]]
691define void @atomic_or_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
692entry:
693  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
694  %val = atomicrmw volatile or i32 addrspace(1)* %ptr, i32 %in seq_cst
695  store i32 %val, i32 addrspace(1)* %out2
696  ret void
697}
698
699; FUNC-LABEL: {{^}}atomic_xchg_i32_offset:
700; GCN: buffer_atomic_swap v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
701define void @atomic_xchg_i32_offset(i32 addrspace(1)* %out, i32 %in) {
702entry:
703  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
704  %val = atomicrmw volatile xchg i32 addrspace(1)* %gep, i32 %in seq_cst
705  ret void
706}
707
708; FUNC-LABEL: {{^}}atomic_xchg_i32_ret_offset:
709; GCN: buffer_atomic_swap [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
710; GCN: buffer_store_dword [[RET]]
711define void @atomic_xchg_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
712entry:
713  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
714  %val = atomicrmw volatile xchg i32 addrspace(1)* %gep, i32 %in seq_cst
715  store i32 %val, i32 addrspace(1)* %out2
716  ret void
717}
718
719; FUNC-LABEL: {{^}}atomic_xchg_i32_addr64_offset:
720; SI: buffer_atomic_swap v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
721
722; VI: flat_atomic_swap v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}}{{$}}
723define void @atomic_xchg_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
724entry:
725  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
726  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
727  %val = atomicrmw volatile xchg i32 addrspace(1)* %gep, i32 %in seq_cst
728  ret void
729}
730
731; FUNC-LABEL: {{^}}atomic_xchg_i32_ret_addr64_offset:
732; SI: buffer_atomic_swap [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
733
734; VI: flat_atomic_swap [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
735; GCN: buffer_store_dword [[RET]]
736define void @atomic_xchg_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
737entry:
738  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
739  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
740  %val = atomicrmw volatile xchg i32 addrspace(1)* %gep, i32 %in seq_cst
741  store i32 %val, i32 addrspace(1)* %out2
742  ret void
743}
744
745; FUNC-LABEL: {{^}}atomic_xchg_i32:
746; GCN: buffer_atomic_swap v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
747define void @atomic_xchg_i32(i32 addrspace(1)* %out, i32 %in) {
748entry:
749  %val = atomicrmw volatile xchg i32 addrspace(1)* %out, i32 %in seq_cst
750  ret void
751}
752
753; FUNC-LABEL: {{^}}atomic_xchg_i32_ret:
754; GCN: buffer_atomic_swap [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
755; GCN: buffer_store_dword [[RET]]
756define void @atomic_xchg_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
757entry:
758  %val = atomicrmw volatile xchg i32 addrspace(1)* %out, i32 %in seq_cst
759  store i32 %val, i32 addrspace(1)* %out2
760  ret void
761}
762
763; FUNC-LABEL: {{^}}atomic_xchg_i32_addr64:
764; SI: buffer_atomic_swap v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
765; VI: flat_atomic_swap v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
766define void @atomic_xchg_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
767entry:
768  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
769  %val = atomicrmw volatile xchg i32 addrspace(1)* %ptr, i32 %in seq_cst
770  ret void
771}
772
773; FUNC-LABEL: {{^}}atomic_xchg_i32_ret_addr64:
774; SI: buffer_atomic_swap [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
775; VI: flat_atomic_swap [[RET:v[0-9]+]],  v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
776; GCN: buffer_store_dword [[RET]]
777define void @atomic_xchg_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
778entry:
779  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
780  %val = atomicrmw volatile xchg i32 addrspace(1)* %ptr, i32 %in seq_cst
781  store i32 %val, i32 addrspace(1)* %out2
782  ret void
783}
784
785; FUNC-LABEL: {{^}}atomic_cmpxchg_i32_offset:
786; GCN: buffer_atomic_cmpswap v[{{[0-9]+}}:{{[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
787define void @atomic_cmpxchg_i32_offset(i32 addrspace(1)* %out, i32 %in, i32 %old) {
788entry:
789  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
790  %val = cmpxchg volatile i32 addrspace(1)* %gep, i32 %old, i32 %in seq_cst seq_cst
791  ret void
792}
793
794; FUNC-LABEL: {{^}}atomic_cmpxchg_i32_ret_offset:
795; GCN: buffer_atomic_cmpswap v{{\[}}[[RET:[0-9]+]]{{:[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
796; GCN: buffer_store_dword v[[RET]]
797define void @atomic_cmpxchg_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i32 %old) {
798entry:
799  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
800  %val = cmpxchg volatile i32 addrspace(1)* %gep, i32 %old, i32 %in seq_cst seq_cst
801  %extract0 = extractvalue { i32, i1 } %val, 0
802  store i32 %extract0, i32 addrspace(1)* %out2
803  ret void
804}
805
806; FUNC-LABEL: {{^}}atomic_cmpxchg_i32_addr64_offset:
807; SI: buffer_atomic_cmpswap v[{{[0-9]+\:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
808
809; VI: flat_atomic_cmpswap v[{{[0-9]+\:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
810define void @atomic_cmpxchg_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index, i32 %old) {
811entry:
812  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
813  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
814  %val = cmpxchg volatile i32 addrspace(1)* %gep, i32 %old, i32 %in seq_cst seq_cst
815  ret void
816}
817
818; FUNC-LABEL: {{^}}atomic_cmpxchg_i32_ret_addr64_offset:
819; SI: buffer_atomic_cmpswap v{{\[}}[[RET:[0-9]+]]:{{[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
820; VI: flat_atomic_cmpswap v[[RET:[0-9]+]], v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}] glc{{$}}
821; GCN: buffer_store_dword v[[RET]]
822define void @atomic_cmpxchg_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index, i32 %old) {
823entry:
824  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
825  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
826  %val = cmpxchg volatile i32 addrspace(1)* %gep, i32 %old, i32 %in seq_cst seq_cst
827  %extract0 = extractvalue { i32, i1 } %val, 0
828  store i32 %extract0, i32 addrspace(1)* %out2
829  ret void
830}
831
832; FUNC-LABEL: {{^}}atomic_cmpxchg_i32:
833; GCN: buffer_atomic_cmpswap v[{{[0-9]+:[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
834define void @atomic_cmpxchg_i32(i32 addrspace(1)* %out, i32 %in, i32 %old) {
835entry:
836  %val = cmpxchg volatile i32 addrspace(1)* %out, i32 %old, i32 %in seq_cst seq_cst
837  ret void
838}
839
840; FUNC-LABEL: {{^}}atomic_cmpxchg_i32_ret:
841; GCN: buffer_atomic_cmpswap v{{\[}}[[RET:[0-9]+]]:{{[0-9]+}}], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
842; GCN: buffer_store_dword v[[RET]]
843define void @atomic_cmpxchg_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i32 %old) {
844entry:
845  %val = cmpxchg volatile i32 addrspace(1)* %out, i32 %old, i32 %in seq_cst seq_cst
846  %extract0 = extractvalue { i32, i1 } %val, 0
847  store i32 %extract0, i32 addrspace(1)* %out2
848  ret void
849}
850
851; FUNC-LABEL: {{^}}atomic_cmpxchg_i32_addr64:
852; SI: buffer_atomic_cmpswap v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
853; VI: flat_atomic_cmpswap v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}]{{$}}
854define void @atomic_cmpxchg_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index, i32 %old) {
855entry:
856  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
857  %val = cmpxchg volatile i32 addrspace(1)* %ptr, i32 %old, i32 %in seq_cst seq_cst
858  ret void
859}
860
861; FUNC-LABEL: {{^}}atomic_cmpxchg_i32_ret_addr64:
862; SI: buffer_atomic_cmpswap v{{\[}}[[RET:[0-9]+]]:{{[0-9]+}}], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
863; VI: flat_atomic_cmpswap v[[RET:[0-9]+]], v[{{[0-9]+:[0-9]+}}], v[{{[0-9]+:[0-9]+}}] glc{{$}}
864; GCN: buffer_store_dword v[[RET]]
865define void @atomic_cmpxchg_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index, i32 %old) {
866entry:
867  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
868  %val = cmpxchg volatile i32 addrspace(1)* %ptr, i32 %old, i32 %in seq_cst seq_cst
869  %extract0 = extractvalue { i32, i1 } %val, 0
870  store i32 %extract0, i32 addrspace(1)* %out2
871  ret void
872}
873
874; FUNC-LABEL: {{^}}atomic_xor_i32_offset:
875; GCN: buffer_atomic_xor v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16{{$}}
876define void @atomic_xor_i32_offset(i32 addrspace(1)* %out, i32 %in) {
877entry:
878  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
879  %val = atomicrmw volatile xor i32 addrspace(1)* %gep, i32 %in seq_cst
880  ret void
881}
882
883; FUNC-LABEL: {{^}}atomic_xor_i32_ret_offset:
884; GCN: buffer_atomic_xor [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
885; GCN: buffer_store_dword [[RET]]
886define void @atomic_xor_i32_ret_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
887entry:
888  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
889  %val = atomicrmw volatile xor i32 addrspace(1)* %gep, i32 %in seq_cst
890  store i32 %val, i32 addrspace(1)* %out2
891  ret void
892}
893
894; FUNC-LABEL: {{^}}atomic_xor_i32_addr64_offset:
895; SI: buffer_atomic_xor v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16{{$}}
896; VI: flat_atomic_xor v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
897define void @atomic_xor_i32_addr64_offset(i32 addrspace(1)* %out, i32 %in, i64 %index) {
898entry:
899  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
900  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
901  %val = atomicrmw volatile xor i32 addrspace(1)* %gep, i32 %in seq_cst
902  ret void
903}
904
905; FUNC-LABEL: {{^}}atomic_xor_i32_ret_addr64_offset:
906; SI: buffer_atomic_xor [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
907; VI: flat_atomic_xor [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
908; GCN: buffer_store_dword [[RET]]
909define void @atomic_xor_i32_ret_addr64_offset(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
910entry:
911  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
912  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
913  %val = atomicrmw volatile xor i32 addrspace(1)* %gep, i32 %in seq_cst
914  store i32 %val, i32 addrspace(1)* %out2
915  ret void
916}
917
918; FUNC-LABEL: {{^}}atomic_xor_i32:
919; GCN: buffer_atomic_xor v{{[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0{{$}}
920define void @atomic_xor_i32(i32 addrspace(1)* %out, i32 %in) {
921entry:
922  %val = atomicrmw volatile xor i32 addrspace(1)* %out, i32 %in seq_cst
923  ret void
924}
925
926; FUNC-LABEL: {{^}}atomic_xor_i32_ret:
927; GCN: buffer_atomic_xor [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
928; GCN: buffer_store_dword [[RET]]
929define void @atomic_xor_i32_ret(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in) {
930entry:
931  %val = atomicrmw volatile xor i32 addrspace(1)* %out, i32 %in seq_cst
932  store i32 %val, i32 addrspace(1)* %out2
933  ret void
934}
935
936; FUNC-LABEL: {{^}}atomic_xor_i32_addr64:
937; SI: buffer_atomic_xor v{{[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64{{$}}
938; VI: flat_atomic_xor v[{{[0-9]+:[0-9]+}}], v{{[0-9]+$}}
939define void @atomic_xor_i32_addr64(i32 addrspace(1)* %out, i32 %in, i64 %index) {
940entry:
941  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
942  %val = atomicrmw volatile xor i32 addrspace(1)* %ptr, i32 %in seq_cst
943  ret void
944}
945
946; FUNC-LABEL: {{^}}atomic_xor_i32_ret_addr64:
947; SI: buffer_atomic_xor [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
948; VI: flat_atomic_xor [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}], v{{[0-9]+}} glc{{$}}
949; GCN: buffer_store_dword [[RET]]
950define void @atomic_xor_i32_ret_addr64(i32 addrspace(1)* %out, i32 addrspace(1)* %out2, i32 %in, i64 %index) {
951entry:
952  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
953  %val = atomicrmw volatile xor i32 addrspace(1)* %ptr, i32 %in seq_cst
954  store i32 %val, i32 addrspace(1)* %out2
955  ret void
956}
957
958; FUNC-LABEL: {{^}}atomic_load_i32_offset:
959; SI: buffer_load_dword [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
960; VI: flat_load_dword [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}] glc{{$}}
961; GCN: buffer_store_dword [[RET]]
962define void @atomic_load_i32_offset(i32 addrspace(1)* %in, i32 addrspace(1)* %out) {
963entry:
964  %gep = getelementptr i32, i32 addrspace(1)* %in, i64 4
965  %val = load atomic i32, i32 addrspace(1)* %gep  seq_cst, align 4
966  store i32 %val, i32 addrspace(1)* %out
967  ret void
968}
969
970; FUNC-LABEL: {{^}}atomic_load_i32:
971; SI: buffer_load_dword [[RET:v[0-9]+]], off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc
972; VI: flat_load_dword [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}] glc
973; GCN: buffer_store_dword [[RET]]
974define void @atomic_load_i32(i32 addrspace(1)* %in, i32 addrspace(1)* %out) {
975entry:
976  %val = load atomic i32, i32 addrspace(1)* %in seq_cst, align 4
977  store i32 %val, i32 addrspace(1)* %out
978  ret void
979}
980
981; FUNC-LABEL: {{^}}atomic_load_i32_addr64_offset:
982; SI: buffer_load_dword [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
983; VI: flat_load_dword [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}] glc{{$}}
984; GCN: buffer_store_dword [[RET]]
985define void @atomic_load_i32_addr64_offset(i32 addrspace(1)* %in, i32 addrspace(1)* %out, i64 %index) {
986entry:
987  %ptr = getelementptr i32, i32 addrspace(1)* %in, i64 %index
988  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
989  %val = load atomic i32, i32 addrspace(1)* %gep seq_cst, align 4
990  store i32 %val, i32 addrspace(1)* %out
991  ret void
992}
993
994; FUNC-LABEL: {{^}}atomic_load_i32_addr64:
995; SI: buffer_load_dword [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
996; VI: flat_load_dword [[RET:v[0-9]+]], v[{{[0-9]+:[0-9]+}}] glc{{$}}
997; GCN: buffer_store_dword [[RET]]
998define void @atomic_load_i32_addr64(i32 addrspace(1)* %in, i32 addrspace(1)* %out, i64 %index) {
999entry:
1000  %ptr = getelementptr i32, i32 addrspace(1)* %in, i64 %index
1001  %val = load atomic i32, i32 addrspace(1)* %ptr seq_cst, align 4
1002  store i32 %val, i32 addrspace(1)* %out
1003  ret void
1004}
1005
1006; FUNC-LABEL: {{^}}atomic_store_i32_offset:
1007; SI: buffer_store_dword {{v[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 offset:16 glc{{$}}
1008; VI: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}} glc{{$}}
1009define void @atomic_store_i32_offset(i32 %in, i32 addrspace(1)* %out) {
1010entry:
1011  %gep = getelementptr i32, i32 addrspace(1)* %out, i64 4
1012  store atomic i32 %in, i32 addrspace(1)* %gep  seq_cst, align 4
1013  ret void
1014}
1015
1016; FUNC-LABEL: {{^}}atomic_store_i32:
1017; SI: buffer_store_dword {{v[0-9]+}}, off, s[{{[0-9]+}}:{{[0-9]+}}], 0 glc{{$}}
1018; VI: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}} glc{{$}}
1019define void @atomic_store_i32(i32 %in, i32 addrspace(1)* %out) {
1020entry:
1021  store atomic i32 %in, i32 addrspace(1)* %out seq_cst, align 4
1022  ret void
1023}
1024
1025; FUNC-LABEL: {{^}}atomic_store_i32_addr64_offset:
1026; SI: buffer_store_dword {{v[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 offset:16 glc{{$}}
1027; VI: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}} glc{{$}}
1028define void @atomic_store_i32_addr64_offset(i32 %in, i32 addrspace(1)* %out, i64 %index) {
1029entry:
1030  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
1031  %gep = getelementptr i32, i32 addrspace(1)* %ptr, i64 4
1032  store atomic i32 %in, i32 addrspace(1)* %gep seq_cst, align 4
1033  ret void
1034}
1035
1036; FUNC-LABEL: {{^}}atomic_store_i32_addr64:
1037; SI: buffer_store_dword {{v[0-9]+}}, v[{{[0-9]+}}:{{[0-9]+}}], s[{{[0-9]+}}:{{[0-9]+}}], 0 addr64 glc{{$}}
1038; VI: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}} glc{{$}}
1039define void @atomic_store_i32_addr64(i32 %in, i32 addrspace(1)* %out, i64 %index) {
1040entry:
1041  %ptr = getelementptr i32, i32 addrspace(1)* %out, i64 %index
1042  store atomic i32 %in, i32 addrspace(1)* %ptr seq_cst, align 4
1043  ret void
1044}
1045