1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1200 < %s | FileCheck -check-prefix=GFX12 %s
3 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx940 < %s | FileCheck -check-prefix=GFX940 %s
4 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1100 < %s | FileCheck -check-prefix=GFX11 %s
5 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1010 < %s | FileCheck -check-prefix=GFX10 %s
6 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx90a < %s | FileCheck -check-prefix=GFX90A %s
7 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx908 < %s | FileCheck -check-prefix=GFX908 %s
8 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=tonga < %s | FileCheck -check-prefix=GFX8 %s
9 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=hawaii < %s | FileCheck -check-prefix=GFX7 %s
10 ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=tahiti < %s | FileCheck -check-prefix=GFX6 %s
12 ; --------------------------------------------------------------------
14 ; --------------------------------------------------------------------
16 define float @buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset(ptr addrspace(7) inreg %ptr, float %val) #0 {
17 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
19 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
20 ; GFX12-NEXT: s_wait_expcnt 0x0
21 ; GFX12-NEXT: s_wait_samplecnt 0x0
22 ; GFX12-NEXT: s_wait_bvhcnt 0x0
23 ; GFX12-NEXT: s_wait_kmcnt 0x0
24 ; GFX12-NEXT: v_mov_b32_e32 v1, s6
25 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
26 ; GFX12-NEXT: s_wait_storecnt 0x0
27 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
28 ; GFX12-NEXT: s_wait_loadcnt 0x0
29 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
30 ; GFX12-NEXT: s_setpc_b64 s[30:31]
32 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
34 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
35 ; GFX940-NEXT: v_mov_b32_e32 v1, s6
36 ; GFX940-NEXT: buffer_wbl2 sc1
37 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 sc0
38 ; GFX940-NEXT: s_waitcnt vmcnt(0)
39 ; GFX940-NEXT: buffer_inv sc1
40 ; GFX940-NEXT: s_setpc_b64 s[30:31]
42 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
44 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
45 ; GFX11-NEXT: v_mov_b32_e32 v1, s6
46 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
47 ; GFX11-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 glc
48 ; GFX11-NEXT: s_waitcnt vmcnt(0)
49 ; GFX11-NEXT: buffer_gl1_inv
50 ; GFX11-NEXT: buffer_gl0_inv
51 ; GFX11-NEXT: s_setpc_b64 s[30:31]
53 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
55 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
56 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
57 ; GFX10-NEXT: v_mov_b32_e32 v0, s18
58 ; GFX10-NEXT: s_mov_b32 s11, s17
59 ; GFX10-NEXT: s_mov_b32 s10, s16
60 ; GFX10-NEXT: s_mov_b32 s9, s7
61 ; GFX10-NEXT: s_mov_b32 s8, s6
62 ; GFX10-NEXT: s_add_i32 s4, s18, 0x400
63 ; GFX10-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
64 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
65 ; GFX10-NEXT: s_mov_b32 s4, 0
66 ; GFX10-NEXT: .LBB0_1: ; %atomicrmw.start
67 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
68 ; GFX10-NEXT: s_waitcnt vmcnt(0)
69 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
70 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
71 ; GFX10-NEXT: v_add_f32_e32 v4, v5, v2
72 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
73 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
74 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
75 ; GFX10-NEXT: s_waitcnt vmcnt(0)
76 ; GFX10-NEXT: buffer_gl1_inv
77 ; GFX10-NEXT: buffer_gl0_inv
78 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
79 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
80 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
81 ; GFX10-NEXT: s_cbranch_execnz .LBB0_1
82 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
83 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
84 ; GFX10-NEXT: s_setpc_b64 s[30:31]
86 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
88 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
89 ; GFX90A-NEXT: s_mov_b32 s11, s17
90 ; GFX90A-NEXT: s_mov_b32 s10, s16
91 ; GFX90A-NEXT: s_mov_b32 s9, s7
92 ; GFX90A-NEXT: s_mov_b32 s8, s6
93 ; GFX90A-NEXT: v_mov_b32_e32 v1, s18
94 ; GFX90A-NEXT: buffer_atomic_add_f32 v0, v1, s[8:11], 0 offen offset:1024 glc
95 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
96 ; GFX90A-NEXT: buffer_wbinvl1
97 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
99 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
101 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
102 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
103 ; GFX908-NEXT: s_mov_b32 s11, s17
104 ; GFX908-NEXT: s_mov_b32 s10, s16
105 ; GFX908-NEXT: s_mov_b32 s9, s7
106 ; GFX908-NEXT: s_mov_b32 s8, s6
107 ; GFX908-NEXT: v_mov_b32_e32 v0, s18
108 ; GFX908-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
109 ; GFX908-NEXT: s_add_i32 s6, s18, 0x400
110 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
111 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
112 ; GFX908-NEXT: .LBB0_1: ; %atomicrmw.start
113 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
114 ; GFX908-NEXT: s_waitcnt vmcnt(0)
115 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
116 ; GFX908-NEXT: v_add_f32_e32 v4, v5, v2
117 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
118 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
119 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
120 ; GFX908-NEXT: s_waitcnt vmcnt(0)
121 ; GFX908-NEXT: buffer_wbinvl1
122 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
123 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
124 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
125 ; GFX908-NEXT: s_cbranch_execnz .LBB0_1
126 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
127 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
128 ; GFX908-NEXT: s_setpc_b64 s[30:31]
130 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
132 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
133 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
134 ; GFX8-NEXT: s_mov_b32 s11, s17
135 ; GFX8-NEXT: s_mov_b32 s10, s16
136 ; GFX8-NEXT: s_mov_b32 s9, s7
137 ; GFX8-NEXT: s_mov_b32 s8, s6
138 ; GFX8-NEXT: v_mov_b32_e32 v0, s18
139 ; GFX8-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
140 ; GFX8-NEXT: s_add_i32 s6, s18, 0x400
141 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
142 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
143 ; GFX8-NEXT: .LBB0_1: ; %atomicrmw.start
144 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
145 ; GFX8-NEXT: s_waitcnt vmcnt(0)
146 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
147 ; GFX8-NEXT: v_add_f32_e32 v4, v5, v2
148 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
149 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
150 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
151 ; GFX8-NEXT: s_waitcnt vmcnt(0)
152 ; GFX8-NEXT: buffer_wbinvl1
153 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
154 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
155 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
156 ; GFX8-NEXT: s_cbranch_execnz .LBB0_1
157 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
158 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
159 ; GFX8-NEXT: s_setpc_b64 s[30:31]
161 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
163 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
164 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
165 ; GFX7-NEXT: s_mov_b32 s11, s17
166 ; GFX7-NEXT: s_mov_b32 s10, s16
167 ; GFX7-NEXT: s_mov_b32 s9, s7
168 ; GFX7-NEXT: s_mov_b32 s8, s6
169 ; GFX7-NEXT: v_mov_b32_e32 v0, s18
170 ; GFX7-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
171 ; GFX7-NEXT: s_add_i32 s6, s18, 0x400
172 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
173 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
174 ; GFX7-NEXT: .LBB0_1: ; %atomicrmw.start
175 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
176 ; GFX7-NEXT: s_waitcnt vmcnt(0)
177 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
178 ; GFX7-NEXT: v_add_f32_e32 v4, v5, v2
179 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
180 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
181 ; GFX7-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
182 ; GFX7-NEXT: s_waitcnt vmcnt(0)
183 ; GFX7-NEXT: buffer_wbinvl1
184 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
185 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
186 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
187 ; GFX7-NEXT: s_cbranch_execnz .LBB0_1
188 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
189 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
190 ; GFX7-NEXT: s_setpc_b64 s[30:31]
192 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
194 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
195 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
196 ; GFX6-NEXT: s_mov_b32 s11, s17
197 ; GFX6-NEXT: s_mov_b32 s10, s16
198 ; GFX6-NEXT: s_mov_b32 s9, s7
199 ; GFX6-NEXT: s_mov_b32 s8, s6
200 ; GFX6-NEXT: v_mov_b32_e32 v0, s18
201 ; GFX6-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
202 ; GFX6-NEXT: s_add_i32 s6, s18, 0x400
203 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
204 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
205 ; GFX6-NEXT: .LBB0_1: ; %atomicrmw.start
206 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
207 ; GFX6-NEXT: s_waitcnt vmcnt(0)
208 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
209 ; GFX6-NEXT: v_add_f32_e32 v4, v5, v2
210 ; GFX6-NEXT: s_waitcnt expcnt(0)
211 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
212 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
213 ; GFX6-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
214 ; GFX6-NEXT: s_waitcnt vmcnt(0)
215 ; GFX6-NEXT: buffer_wbinvl1
216 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
217 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
218 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
219 ; GFX6-NEXT: s_cbranch_execnz .LBB0_1
220 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
221 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
222 ; GFX6-NEXT: s_waitcnt expcnt(0)
223 ; GFX6-NEXT: s_setpc_b64 s[30:31]
224 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
225 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst
229 define void @buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset(ptr addrspace(7) inreg %ptr, float %val) #0 {
230 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
232 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
233 ; GFX12-NEXT: s_wait_expcnt 0x0
234 ; GFX12-NEXT: s_wait_samplecnt 0x0
235 ; GFX12-NEXT: s_wait_bvhcnt 0x0
236 ; GFX12-NEXT: s_wait_kmcnt 0x0
237 ; GFX12-NEXT: v_mov_b32_e32 v1, s6
238 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
239 ; GFX12-NEXT: s_wait_storecnt 0x0
240 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024
241 ; GFX12-NEXT: s_wait_storecnt 0x0
242 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
243 ; GFX12-NEXT: s_setpc_b64 s[30:31]
245 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
247 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
248 ; GFX940-NEXT: v_mov_b32_e32 v1, s6
249 ; GFX940-NEXT: buffer_wbl2 sc1
250 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024
251 ; GFX940-NEXT: s_waitcnt vmcnt(0)
252 ; GFX940-NEXT: buffer_inv sc1
253 ; GFX940-NEXT: s_setpc_b64 s[30:31]
255 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
257 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
258 ; GFX11-NEXT: v_mov_b32_e32 v1, s6
259 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
260 ; GFX11-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024
261 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
262 ; GFX11-NEXT: buffer_gl1_inv
263 ; GFX11-NEXT: buffer_gl0_inv
264 ; GFX11-NEXT: s_setpc_b64 s[30:31]
266 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
268 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
269 ; GFX10-NEXT: v_mov_b32_e32 v1, s18
270 ; GFX10-NEXT: s_mov_b32 s11, s17
271 ; GFX10-NEXT: s_mov_b32 s10, s16
272 ; GFX10-NEXT: s_mov_b32 s9, s7
273 ; GFX10-NEXT: s_mov_b32 s8, s6
274 ; GFX10-NEXT: s_add_i32 s4, s18, 0x400
275 ; GFX10-NEXT: buffer_load_dword v2, v1, s[8:11], 0 offen offset:1024
276 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
277 ; GFX10-NEXT: s_mov_b32 s4, 0
278 ; GFX10-NEXT: .LBB1_1: ; %atomicrmw.start
279 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
280 ; GFX10-NEXT: s_waitcnt vmcnt(0)
281 ; GFX10-NEXT: v_add_f32_e32 v1, v2, v0
282 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
283 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
284 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
285 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
286 ; GFX10-NEXT: s_waitcnt vmcnt(0)
287 ; GFX10-NEXT: buffer_gl1_inv
288 ; GFX10-NEXT: buffer_gl0_inv
289 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
290 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
291 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
292 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
293 ; GFX10-NEXT: s_cbranch_execnz .LBB1_1
294 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
295 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
296 ; GFX10-NEXT: s_setpc_b64 s[30:31]
298 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
300 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
301 ; GFX90A-NEXT: s_mov_b32 s11, s17
302 ; GFX90A-NEXT: s_mov_b32 s10, s16
303 ; GFX90A-NEXT: s_mov_b32 s9, s7
304 ; GFX90A-NEXT: s_mov_b32 s8, s6
305 ; GFX90A-NEXT: v_mov_b32_e32 v1, s18
306 ; GFX90A-NEXT: buffer_atomic_add_f32 v0, v1, s[8:11], 0 offen offset:1024
307 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
308 ; GFX90A-NEXT: buffer_wbinvl1
309 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
311 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
313 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
314 ; GFX908-NEXT: s_mov_b32 s11, s17
315 ; GFX908-NEXT: s_mov_b32 s10, s16
316 ; GFX908-NEXT: s_mov_b32 s9, s7
317 ; GFX908-NEXT: s_mov_b32 s8, s6
318 ; GFX908-NEXT: v_mov_b32_e32 v1, s18
319 ; GFX908-NEXT: buffer_atomic_add_f32 v0, v1, s[8:11], 0 offen offset:1024
320 ; GFX908-NEXT: s_waitcnt vmcnt(0)
321 ; GFX908-NEXT: buffer_wbinvl1
322 ; GFX908-NEXT: s_setpc_b64 s[30:31]
324 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
326 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
327 ; GFX8-NEXT: s_mov_b32 s11, s17
328 ; GFX8-NEXT: s_mov_b32 s10, s16
329 ; GFX8-NEXT: s_mov_b32 s9, s7
330 ; GFX8-NEXT: s_mov_b32 s8, s6
331 ; GFX8-NEXT: v_mov_b32_e32 v1, s18
332 ; GFX8-NEXT: buffer_load_dword v2, v1, s[8:11], 0 offen offset:1024
333 ; GFX8-NEXT: s_add_i32 s6, s18, 0x400
334 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
335 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
336 ; GFX8-NEXT: .LBB1_1: ; %atomicrmw.start
337 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
338 ; GFX8-NEXT: s_waitcnt vmcnt(0)
339 ; GFX8-NEXT: v_add_f32_e32 v1, v2, v0
340 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
341 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
342 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
343 ; GFX8-NEXT: s_waitcnt vmcnt(0)
344 ; GFX8-NEXT: buffer_wbinvl1
345 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
346 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
347 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
348 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
349 ; GFX8-NEXT: s_cbranch_execnz .LBB1_1
350 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
351 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
352 ; GFX8-NEXT: s_setpc_b64 s[30:31]
354 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
356 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
357 ; GFX7-NEXT: s_mov_b32 s11, s17
358 ; GFX7-NEXT: s_mov_b32 s10, s16
359 ; GFX7-NEXT: s_mov_b32 s9, s7
360 ; GFX7-NEXT: s_mov_b32 s8, s6
361 ; GFX7-NEXT: v_mov_b32_e32 v1, s18
362 ; GFX7-NEXT: buffer_load_dword v2, v1, s[8:11], 0 offen offset:1024
363 ; GFX7-NEXT: s_add_i32 s6, s18, 0x400
364 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
365 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
366 ; GFX7-NEXT: .LBB1_1: ; %atomicrmw.start
367 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
368 ; GFX7-NEXT: s_waitcnt vmcnt(0)
369 ; GFX7-NEXT: v_add_f32_e32 v1, v2, v0
370 ; GFX7-NEXT: v_mov_b32_e32 v5, v2
371 ; GFX7-NEXT: v_mov_b32_e32 v4, v1
372 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
373 ; GFX7-NEXT: s_waitcnt vmcnt(0)
374 ; GFX7-NEXT: buffer_wbinvl1
375 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
376 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
377 ; GFX7-NEXT: v_mov_b32_e32 v2, v4
378 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
379 ; GFX7-NEXT: s_cbranch_execnz .LBB1_1
380 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
381 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
382 ; GFX7-NEXT: s_setpc_b64 s[30:31]
384 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset:
386 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
387 ; GFX6-NEXT: s_mov_b32 s11, s17
388 ; GFX6-NEXT: s_mov_b32 s10, s16
389 ; GFX6-NEXT: s_mov_b32 s9, s7
390 ; GFX6-NEXT: s_mov_b32 s8, s6
391 ; GFX6-NEXT: v_mov_b32_e32 v1, s18
392 ; GFX6-NEXT: buffer_load_dword v2, v1, s[8:11], 0 offen offset:1024
393 ; GFX6-NEXT: s_add_i32 s6, s18, 0x400
394 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
395 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
396 ; GFX6-NEXT: .LBB1_1: ; %atomicrmw.start
397 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
398 ; GFX6-NEXT: s_waitcnt vmcnt(0)
399 ; GFX6-NEXT: v_add_f32_e32 v1, v2, v0
400 ; GFX6-NEXT: s_waitcnt expcnt(0)
401 ; GFX6-NEXT: v_mov_b32_e32 v5, v2
402 ; GFX6-NEXT: v_mov_b32_e32 v4, v1
403 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
404 ; GFX6-NEXT: s_waitcnt vmcnt(0)
405 ; GFX6-NEXT: buffer_wbinvl1
406 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
407 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
408 ; GFX6-NEXT: v_mov_b32_e32 v2, v4
409 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
410 ; GFX6-NEXT: s_cbranch_execnz .LBB1_1
411 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
412 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
413 ; GFX6-NEXT: s_waitcnt expcnt(0)
414 ; GFX6-NEXT: s_setpc_b64 s[30:31]
415 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
416 %unused = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst
420 define float @buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall(ptr addrspace(7) %ptr, float %val) #0 {
421 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
423 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
424 ; GFX12-NEXT: s_wait_expcnt 0x0
425 ; GFX12-NEXT: s_wait_samplecnt 0x0
426 ; GFX12-NEXT: s_wait_bvhcnt 0x0
427 ; GFX12-NEXT: s_wait_kmcnt 0x0
428 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
429 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
430 ; GFX12-NEXT: s_wait_storecnt 0x0
431 ; GFX12-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
432 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
433 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
434 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
435 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
436 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
437 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
438 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
439 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
440 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
441 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
442 ; GFX12-NEXT: s_wait_loadcnt 0x0
443 ; GFX12-NEXT: buffer_atomic_add_f32 v5, v4, s[4:7], null offen offset:1024 th:TH_ATOMIC_RETURN
444 ; GFX12-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
445 ; GFX12-NEXT: ; implicit-def: $vgpr4
446 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
447 ; GFX12-NEXT: s_cbranch_execnz .LBB2_1
448 ; GFX12-NEXT: ; %bb.2:
449 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
450 ; GFX12-NEXT: s_wait_loadcnt 0x0
451 ; GFX12-NEXT: v_mov_b32_e32 v0, v5
452 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
453 ; GFX12-NEXT: s_setpc_b64 s[30:31]
455 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
457 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
458 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
459 ; GFX940-NEXT: buffer_wbl2 sc1
460 ; GFX940-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
461 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
462 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
463 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
464 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
465 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
466 ; GFX940-NEXT: s_nop 0
467 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
468 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
469 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
470 ; GFX940-NEXT: s_waitcnt vmcnt(0)
471 ; GFX940-NEXT: buffer_atomic_add_f32 v5, v4, s[4:7], 0 offen offset:1024 sc0
472 ; GFX940-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
473 ; GFX940-NEXT: ; implicit-def: $vgpr4
474 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
475 ; GFX940-NEXT: s_cbranch_execnz .LBB2_1
476 ; GFX940-NEXT: ; %bb.2:
477 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
478 ; GFX940-NEXT: s_waitcnt vmcnt(0)
479 ; GFX940-NEXT: v_mov_b32_e32 v0, v5
480 ; GFX940-NEXT: buffer_inv sc1
481 ; GFX940-NEXT: s_setpc_b64 s[30:31]
483 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
485 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
486 ; GFX11-NEXT: s_mov_b32 s1, exec_lo
487 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
488 ; GFX11-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
489 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
490 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
491 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
492 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
493 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
494 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
495 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
496 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
497 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
498 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
499 ; GFX11-NEXT: s_waitcnt vmcnt(0)
500 ; GFX11-NEXT: buffer_atomic_add_f32 v5, v4, s[4:7], 0 offen offset:1024 glc
501 ; GFX11-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
502 ; GFX11-NEXT: ; implicit-def: $vgpr4
503 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
504 ; GFX11-NEXT: s_cbranch_execnz .LBB2_1
505 ; GFX11-NEXT: ; %bb.2:
506 ; GFX11-NEXT: s_mov_b32 exec_lo, s1
507 ; GFX11-NEXT: s_waitcnt vmcnt(0)
508 ; GFX11-NEXT: v_mov_b32_e32 v0, v5
509 ; GFX11-NEXT: buffer_gl1_inv
510 ; GFX11-NEXT: buffer_gl0_inv
511 ; GFX11-NEXT: s_setpc_b64 s[30:31]
513 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
515 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
516 ; GFX10-NEXT: v_add_nc_u32_e32 v9, 0x400, v4
517 ; GFX10-NEXT: s_mov_b32 s5, 0
518 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
519 ; GFX10-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
520 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
521 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
522 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
523 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
524 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
525 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
526 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
527 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
528 ; GFX10-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
529 ; GFX10-NEXT: ; implicit-def: $vgpr4
530 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
531 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
532 ; GFX10-NEXT: s_cbranch_execnz .LBB2_1
533 ; GFX10-NEXT: ; %bb.2:
534 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
535 ; GFX10-NEXT: .LBB2_3: ; %atomicrmw.start
536 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
537 ; GFX10-NEXT: ; Child Loop BB2_4 Depth 2
538 ; GFX10-NEXT: s_waitcnt vmcnt(0)
539 ; GFX10-NEXT: v_add_f32_e32 v7, v8, v5
540 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
541 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
542 ; GFX10-NEXT: v_mov_b32_e32 v6, v7
543 ; GFX10-NEXT: v_mov_b32_e32 v7, v8
544 ; GFX10-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
545 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
546 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
547 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
548 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
549 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
550 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
551 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
552 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
553 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
554 ; GFX10-NEXT: s_waitcnt vmcnt(0)
555 ; GFX10-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
556 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
557 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
558 ; GFX10-NEXT: s_cbranch_execnz .LBB2_4
559 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
560 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
561 ; GFX10-NEXT: s_waitcnt vmcnt(0)
562 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v6, v8
563 ; GFX10-NEXT: v_mov_b32_e32 v8, v6
564 ; GFX10-NEXT: buffer_gl1_inv
565 ; GFX10-NEXT: buffer_gl0_inv
566 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
567 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
568 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
569 ; GFX10-NEXT: s_cbranch_execnz .LBB2_3
570 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
571 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
572 ; GFX10-NEXT: v_mov_b32_e32 v0, v6
573 ; GFX10-NEXT: s_setpc_b64 s[30:31]
575 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
577 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
578 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
579 ; GFX90A-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
580 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
581 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
582 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
583 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
584 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
585 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
586 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
587 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
588 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
589 ; GFX90A-NEXT: buffer_atomic_add_f32 v5, v4, s[8:11], 0 offen offset:1024 glc
590 ; GFX90A-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
591 ; GFX90A-NEXT: ; implicit-def: $vgpr4
592 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
593 ; GFX90A-NEXT: s_cbranch_execnz .LBB2_1
594 ; GFX90A-NEXT: ; %bb.2:
595 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
596 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
597 ; GFX90A-NEXT: v_mov_b32_e32 v0, v5
598 ; GFX90A-NEXT: buffer_wbinvl1
599 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
601 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
603 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
604 ; GFX908-NEXT: v_add_u32_e32 v9, 0x400, v4
605 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
606 ; GFX908-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
607 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
608 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
609 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
610 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
611 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
612 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
613 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
614 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
615 ; GFX908-NEXT: s_nop 0
616 ; GFX908-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
617 ; GFX908-NEXT: ; implicit-def: $vgpr4
618 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
619 ; GFX908-NEXT: s_cbranch_execnz .LBB2_1
620 ; GFX908-NEXT: ; %bb.2:
621 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
622 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
623 ; GFX908-NEXT: .LBB2_3: ; %atomicrmw.start
624 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
625 ; GFX908-NEXT: ; Child Loop BB2_4 Depth 2
626 ; GFX908-NEXT: s_waitcnt vmcnt(0)
627 ; GFX908-NEXT: v_add_f32_e32 v7, v8, v5
628 ; GFX908-NEXT: v_mov_b32_e32 v6, v7
629 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
630 ; GFX908-NEXT: v_mov_b32_e32 v7, v8
631 ; GFX908-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
632 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
633 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
634 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
635 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
636 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
637 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
638 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
639 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
640 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
641 ; GFX908-NEXT: s_waitcnt vmcnt(0)
642 ; GFX908-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
643 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
644 ; GFX908-NEXT: s_cbranch_execnz .LBB2_4
645 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
646 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
647 ; GFX908-NEXT: s_waitcnt vmcnt(0)
648 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
649 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
650 ; GFX908-NEXT: v_mov_b32_e32 v8, v6
651 ; GFX908-NEXT: buffer_wbinvl1
652 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
653 ; GFX908-NEXT: s_cbranch_execnz .LBB2_3
654 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
655 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
656 ; GFX908-NEXT: v_mov_b32_e32 v0, v6
657 ; GFX908-NEXT: s_setpc_b64 s[30:31]
659 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
661 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
662 ; GFX8-NEXT: v_add_u32_e32 v9, vcc, 0x400, v4
663 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
664 ; GFX8-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
665 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
666 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
667 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
668 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
669 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
670 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
671 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
672 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
674 ; GFX8-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
675 ; GFX8-NEXT: ; implicit-def: $vgpr4
676 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
677 ; GFX8-NEXT: s_cbranch_execnz .LBB2_1
678 ; GFX8-NEXT: ; %bb.2:
679 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
680 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
681 ; GFX8-NEXT: .LBB2_3: ; %atomicrmw.start
682 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
683 ; GFX8-NEXT: ; Child Loop BB2_4 Depth 2
684 ; GFX8-NEXT: s_waitcnt vmcnt(0)
685 ; GFX8-NEXT: v_add_f32_e32 v7, v8, v5
686 ; GFX8-NEXT: v_mov_b32_e32 v6, v7
687 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
688 ; GFX8-NEXT: v_mov_b32_e32 v7, v8
689 ; GFX8-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
690 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
691 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
692 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
693 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
694 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
695 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
696 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
697 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
698 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
699 ; GFX8-NEXT: s_waitcnt vmcnt(0)
700 ; GFX8-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
701 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
702 ; GFX8-NEXT: s_cbranch_execnz .LBB2_4
703 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
704 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
705 ; GFX8-NEXT: s_waitcnt vmcnt(0)
706 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
707 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
708 ; GFX8-NEXT: v_mov_b32_e32 v8, v6
709 ; GFX8-NEXT: buffer_wbinvl1
710 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
711 ; GFX8-NEXT: s_cbranch_execnz .LBB2_3
712 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
713 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
714 ; GFX8-NEXT: v_mov_b32_e32 v0, v6
715 ; GFX8-NEXT: s_setpc_b64 s[30:31]
717 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
719 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
720 ; GFX7-NEXT: v_add_i32_e32 v9, vcc, 0x400, v4
721 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
722 ; GFX7-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
723 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
724 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
725 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
726 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
727 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
728 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
729 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
730 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
731 ; GFX7-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
732 ; GFX7-NEXT: ; implicit-def: $vgpr4
733 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
734 ; GFX7-NEXT: s_cbranch_execnz .LBB2_1
735 ; GFX7-NEXT: ; %bb.2:
736 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
737 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
738 ; GFX7-NEXT: .LBB2_3: ; %atomicrmw.start
739 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
740 ; GFX7-NEXT: ; Child Loop BB2_4 Depth 2
741 ; GFX7-NEXT: s_waitcnt vmcnt(0)
742 ; GFX7-NEXT: v_add_f32_e32 v7, v8, v5
743 ; GFX7-NEXT: v_mov_b32_e32 v6, v7
744 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
745 ; GFX7-NEXT: v_mov_b32_e32 v7, v8
746 ; GFX7-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
747 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
748 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
749 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
750 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
751 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
752 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
753 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
754 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
755 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
756 ; GFX7-NEXT: s_waitcnt vmcnt(0)
757 ; GFX7-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
758 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
759 ; GFX7-NEXT: s_cbranch_execnz .LBB2_4
760 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
761 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
762 ; GFX7-NEXT: s_waitcnt vmcnt(0)
763 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
764 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
765 ; GFX7-NEXT: v_mov_b32_e32 v8, v6
766 ; GFX7-NEXT: buffer_wbinvl1
767 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
768 ; GFX7-NEXT: s_cbranch_execnz .LBB2_3
769 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
770 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
771 ; GFX7-NEXT: v_mov_b32_e32 v0, v6
772 ; GFX7-NEXT: s_setpc_b64 s[30:31]
774 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall:
776 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
777 ; GFX6-NEXT: v_add_i32_e32 v9, vcc, 0x400, v4
778 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
779 ; GFX6-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
780 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
781 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
782 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
783 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
784 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
785 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
786 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
787 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
788 ; GFX6-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
789 ; GFX6-NEXT: ; implicit-def: $vgpr4
790 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
791 ; GFX6-NEXT: s_cbranch_execnz .LBB2_1
792 ; GFX6-NEXT: ; %bb.2:
793 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
794 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
795 ; GFX6-NEXT: .LBB2_3: ; %atomicrmw.start
796 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
797 ; GFX6-NEXT: ; Child Loop BB2_4 Depth 2
798 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
799 ; GFX6-NEXT: v_add_f32_e32 v7, v8, v5
800 ; GFX6-NEXT: v_mov_b32_e32 v6, v7
801 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
802 ; GFX6-NEXT: v_mov_b32_e32 v7, v8
803 ; GFX6-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
804 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
805 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
806 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
807 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
808 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
809 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
810 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
811 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
812 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
813 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
814 ; GFX6-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
815 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
816 ; GFX6-NEXT: s_cbranch_execnz .LBB2_4
817 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
818 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
819 ; GFX6-NEXT: s_waitcnt vmcnt(0)
820 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
821 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
822 ; GFX6-NEXT: v_mov_b32_e32 v8, v6
823 ; GFX6-NEXT: buffer_wbinvl1
824 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
825 ; GFX6-NEXT: s_cbranch_execnz .LBB2_3
826 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
827 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
828 ; GFX6-NEXT: v_mov_b32_e32 v0, v6
829 ; GFX6-NEXT: s_waitcnt expcnt(0)
830 ; GFX6-NEXT: s_setpc_b64 s[30:31]
831 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
832 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst
836 ; --------------------------------------------------------------------
838 ; --------------------------------------------------------------------
840 define double @buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset(ptr addrspace(7) inreg %ptr, double %val) #0 {
841 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
843 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
844 ; GFX12-NEXT: s_wait_expcnt 0x0
845 ; GFX12-NEXT: s_wait_samplecnt 0x0
846 ; GFX12-NEXT: s_wait_bvhcnt 0x0
847 ; GFX12-NEXT: s_wait_kmcnt 0x0
848 ; GFX12-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
849 ; GFX12-NEXT: v_mov_b32_e32 v0, s6
850 ; GFX12-NEXT: s_add_co_i32 s4, s6, 0x800
851 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
852 ; GFX12-NEXT: v_mov_b32_e32 v6, s4
853 ; GFX12-NEXT: s_mov_b32 s4, 0
854 ; GFX12-NEXT: buffer_load_b64 v[0:1], v0, s[0:3], null offen offset:2048
855 ; GFX12-NEXT: .LBB3_1: ; %atomicrmw.start
856 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
857 ; GFX12-NEXT: s_wait_loadcnt 0x0
858 ; GFX12-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
859 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
860 ; GFX12-NEXT: s_wait_storecnt 0x0
861 ; GFX12-NEXT: v_add_f64_e32 v[7:8], v[9:10], v[4:5]
862 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
863 ; GFX12-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
864 ; GFX12-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
865 ; GFX12-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v6, s[0:3], null offen th:TH_ATOMIC_RETURN
866 ; GFX12-NEXT: s_wait_loadcnt 0x0
867 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
868 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
869 ; GFX12-NEXT: s_or_b32 s4, vcc_lo, s4
870 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
871 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
872 ; GFX12-NEXT: s_cbranch_execnz .LBB3_1
873 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
874 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s4
875 ; GFX12-NEXT: s_setpc_b64 s[30:31]
877 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
879 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
880 ; GFX940-NEXT: v_mov_b32_e32 v2, s6
881 ; GFX940-NEXT: buffer_wbl2 sc1
882 ; GFX940-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[0:3], 0 offen offset:2048 sc0
883 ; GFX940-NEXT: s_waitcnt vmcnt(0)
884 ; GFX940-NEXT: buffer_inv sc1
885 ; GFX940-NEXT: s_setpc_b64 s[30:31]
887 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
889 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
890 ; GFX11-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
891 ; GFX11-NEXT: v_mov_b32_e32 v0, s6
892 ; GFX11-NEXT: s_add_i32 s4, s6, 0x800
893 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
894 ; GFX11-NEXT: v_mov_b32_e32 v6, s4
895 ; GFX11-NEXT: s_mov_b32 s4, 0
896 ; GFX11-NEXT: buffer_load_b64 v[0:1], v0, s[0:3], 0 offen offset:2048
897 ; GFX11-NEXT: .LBB3_1: ; %atomicrmw.start
898 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
899 ; GFX11-NEXT: s_waitcnt vmcnt(0)
900 ; GFX11-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
901 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
902 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
903 ; GFX11-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
904 ; GFX11-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
905 ; GFX11-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
906 ; GFX11-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v6, s[0:3], 0 offen glc
907 ; GFX11-NEXT: s_waitcnt vmcnt(0)
908 ; GFX11-NEXT: buffer_gl1_inv
909 ; GFX11-NEXT: buffer_gl0_inv
910 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
911 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
912 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
913 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
914 ; GFX11-NEXT: s_cbranch_execnz .LBB3_1
915 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
916 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
917 ; GFX11-NEXT: s_setpc_b64 s[30:31]
919 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
921 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
922 ; GFX10-NEXT: v_mov_b32_e32 v4, v0
923 ; GFX10-NEXT: v_mov_b32_e32 v0, s18
924 ; GFX10-NEXT: s_mov_b32 s11, s17
925 ; GFX10-NEXT: s_mov_b32 s10, s16
926 ; GFX10-NEXT: s_mov_b32 s9, s7
927 ; GFX10-NEXT: s_mov_b32 s8, s6
928 ; GFX10-NEXT: v_mov_b32_e32 v5, v1
929 ; GFX10-NEXT: buffer_load_dwordx2 v[0:1], v0, s[8:11], 0 offen offset:2048
930 ; GFX10-NEXT: s_add_i32 s4, s18, 0x800
931 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
932 ; GFX10-NEXT: s_mov_b32 s4, 0
933 ; GFX10-NEXT: .LBB3_1: ; %atomicrmw.start
934 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
935 ; GFX10-NEXT: s_waitcnt vmcnt(0)
936 ; GFX10-NEXT: v_mov_b32_e32 v10, v1
937 ; GFX10-NEXT: v_mov_b32_e32 v9, v0
938 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
939 ; GFX10-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
940 ; GFX10-NEXT: v_mov_b32_e32 v0, v7
941 ; GFX10-NEXT: v_mov_b32_e32 v1, v8
942 ; GFX10-NEXT: v_mov_b32_e32 v2, v9
943 ; GFX10-NEXT: v_mov_b32_e32 v3, v10
944 ; GFX10-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[8:11], 0 offen glc
945 ; GFX10-NEXT: s_waitcnt vmcnt(0)
946 ; GFX10-NEXT: buffer_gl1_inv
947 ; GFX10-NEXT: buffer_gl0_inv
948 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
949 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
950 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
951 ; GFX10-NEXT: s_cbranch_execnz .LBB3_1
952 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
953 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
954 ; GFX10-NEXT: s_setpc_b64 s[30:31]
956 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
958 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
959 ; GFX90A-NEXT: s_mov_b32 s11, s17
960 ; GFX90A-NEXT: s_mov_b32 s10, s16
961 ; GFX90A-NEXT: s_mov_b32 s9, s7
962 ; GFX90A-NEXT: s_mov_b32 s8, s6
963 ; GFX90A-NEXT: v_mov_b32_e32 v2, s18
964 ; GFX90A-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[8:11], 0 offen offset:2048 glc
965 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
966 ; GFX90A-NEXT: buffer_wbinvl1
967 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
969 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
971 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
972 ; GFX908-NEXT: s_mov_b32 s11, s17
973 ; GFX908-NEXT: s_mov_b32 s10, s16
974 ; GFX908-NEXT: s_mov_b32 s9, s7
975 ; GFX908-NEXT: s_mov_b32 s8, s6
976 ; GFX908-NEXT: v_mov_b32_e32 v4, v0
977 ; GFX908-NEXT: v_mov_b32_e32 v0, s18
978 ; GFX908-NEXT: v_mov_b32_e32 v5, v1
979 ; GFX908-NEXT: buffer_load_dwordx2 v[0:1], v0, s[8:11], 0 offen offset:2048
980 ; GFX908-NEXT: s_add_i32 s6, s18, 0x800
981 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
982 ; GFX908-NEXT: v_mov_b32_e32 v6, s6
983 ; GFX908-NEXT: .LBB3_1: ; %atomicrmw.start
984 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
985 ; GFX908-NEXT: s_waitcnt vmcnt(0)
986 ; GFX908-NEXT: v_mov_b32_e32 v10, v1
987 ; GFX908-NEXT: v_mov_b32_e32 v9, v0
988 ; GFX908-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
989 ; GFX908-NEXT: v_mov_b32_e32 v0, v7
990 ; GFX908-NEXT: v_mov_b32_e32 v1, v8
991 ; GFX908-NEXT: v_mov_b32_e32 v2, v9
992 ; GFX908-NEXT: v_mov_b32_e32 v3, v10
993 ; GFX908-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[8:11], 0 offen glc
994 ; GFX908-NEXT: s_waitcnt vmcnt(0)
995 ; GFX908-NEXT: buffer_wbinvl1
996 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
997 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
998 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
999 ; GFX908-NEXT: s_cbranch_execnz .LBB3_1
1000 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
1001 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
1002 ; GFX908-NEXT: s_setpc_b64 s[30:31]
1004 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
1006 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1007 ; GFX8-NEXT: s_mov_b32 s11, s17
1008 ; GFX8-NEXT: s_mov_b32 s10, s16
1009 ; GFX8-NEXT: s_mov_b32 s9, s7
1010 ; GFX8-NEXT: s_mov_b32 s8, s6
1011 ; GFX8-NEXT: v_mov_b32_e32 v4, v0
1012 ; GFX8-NEXT: v_mov_b32_e32 v0, s18
1013 ; GFX8-NEXT: v_mov_b32_e32 v5, v1
1014 ; GFX8-NEXT: buffer_load_dwordx2 v[0:1], v0, s[8:11], 0 offen offset:2048
1015 ; GFX8-NEXT: s_add_i32 s6, s18, 0x800
1016 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
1017 ; GFX8-NEXT: v_mov_b32_e32 v6, s6
1018 ; GFX8-NEXT: .LBB3_1: ; %atomicrmw.start
1019 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
1020 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1021 ; GFX8-NEXT: v_mov_b32_e32 v10, v1
1022 ; GFX8-NEXT: v_mov_b32_e32 v9, v0
1023 ; GFX8-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
1024 ; GFX8-NEXT: v_mov_b32_e32 v0, v7
1025 ; GFX8-NEXT: v_mov_b32_e32 v1, v8
1026 ; GFX8-NEXT: v_mov_b32_e32 v2, v9
1027 ; GFX8-NEXT: v_mov_b32_e32 v3, v10
1028 ; GFX8-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[8:11], 0 offen glc
1029 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1030 ; GFX8-NEXT: buffer_wbinvl1
1031 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
1032 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1033 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
1034 ; GFX8-NEXT: s_cbranch_execnz .LBB3_1
1035 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
1036 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
1037 ; GFX8-NEXT: s_setpc_b64 s[30:31]
1039 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
1041 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1042 ; GFX7-NEXT: s_mov_b32 s11, s17
1043 ; GFX7-NEXT: s_mov_b32 s10, s16
1044 ; GFX7-NEXT: s_mov_b32 s9, s7
1045 ; GFX7-NEXT: s_mov_b32 s8, s6
1046 ; GFX7-NEXT: v_mov_b32_e32 v4, v0
1047 ; GFX7-NEXT: v_mov_b32_e32 v0, s18
1048 ; GFX7-NEXT: v_mov_b32_e32 v5, v1
1049 ; GFX7-NEXT: buffer_load_dwordx2 v[0:1], v0, s[8:11], 0 offen offset:2048
1050 ; GFX7-NEXT: s_add_i32 s6, s18, 0x800
1051 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
1052 ; GFX7-NEXT: v_mov_b32_e32 v6, s6
1053 ; GFX7-NEXT: .LBB3_1: ; %atomicrmw.start
1054 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
1055 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1056 ; GFX7-NEXT: v_mov_b32_e32 v10, v1
1057 ; GFX7-NEXT: v_mov_b32_e32 v9, v0
1058 ; GFX7-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
1059 ; GFX7-NEXT: v_mov_b32_e32 v0, v7
1060 ; GFX7-NEXT: v_mov_b32_e32 v1, v8
1061 ; GFX7-NEXT: v_mov_b32_e32 v2, v9
1062 ; GFX7-NEXT: v_mov_b32_e32 v3, v10
1063 ; GFX7-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[8:11], 0 offen glc
1064 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1065 ; GFX7-NEXT: buffer_wbinvl1
1066 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
1067 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1068 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
1069 ; GFX7-NEXT: s_cbranch_execnz .LBB3_1
1070 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
1071 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
1072 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1074 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset:
1076 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1077 ; GFX6-NEXT: s_mov_b32 s11, s17
1078 ; GFX6-NEXT: s_mov_b32 s10, s16
1079 ; GFX6-NEXT: s_mov_b32 s9, s7
1080 ; GFX6-NEXT: s_mov_b32 s8, s6
1081 ; GFX6-NEXT: v_mov_b32_e32 v4, v0
1082 ; GFX6-NEXT: v_mov_b32_e32 v0, s18
1083 ; GFX6-NEXT: v_mov_b32_e32 v5, v1
1084 ; GFX6-NEXT: buffer_load_dwordx2 v[0:1], v0, s[8:11], 0 offen offset:2048
1085 ; GFX6-NEXT: s_add_i32 s6, s18, 0x800
1086 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
1087 ; GFX6-NEXT: v_mov_b32_e32 v6, s6
1088 ; GFX6-NEXT: .LBB3_1: ; %atomicrmw.start
1089 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
1090 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1091 ; GFX6-NEXT: v_mov_b32_e32 v10, v1
1092 ; GFX6-NEXT: v_mov_b32_e32 v9, v0
1093 ; GFX6-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
1094 ; GFX6-NEXT: s_waitcnt expcnt(0)
1095 ; GFX6-NEXT: v_mov_b32_e32 v0, v7
1096 ; GFX6-NEXT: v_mov_b32_e32 v1, v8
1097 ; GFX6-NEXT: v_mov_b32_e32 v2, v9
1098 ; GFX6-NEXT: v_mov_b32_e32 v3, v10
1099 ; GFX6-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[8:11], 0 offen glc
1100 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1101 ; GFX6-NEXT: buffer_wbinvl1
1102 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
1103 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1104 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
1105 ; GFX6-NEXT: s_cbranch_execnz .LBB3_1
1106 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
1107 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
1108 ; GFX6-NEXT: s_waitcnt expcnt(0)
1109 ; GFX6-NEXT: s_setpc_b64 s[30:31]
1110 %gep = getelementptr double, ptr addrspace(7) %ptr, i32 256
1111 %result = atomicrmw fadd ptr addrspace(7) %gep, double %val syncscope("agent") seq_cst
1115 define void @buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset(ptr addrspace(7) inreg %ptr, double %val) #0 {
1116 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1118 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
1119 ; GFX12-NEXT: s_wait_expcnt 0x0
1120 ; GFX12-NEXT: s_wait_samplecnt 0x0
1121 ; GFX12-NEXT: s_wait_bvhcnt 0x0
1122 ; GFX12-NEXT: s_wait_kmcnt 0x0
1123 ; GFX12-NEXT: v_mov_b32_e32 v2, s6
1124 ; GFX12-NEXT: s_add_co_i32 s4, s6, 0x800
1125 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1126 ; GFX12-NEXT: v_mov_b32_e32 v6, s4
1127 ; GFX12-NEXT: s_mov_b32 s4, 0
1128 ; GFX12-NEXT: buffer_load_b64 v[4:5], v2, s[0:3], null offen offset:2048
1129 ; GFX12-NEXT: .LBB4_1: ; %atomicrmw.start
1130 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
1131 ; GFX12-NEXT: s_wait_loadcnt 0x0
1132 ; GFX12-NEXT: v_add_f64_e32 v[2:3], v[4:5], v[0:1]
1133 ; GFX12-NEXT: v_dual_mov_b32 v10, v5 :: v_dual_mov_b32 v9, v4
1134 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
1135 ; GFX12-NEXT: s_wait_storecnt 0x0
1136 ; GFX12-NEXT: v_dual_mov_b32 v8, v3 :: v_dual_mov_b32 v7, v2
1137 ; GFX12-NEXT: buffer_atomic_cmpswap_b64 v[7:10], v6, s[0:3], null offen th:TH_ATOMIC_RETURN
1138 ; GFX12-NEXT: s_wait_loadcnt 0x0
1139 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
1140 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[7:8], v[4:5]
1141 ; GFX12-NEXT: v_dual_mov_b32 v4, v7 :: v_dual_mov_b32 v5, v8
1142 ; GFX12-NEXT: s_or_b32 s4, vcc_lo, s4
1143 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1144 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
1145 ; GFX12-NEXT: s_cbranch_execnz .LBB4_1
1146 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
1147 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s4
1148 ; GFX12-NEXT: s_setpc_b64 s[30:31]
1150 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1152 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1153 ; GFX940-NEXT: v_mov_b32_e32 v2, s6
1154 ; GFX940-NEXT: buffer_wbl2 sc1
1155 ; GFX940-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[0:3], 0 offen offset:2048
1156 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1157 ; GFX940-NEXT: buffer_inv sc1
1158 ; GFX940-NEXT: s_setpc_b64 s[30:31]
1160 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1162 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1163 ; GFX11-NEXT: v_mov_b32_e32 v2, s6
1164 ; GFX11-NEXT: s_add_i32 s4, s6, 0x800
1165 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1166 ; GFX11-NEXT: v_mov_b32_e32 v6, s4
1167 ; GFX11-NEXT: s_mov_b32 s4, 0
1168 ; GFX11-NEXT: buffer_load_b64 v[4:5], v2, s[0:3], 0 offen offset:2048
1169 ; GFX11-NEXT: .LBB4_1: ; %atomicrmw.start
1170 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
1171 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1172 ; GFX11-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
1173 ; GFX11-NEXT: v_dual_mov_b32 v10, v5 :: v_dual_mov_b32 v9, v4
1174 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1175 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
1176 ; GFX11-NEXT: v_dual_mov_b32 v8, v3 :: v_dual_mov_b32 v7, v2
1177 ; GFX11-NEXT: buffer_atomic_cmpswap_b64 v[7:10], v6, s[0:3], 0 offen glc
1178 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1179 ; GFX11-NEXT: buffer_gl1_inv
1180 ; GFX11-NEXT: buffer_gl0_inv
1181 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[7:8], v[4:5]
1182 ; GFX11-NEXT: v_dual_mov_b32 v4, v7 :: v_dual_mov_b32 v5, v8
1183 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
1184 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1185 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
1186 ; GFX11-NEXT: s_cbranch_execnz .LBB4_1
1187 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
1188 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
1189 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1191 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1193 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1194 ; GFX10-NEXT: v_mov_b32_e32 v2, s18
1195 ; GFX10-NEXT: s_mov_b32 s11, s17
1196 ; GFX10-NEXT: s_mov_b32 s10, s16
1197 ; GFX10-NEXT: s_mov_b32 s9, s7
1198 ; GFX10-NEXT: s_mov_b32 s8, s6
1199 ; GFX10-NEXT: s_add_i32 s4, s18, 0x800
1200 ; GFX10-NEXT: buffer_load_dwordx2 v[4:5], v2, s[8:11], 0 offen offset:2048
1201 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
1202 ; GFX10-NEXT: s_mov_b32 s4, 0
1203 ; GFX10-NEXT: .LBB4_1: ; %atomicrmw.start
1204 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
1205 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1206 ; GFX10-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
1207 ; GFX10-NEXT: v_mov_b32_e32 v10, v5
1208 ; GFX10-NEXT: v_mov_b32_e32 v9, v4
1209 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1210 ; GFX10-NEXT: v_mov_b32_e32 v8, v3
1211 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
1212 ; GFX10-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[8:11], 0 offen glc
1213 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1214 ; GFX10-NEXT: buffer_gl1_inv
1215 ; GFX10-NEXT: buffer_gl0_inv
1216 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[7:8], v[4:5]
1217 ; GFX10-NEXT: v_mov_b32_e32 v4, v7
1218 ; GFX10-NEXT: v_mov_b32_e32 v5, v8
1219 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
1220 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
1221 ; GFX10-NEXT: s_cbranch_execnz .LBB4_1
1222 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
1223 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
1224 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1226 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1228 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1229 ; GFX90A-NEXT: s_mov_b32 s11, s17
1230 ; GFX90A-NEXT: s_mov_b32 s10, s16
1231 ; GFX90A-NEXT: s_mov_b32 s9, s7
1232 ; GFX90A-NEXT: s_mov_b32 s8, s6
1233 ; GFX90A-NEXT: v_mov_b32_e32 v2, s18
1234 ; GFX90A-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[8:11], 0 offen offset:2048
1235 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1236 ; GFX90A-NEXT: buffer_wbinvl1
1237 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
1239 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1241 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1242 ; GFX908-NEXT: s_mov_b32 s11, s17
1243 ; GFX908-NEXT: s_mov_b32 s10, s16
1244 ; GFX908-NEXT: s_mov_b32 s9, s7
1245 ; GFX908-NEXT: s_mov_b32 s8, s6
1246 ; GFX908-NEXT: v_mov_b32_e32 v2, s18
1247 ; GFX908-NEXT: buffer_load_dwordx2 v[4:5], v2, s[8:11], 0 offen offset:2048
1248 ; GFX908-NEXT: s_add_i32 s6, s18, 0x800
1249 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
1250 ; GFX908-NEXT: v_mov_b32_e32 v6, s6
1251 ; GFX908-NEXT: .LBB4_1: ; %atomicrmw.start
1252 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
1253 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1254 ; GFX908-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
1255 ; GFX908-NEXT: v_mov_b32_e32 v10, v5
1256 ; GFX908-NEXT: v_mov_b32_e32 v9, v4
1257 ; GFX908-NEXT: v_mov_b32_e32 v8, v3
1258 ; GFX908-NEXT: v_mov_b32_e32 v7, v2
1259 ; GFX908-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[8:11], 0 offen glc
1260 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1261 ; GFX908-NEXT: buffer_wbinvl1
1262 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, v[7:8], v[4:5]
1263 ; GFX908-NEXT: v_mov_b32_e32 v4, v7
1264 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1265 ; GFX908-NEXT: v_mov_b32_e32 v5, v8
1266 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
1267 ; GFX908-NEXT: s_cbranch_execnz .LBB4_1
1268 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
1269 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
1270 ; GFX908-NEXT: s_setpc_b64 s[30:31]
1272 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1274 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1275 ; GFX8-NEXT: s_mov_b32 s11, s17
1276 ; GFX8-NEXT: s_mov_b32 s10, s16
1277 ; GFX8-NEXT: s_mov_b32 s9, s7
1278 ; GFX8-NEXT: s_mov_b32 s8, s6
1279 ; GFX8-NEXT: v_mov_b32_e32 v2, s18
1280 ; GFX8-NEXT: buffer_load_dwordx2 v[4:5], v2, s[8:11], 0 offen offset:2048
1281 ; GFX8-NEXT: s_add_i32 s6, s18, 0x800
1282 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
1283 ; GFX8-NEXT: v_mov_b32_e32 v6, s6
1284 ; GFX8-NEXT: .LBB4_1: ; %atomicrmw.start
1285 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
1286 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1287 ; GFX8-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
1288 ; GFX8-NEXT: v_mov_b32_e32 v10, v5
1289 ; GFX8-NEXT: v_mov_b32_e32 v9, v4
1290 ; GFX8-NEXT: v_mov_b32_e32 v8, v3
1291 ; GFX8-NEXT: v_mov_b32_e32 v7, v2
1292 ; GFX8-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[8:11], 0 offen glc
1293 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1294 ; GFX8-NEXT: buffer_wbinvl1
1295 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, v[7:8], v[4:5]
1296 ; GFX8-NEXT: v_mov_b32_e32 v4, v7
1297 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1298 ; GFX8-NEXT: v_mov_b32_e32 v5, v8
1299 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
1300 ; GFX8-NEXT: s_cbranch_execnz .LBB4_1
1301 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
1302 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
1303 ; GFX8-NEXT: s_setpc_b64 s[30:31]
1305 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1307 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1308 ; GFX7-NEXT: s_mov_b32 s11, s17
1309 ; GFX7-NEXT: s_mov_b32 s10, s16
1310 ; GFX7-NEXT: s_mov_b32 s9, s7
1311 ; GFX7-NEXT: s_mov_b32 s8, s6
1312 ; GFX7-NEXT: v_mov_b32_e32 v2, s18
1313 ; GFX7-NEXT: buffer_load_dwordx2 v[4:5], v2, s[8:11], 0 offen offset:2048
1314 ; GFX7-NEXT: s_add_i32 s6, s18, 0x800
1315 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
1316 ; GFX7-NEXT: v_mov_b32_e32 v6, s6
1317 ; GFX7-NEXT: .LBB4_1: ; %atomicrmw.start
1318 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
1319 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1320 ; GFX7-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
1321 ; GFX7-NEXT: v_mov_b32_e32 v10, v5
1322 ; GFX7-NEXT: v_mov_b32_e32 v9, v4
1323 ; GFX7-NEXT: v_mov_b32_e32 v8, v3
1324 ; GFX7-NEXT: v_mov_b32_e32 v7, v2
1325 ; GFX7-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[8:11], 0 offen glc
1326 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1327 ; GFX7-NEXT: buffer_wbinvl1
1328 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, v[7:8], v[4:5]
1329 ; GFX7-NEXT: v_mov_b32_e32 v4, v7
1330 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1331 ; GFX7-NEXT: v_mov_b32_e32 v5, v8
1332 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
1333 ; GFX7-NEXT: s_cbranch_execnz .LBB4_1
1334 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
1335 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
1336 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1338 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset:
1340 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1341 ; GFX6-NEXT: s_mov_b32 s11, s17
1342 ; GFX6-NEXT: s_mov_b32 s10, s16
1343 ; GFX6-NEXT: s_mov_b32 s9, s7
1344 ; GFX6-NEXT: s_mov_b32 s8, s6
1345 ; GFX6-NEXT: v_mov_b32_e32 v2, s18
1346 ; GFX6-NEXT: buffer_load_dwordx2 v[4:5], v2, s[8:11], 0 offen offset:2048
1347 ; GFX6-NEXT: s_add_i32 s6, s18, 0x800
1348 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
1349 ; GFX6-NEXT: v_mov_b32_e32 v6, s6
1350 ; GFX6-NEXT: .LBB4_1: ; %atomicrmw.start
1351 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
1352 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1353 ; GFX6-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
1354 ; GFX6-NEXT: s_waitcnt expcnt(0)
1355 ; GFX6-NEXT: v_mov_b32_e32 v10, v5
1356 ; GFX6-NEXT: v_mov_b32_e32 v9, v4
1357 ; GFX6-NEXT: v_mov_b32_e32 v8, v3
1358 ; GFX6-NEXT: v_mov_b32_e32 v7, v2
1359 ; GFX6-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[8:11], 0 offen glc
1360 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1361 ; GFX6-NEXT: buffer_wbinvl1
1362 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, v[7:8], v[4:5]
1363 ; GFX6-NEXT: v_mov_b32_e32 v4, v7
1364 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1365 ; GFX6-NEXT: v_mov_b32_e32 v5, v8
1366 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
1367 ; GFX6-NEXT: s_cbranch_execnz .LBB4_1
1368 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
1369 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
1370 ; GFX6-NEXT: s_waitcnt expcnt(0)
1371 ; GFX6-NEXT: s_setpc_b64 s[30:31]
1372 %gep = getelementptr double, ptr addrspace(7) %ptr, i32 256
1373 %unused = atomicrmw fadd ptr addrspace(7) %gep, double %val syncscope("agent") seq_cst
1377 define double @buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall(ptr addrspace(7) %ptr, double %val) #0 {
1378 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1380 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
1381 ; GFX12-NEXT: s_wait_expcnt 0x0
1382 ; GFX12-NEXT: s_wait_samplecnt 0x0
1383 ; GFX12-NEXT: s_wait_bvhcnt 0x0
1384 ; GFX12-NEXT: s_wait_kmcnt 0x0
1385 ; GFX12-NEXT: v_dual_mov_b32 v8, v3 :: v_dual_mov_b32 v7, v2
1386 ; GFX12-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
1387 ; GFX12-NEXT: v_add_nc_u32_e32 v15, 0x800, v4
1388 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
1389 ; GFX12-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1390 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
1391 ; GFX12-NEXT: v_readfirstlane_b32 s4, v9
1392 ; GFX12-NEXT: v_readfirstlane_b32 s5, v10
1393 ; GFX12-NEXT: v_readfirstlane_b32 s6, v7
1394 ; GFX12-NEXT: v_readfirstlane_b32 s7, v8
1395 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
1396 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[9:10]
1397 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[7:8]
1398 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
1399 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
1400 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
1401 ; GFX12-NEXT: buffer_load_b64 v[13:14], v4, s[4:7], null offen offset:2048
1402 ; GFX12-NEXT: ; implicit-def: $vgpr4
1403 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
1404 ; GFX12-NEXT: s_cbranch_execnz .LBB5_1
1405 ; GFX12-NEXT: ; %bb.2:
1406 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
1407 ; GFX12-NEXT: s_mov_b32 s1, 0
1408 ; GFX12-NEXT: .LBB5_3: ; %atomicrmw.start
1409 ; GFX12-NEXT: ; =>This Loop Header: Depth=1
1410 ; GFX12-NEXT: ; Child Loop BB5_4 Depth 2
1411 ; GFX12-NEXT: s_wait_loadcnt 0x0
1412 ; GFX12-NEXT: v_add_f64_e32 v[11:12], v[13:14], v[5:6]
1413 ; GFX12-NEXT: s_mov_b32 s2, exec_lo
1414 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
1415 ; GFX12-NEXT: s_wait_storecnt 0x0
1416 ; GFX12-NEXT: v_dual_mov_b32 v0, v11 :: v_dual_mov_b32 v1, v12
1417 ; GFX12-NEXT: v_dual_mov_b32 v2, v13 :: v_dual_mov_b32 v3, v14
1418 ; GFX12-NEXT: .LBB5_4: ; Parent Loop BB5_3 Depth=1
1419 ; GFX12-NEXT: ; => This Inner Loop Header: Depth=2
1420 ; GFX12-NEXT: v_readfirstlane_b32 s4, v9
1421 ; GFX12-NEXT: v_readfirstlane_b32 s5, v10
1422 ; GFX12-NEXT: v_readfirstlane_b32 s6, v7
1423 ; GFX12-NEXT: v_readfirstlane_b32 s7, v8
1424 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
1425 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[9:10]
1426 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[7:8]
1427 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
1428 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
1429 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
1430 ; GFX12-NEXT: s_wait_loadcnt 0x0
1431 ; GFX12-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v15, s[4:7], null offen th:TH_ATOMIC_RETURN
1432 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
1433 ; GFX12-NEXT: s_cbranch_execnz .LBB5_4
1434 ; GFX12-NEXT: ; %bb.5: ; in Loop: Header=BB5_3 Depth=1
1435 ; GFX12-NEXT: s_mov_b32 exec_lo, s2
1436 ; GFX12-NEXT: s_wait_loadcnt 0x0
1437 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[13:14]
1438 ; GFX12-NEXT: v_dual_mov_b32 v14, v1 :: v_dual_mov_b32 v13, v0
1439 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
1440 ; GFX12-NEXT: s_or_b32 s1, vcc_lo, s1
1441 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1442 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
1443 ; GFX12-NEXT: s_cbranch_execnz .LBB5_3
1444 ; GFX12-NEXT: ; %bb.6: ; %atomicrmw.end
1445 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s1
1446 ; GFX12-NEXT: s_setpc_b64 s[30:31]
1448 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1450 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1451 ; GFX940-NEXT: v_mov_b32_e32 v7, v6
1452 ; GFX940-NEXT: v_mov_b32_e32 v6, v5
1453 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
1454 ; GFX940-NEXT: buffer_wbl2 sc1
1455 ; GFX940-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1456 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
1457 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
1458 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
1459 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
1460 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
1461 ; GFX940-NEXT: s_nop 0
1462 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
1463 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
1464 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
1465 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1466 ; GFX940-NEXT: buffer_atomic_add_f64 v[6:7], v4, s[4:7], 0 offen offset:2048 sc0
1467 ; GFX940-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
1468 ; GFX940-NEXT: ; implicit-def: $vgpr4
1469 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
1470 ; GFX940-NEXT: s_cbranch_execnz .LBB5_1
1471 ; GFX940-NEXT: ; %bb.2:
1472 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
1473 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1474 ; GFX940-NEXT: v_mov_b32_e32 v0, v6
1475 ; GFX940-NEXT: v_mov_b32_e32 v1, v7
1476 ; GFX940-NEXT: buffer_inv sc1
1477 ; GFX940-NEXT: s_setpc_b64 s[30:31]
1479 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1481 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1482 ; GFX11-NEXT: v_dual_mov_b32 v8, v3 :: v_dual_mov_b32 v7, v2
1483 ; GFX11-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
1484 ; GFX11-NEXT: v_add_nc_u32_e32 v15, 0x800, v4
1485 ; GFX11-NEXT: s_mov_b32 s1, 0
1486 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
1487 ; GFX11-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1488 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_3)
1489 ; GFX11-NEXT: v_readfirstlane_b32 s4, v9
1490 ; GFX11-NEXT: v_readfirstlane_b32 s5, v10
1491 ; GFX11-NEXT: v_readfirstlane_b32 s6, v7
1492 ; GFX11-NEXT: v_readfirstlane_b32 s7, v8
1493 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[9:10]
1494 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
1495 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[7:8]
1496 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
1497 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1498 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
1499 ; GFX11-NEXT: buffer_load_b64 v[13:14], v4, s[4:7], 0 offen offset:2048
1500 ; GFX11-NEXT: ; implicit-def: $vgpr4
1501 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
1502 ; GFX11-NEXT: s_cbranch_execnz .LBB5_1
1503 ; GFX11-NEXT: ; %bb.2:
1504 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
1505 ; GFX11-NEXT: .p2align 6
1506 ; GFX11-NEXT: .LBB5_3: ; %atomicrmw.start
1507 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
1508 ; GFX11-NEXT: ; Child Loop BB5_4 Depth 2
1509 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1510 ; GFX11-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
1511 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
1512 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1513 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
1514 ; GFX11-NEXT: v_dual_mov_b32 v0, v11 :: v_dual_mov_b32 v1, v12
1515 ; GFX11-NEXT: v_dual_mov_b32 v2, v13 :: v_dual_mov_b32 v3, v14
1516 ; GFX11-NEXT: .LBB5_4: ; Parent Loop BB5_3 Depth=1
1517 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
1518 ; GFX11-NEXT: v_readfirstlane_b32 s4, v9
1519 ; GFX11-NEXT: v_readfirstlane_b32 s5, v10
1520 ; GFX11-NEXT: v_readfirstlane_b32 s6, v7
1521 ; GFX11-NEXT: v_readfirstlane_b32 s7, v8
1522 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
1523 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[9:10]
1524 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[7:8]
1525 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
1526 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
1527 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
1528 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1529 ; GFX11-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v15, s[4:7], 0 offen glc
1530 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
1531 ; GFX11-NEXT: s_cbranch_execnz .LBB5_4
1532 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB5_3 Depth=1
1533 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
1534 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1535 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[13:14]
1536 ; GFX11-NEXT: v_dual_mov_b32 v14, v1 :: v_dual_mov_b32 v13, v0
1537 ; GFX11-NEXT: buffer_gl1_inv
1538 ; GFX11-NEXT: buffer_gl0_inv
1539 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
1540 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1541 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
1542 ; GFX11-NEXT: s_cbranch_execnz .LBB5_3
1543 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
1544 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
1545 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1547 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1549 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1550 ; GFX10-NEXT: v_mov_b32_e32 v8, v3
1551 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
1552 ; GFX10-NEXT: v_mov_b32_e32 v10, v1
1553 ; GFX10-NEXT: v_mov_b32_e32 v9, v0
1554 ; GFX10-NEXT: v_add_nc_u32_e32 v15, 0x800, v4
1555 ; GFX10-NEXT: s_mov_b32 s5, 0
1556 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
1557 ; GFX10-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1558 ; GFX10-NEXT: v_readfirstlane_b32 s8, v9
1559 ; GFX10-NEXT: v_readfirstlane_b32 s9, v10
1560 ; GFX10-NEXT: v_readfirstlane_b32 s10, v7
1561 ; GFX10-NEXT: v_readfirstlane_b32 s11, v8
1562 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[9:10]
1563 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[7:8]
1564 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
1565 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
1566 ; GFX10-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
1567 ; GFX10-NEXT: ; implicit-def: $vgpr4
1568 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
1569 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
1570 ; GFX10-NEXT: s_cbranch_execnz .LBB5_1
1571 ; GFX10-NEXT: ; %bb.2:
1572 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
1573 ; GFX10-NEXT: .LBB5_3: ; %atomicrmw.start
1574 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
1575 ; GFX10-NEXT: ; Child Loop BB5_4 Depth 2
1576 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1577 ; GFX10-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
1578 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
1579 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1580 ; GFX10-NEXT: v_mov_b32_e32 v0, v11
1581 ; GFX10-NEXT: v_mov_b32_e32 v1, v12
1582 ; GFX10-NEXT: v_mov_b32_e32 v2, v13
1583 ; GFX10-NEXT: v_mov_b32_e32 v3, v14
1584 ; GFX10-NEXT: .LBB5_4: ; Parent Loop BB5_3 Depth=1
1585 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
1586 ; GFX10-NEXT: v_readfirstlane_b32 s8, v9
1587 ; GFX10-NEXT: v_readfirstlane_b32 s9, v10
1588 ; GFX10-NEXT: v_readfirstlane_b32 s10, v7
1589 ; GFX10-NEXT: v_readfirstlane_b32 s11, v8
1590 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[9:10]
1591 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[7:8]
1592 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
1593 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
1594 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1595 ; GFX10-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
1596 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
1597 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
1598 ; GFX10-NEXT: s_cbranch_execnz .LBB5_4
1599 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB5_3 Depth=1
1600 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
1601 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1602 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[13:14]
1603 ; GFX10-NEXT: v_mov_b32_e32 v14, v1
1604 ; GFX10-NEXT: v_mov_b32_e32 v13, v0
1605 ; GFX10-NEXT: buffer_gl1_inv
1606 ; GFX10-NEXT: buffer_gl0_inv
1607 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
1608 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
1609 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
1610 ; GFX10-NEXT: s_cbranch_execnz .LBB5_3
1611 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
1612 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
1613 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1615 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1617 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1618 ; GFX90A-NEXT: v_mov_b32_e32 v7, v6
1619 ; GFX90A-NEXT: v_mov_b32_e32 v6, v5
1620 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
1621 ; GFX90A-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1622 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
1623 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
1624 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
1625 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
1626 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
1627 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
1628 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1629 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1630 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1631 ; GFX90A-NEXT: buffer_atomic_add_f64 v[6:7], v4, s[8:11], 0 offen offset:2048 glc
1632 ; GFX90A-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
1633 ; GFX90A-NEXT: ; implicit-def: $vgpr4
1634 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
1635 ; GFX90A-NEXT: s_cbranch_execnz .LBB5_1
1636 ; GFX90A-NEXT: ; %bb.2:
1637 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
1638 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1639 ; GFX90A-NEXT: v_mov_b32_e32 v0, v6
1640 ; GFX90A-NEXT: v_mov_b32_e32 v1, v7
1641 ; GFX90A-NEXT: buffer_wbinvl1
1642 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
1644 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1646 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1647 ; GFX908-NEXT: v_mov_b32_e32 v8, v3
1648 ; GFX908-NEXT: v_mov_b32_e32 v7, v2
1649 ; GFX908-NEXT: v_mov_b32_e32 v10, v1
1650 ; GFX908-NEXT: v_mov_b32_e32 v9, v0
1651 ; GFX908-NEXT: v_add_u32_e32 v15, 0x800, v4
1652 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
1653 ; GFX908-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1654 ; GFX908-NEXT: v_readfirstlane_b32 s8, v9
1655 ; GFX908-NEXT: v_readfirstlane_b32 s9, v10
1656 ; GFX908-NEXT: v_readfirstlane_b32 s10, v7
1657 ; GFX908-NEXT: v_readfirstlane_b32 s11, v8
1658 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
1659 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
1660 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1661 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1662 ; GFX908-NEXT: s_nop 0
1663 ; GFX908-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
1664 ; GFX908-NEXT: ; implicit-def: $vgpr4
1665 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
1666 ; GFX908-NEXT: s_cbranch_execnz .LBB5_1
1667 ; GFX908-NEXT: ; %bb.2:
1668 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
1669 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
1670 ; GFX908-NEXT: .LBB5_3: ; %atomicrmw.start
1671 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
1672 ; GFX908-NEXT: ; Child Loop BB5_4 Depth 2
1673 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1674 ; GFX908-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
1675 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
1676 ; GFX908-NEXT: v_mov_b32_e32 v0, v11
1677 ; GFX908-NEXT: v_mov_b32_e32 v1, v12
1678 ; GFX908-NEXT: v_mov_b32_e32 v2, v13
1679 ; GFX908-NEXT: v_mov_b32_e32 v3, v14
1680 ; GFX908-NEXT: .LBB5_4: ; Parent Loop BB5_3 Depth=1
1681 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
1682 ; GFX908-NEXT: v_readfirstlane_b32 s8, v9
1683 ; GFX908-NEXT: v_readfirstlane_b32 s9, v10
1684 ; GFX908-NEXT: v_readfirstlane_b32 s10, v7
1685 ; GFX908-NEXT: v_readfirstlane_b32 s11, v8
1686 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
1687 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
1688 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1689 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1690 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1691 ; GFX908-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
1692 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
1693 ; GFX908-NEXT: s_cbranch_execnz .LBB5_4
1694 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB5_3 Depth=1
1695 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
1696 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1697 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[13:14]
1698 ; GFX908-NEXT: v_mov_b32_e32 v14, v1
1699 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
1700 ; GFX908-NEXT: v_mov_b32_e32 v13, v0
1701 ; GFX908-NEXT: buffer_wbinvl1
1702 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
1703 ; GFX908-NEXT: s_cbranch_execnz .LBB5_3
1704 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
1705 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
1706 ; GFX908-NEXT: s_setpc_b64 s[30:31]
1708 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1710 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1711 ; GFX8-NEXT: v_mov_b32_e32 v8, v3
1712 ; GFX8-NEXT: v_mov_b32_e32 v7, v2
1713 ; GFX8-NEXT: v_mov_b32_e32 v10, v1
1714 ; GFX8-NEXT: v_mov_b32_e32 v9, v0
1715 ; GFX8-NEXT: v_add_u32_e32 v15, vcc, 0x800, v4
1716 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
1717 ; GFX8-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1718 ; GFX8-NEXT: v_readfirstlane_b32 s8, v9
1719 ; GFX8-NEXT: v_readfirstlane_b32 s9, v10
1720 ; GFX8-NEXT: v_readfirstlane_b32 s10, v7
1721 ; GFX8-NEXT: v_readfirstlane_b32 s11, v8
1722 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
1723 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
1724 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1725 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1726 ; GFX8-NEXT: s_nop 0
1727 ; GFX8-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
1728 ; GFX8-NEXT: ; implicit-def: $vgpr4
1729 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
1730 ; GFX8-NEXT: s_cbranch_execnz .LBB5_1
1731 ; GFX8-NEXT: ; %bb.2:
1732 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
1733 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
1734 ; GFX8-NEXT: .LBB5_3: ; %atomicrmw.start
1735 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
1736 ; GFX8-NEXT: ; Child Loop BB5_4 Depth 2
1737 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1738 ; GFX8-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
1739 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
1740 ; GFX8-NEXT: v_mov_b32_e32 v0, v11
1741 ; GFX8-NEXT: v_mov_b32_e32 v1, v12
1742 ; GFX8-NEXT: v_mov_b32_e32 v2, v13
1743 ; GFX8-NEXT: v_mov_b32_e32 v3, v14
1744 ; GFX8-NEXT: .LBB5_4: ; Parent Loop BB5_3 Depth=1
1745 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
1746 ; GFX8-NEXT: v_readfirstlane_b32 s8, v9
1747 ; GFX8-NEXT: v_readfirstlane_b32 s9, v10
1748 ; GFX8-NEXT: v_readfirstlane_b32 s10, v7
1749 ; GFX8-NEXT: v_readfirstlane_b32 s11, v8
1750 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
1751 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
1752 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1753 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1754 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1755 ; GFX8-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
1756 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
1757 ; GFX8-NEXT: s_cbranch_execnz .LBB5_4
1758 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB5_3 Depth=1
1759 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
1760 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1761 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[13:14]
1762 ; GFX8-NEXT: v_mov_b32_e32 v14, v1
1763 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
1764 ; GFX8-NEXT: v_mov_b32_e32 v13, v0
1765 ; GFX8-NEXT: buffer_wbinvl1
1766 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
1767 ; GFX8-NEXT: s_cbranch_execnz .LBB5_3
1768 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
1769 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
1770 ; GFX8-NEXT: s_setpc_b64 s[30:31]
1772 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1774 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1775 ; GFX7-NEXT: v_mov_b32_e32 v8, v3
1776 ; GFX7-NEXT: v_mov_b32_e32 v7, v2
1777 ; GFX7-NEXT: v_mov_b32_e32 v10, v1
1778 ; GFX7-NEXT: v_mov_b32_e32 v9, v0
1779 ; GFX7-NEXT: v_add_i32_e32 v15, vcc, 0x800, v4
1780 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
1781 ; GFX7-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1782 ; GFX7-NEXT: v_readfirstlane_b32 s8, v9
1783 ; GFX7-NEXT: v_readfirstlane_b32 s9, v10
1784 ; GFX7-NEXT: v_readfirstlane_b32 s10, v7
1785 ; GFX7-NEXT: v_readfirstlane_b32 s11, v8
1786 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
1787 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
1788 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1789 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1790 ; GFX7-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
1791 ; GFX7-NEXT: ; implicit-def: $vgpr4
1792 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
1793 ; GFX7-NEXT: s_cbranch_execnz .LBB5_1
1794 ; GFX7-NEXT: ; %bb.2:
1795 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
1796 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
1797 ; GFX7-NEXT: .LBB5_3: ; %atomicrmw.start
1798 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
1799 ; GFX7-NEXT: ; Child Loop BB5_4 Depth 2
1800 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1801 ; GFX7-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
1802 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
1803 ; GFX7-NEXT: v_mov_b32_e32 v0, v11
1804 ; GFX7-NEXT: v_mov_b32_e32 v1, v12
1805 ; GFX7-NEXT: v_mov_b32_e32 v2, v13
1806 ; GFX7-NEXT: v_mov_b32_e32 v3, v14
1807 ; GFX7-NEXT: .LBB5_4: ; Parent Loop BB5_3 Depth=1
1808 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
1809 ; GFX7-NEXT: v_readfirstlane_b32 s8, v9
1810 ; GFX7-NEXT: v_readfirstlane_b32 s9, v10
1811 ; GFX7-NEXT: v_readfirstlane_b32 s10, v7
1812 ; GFX7-NEXT: v_readfirstlane_b32 s11, v8
1813 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
1814 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
1815 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1816 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1817 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1818 ; GFX7-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
1819 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
1820 ; GFX7-NEXT: s_cbranch_execnz .LBB5_4
1821 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB5_3 Depth=1
1822 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
1823 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1824 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[13:14]
1825 ; GFX7-NEXT: v_mov_b32_e32 v14, v1
1826 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
1827 ; GFX7-NEXT: v_mov_b32_e32 v13, v0
1828 ; GFX7-NEXT: buffer_wbinvl1
1829 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
1830 ; GFX7-NEXT: s_cbranch_execnz .LBB5_3
1831 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
1832 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
1833 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1835 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall:
1837 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1838 ; GFX6-NEXT: v_mov_b32_e32 v8, v3
1839 ; GFX6-NEXT: v_mov_b32_e32 v7, v2
1840 ; GFX6-NEXT: v_mov_b32_e32 v10, v1
1841 ; GFX6-NEXT: v_mov_b32_e32 v9, v0
1842 ; GFX6-NEXT: v_add_i32_e32 v15, vcc, 0x800, v4
1843 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
1844 ; GFX6-NEXT: .LBB5_1: ; =>This Inner Loop Header: Depth=1
1845 ; GFX6-NEXT: v_readfirstlane_b32 s8, v9
1846 ; GFX6-NEXT: v_readfirstlane_b32 s9, v10
1847 ; GFX6-NEXT: v_readfirstlane_b32 s10, v7
1848 ; GFX6-NEXT: v_readfirstlane_b32 s11, v8
1849 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
1850 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
1851 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1852 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1853 ; GFX6-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
1854 ; GFX6-NEXT: ; implicit-def: $vgpr4
1855 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
1856 ; GFX6-NEXT: s_cbranch_execnz .LBB5_1
1857 ; GFX6-NEXT: ; %bb.2:
1858 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
1859 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
1860 ; GFX6-NEXT: .LBB5_3: ; %atomicrmw.start
1861 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
1862 ; GFX6-NEXT: ; Child Loop BB5_4 Depth 2
1863 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1864 ; GFX6-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
1865 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
1866 ; GFX6-NEXT: s_waitcnt expcnt(0)
1867 ; GFX6-NEXT: v_mov_b32_e32 v0, v11
1868 ; GFX6-NEXT: v_mov_b32_e32 v1, v12
1869 ; GFX6-NEXT: v_mov_b32_e32 v2, v13
1870 ; GFX6-NEXT: v_mov_b32_e32 v3, v14
1871 ; GFX6-NEXT: .LBB5_4: ; Parent Loop BB5_3 Depth=1
1872 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
1873 ; GFX6-NEXT: v_readfirstlane_b32 s8, v9
1874 ; GFX6-NEXT: v_readfirstlane_b32 s9, v10
1875 ; GFX6-NEXT: v_readfirstlane_b32 s10, v7
1876 ; GFX6-NEXT: v_readfirstlane_b32 s11, v8
1877 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
1878 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
1879 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
1880 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
1881 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
1882 ; GFX6-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
1883 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
1884 ; GFX6-NEXT: s_cbranch_execnz .LBB5_4
1885 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB5_3 Depth=1
1886 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
1887 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1888 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[13:14]
1889 ; GFX6-NEXT: v_mov_b32_e32 v14, v1
1890 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
1891 ; GFX6-NEXT: v_mov_b32_e32 v13, v0
1892 ; GFX6-NEXT: buffer_wbinvl1
1893 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
1894 ; GFX6-NEXT: s_cbranch_execnz .LBB5_3
1895 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
1896 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
1897 ; GFX6-NEXT: s_waitcnt expcnt(0)
1898 ; GFX6-NEXT: s_setpc_b64 s[30:31]
1899 %gep = getelementptr double, ptr addrspace(7) %ptr, i32 256
1900 %result = atomicrmw fadd ptr addrspace(7) %gep, double %val syncscope("agent") seq_cst
1904 ; --------------------------------------------------------------------
1906 ; --------------------------------------------------------------------
1908 define half @buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset(ptr addrspace(7) inreg %ptr, half %val) #0 {
1909 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
1911 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
1912 ; GFX12-NEXT: s_wait_expcnt 0x0
1913 ; GFX12-NEXT: s_wait_samplecnt 0x0
1914 ; GFX12-NEXT: s_wait_bvhcnt 0x0
1915 ; GFX12-NEXT: s_wait_kmcnt 0x0
1916 ; GFX12-NEXT: s_addk_co_i32 s6, 0x200
1917 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
1918 ; GFX12-NEXT: s_and_b32 s4, s6, -4
1919 ; GFX12-NEXT: v_mov_b32_e32 v5, s4
1920 ; GFX12-NEXT: s_and_b32 s4, s6, 3
1921 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
1922 ; GFX12-NEXT: s_lshl_b32 s4, s4, 3
1923 ; GFX12-NEXT: s_lshl_b32 s5, 0xffff, s4
1924 ; GFX12-NEXT: buffer_load_b32 v2, v5, s[0:3], null offen
1925 ; GFX12-NEXT: s_not_b32 s6, s5
1926 ; GFX12-NEXT: s_mov_b32 s5, 0
1927 ; GFX12-NEXT: .LBB6_1: ; %atomicrmw.start
1928 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
1929 ; GFX12-NEXT: s_wait_loadcnt 0x0
1930 ; GFX12-NEXT: v_lshrrev_b32_e32 v1, s4, v2
1931 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
1932 ; GFX12-NEXT: s_wait_storecnt 0x0
1933 ; GFX12-NEXT: v_add_f16_e32 v1, v1, v0
1934 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1935 ; GFX12-NEXT: v_and_b32_e32 v1, 0xffff, v1
1936 ; GFX12-NEXT: v_lshlrev_b32_e32 v1, s4, v1
1937 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1938 ; GFX12-NEXT: v_and_or_b32 v1, v2, s6, v1
1939 ; GFX12-NEXT: v_dual_mov_b32 v4, v2 :: v_dual_mov_b32 v3, v1
1940 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[3:4], v5, s[0:3], null offen th:TH_ATOMIC_RETURN
1941 ; GFX12-NEXT: s_wait_loadcnt 0x0
1942 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
1943 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v2
1944 ; GFX12-NEXT: v_mov_b32_e32 v2, v3
1945 ; GFX12-NEXT: s_or_b32 s5, vcc_lo, s5
1946 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1947 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
1948 ; GFX12-NEXT: s_cbranch_execnz .LBB6_1
1949 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
1950 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s5
1951 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, s4, v3
1952 ; GFX12-NEXT: s_setpc_b64 s[30:31]
1954 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
1956 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1957 ; GFX940-NEXT: s_addk_i32 s6, 0x200
1958 ; GFX940-NEXT: s_and_b32 s4, s6, -4
1959 ; GFX940-NEXT: v_mov_b32_e32 v1, s4
1960 ; GFX940-NEXT: buffer_load_dword v3, v1, s[0:3], 0 offen
1961 ; GFX940-NEXT: s_and_b32 s4, s6, 3
1962 ; GFX940-NEXT: s_lshl_b32 s6, s4, 3
1963 ; GFX940-NEXT: s_lshl_b32 s4, 0xffff, s6
1964 ; GFX940-NEXT: s_not_b32 s7, s4
1965 ; GFX940-NEXT: s_mov_b64 s[4:5], 0
1966 ; GFX940-NEXT: .LBB6_1: ; %atomicrmw.start
1967 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
1968 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1969 ; GFX940-NEXT: v_lshrrev_b32_e32 v2, s6, v3
1970 ; GFX940-NEXT: v_add_f16_e32 v2, v2, v0
1971 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, s6, v2
1972 ; GFX940-NEXT: v_and_or_b32 v2, v3, s7, v2
1973 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[2:3]
1974 ; GFX940-NEXT: buffer_wbl2 sc1
1975 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[0:3], 0 offen sc0
1976 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1977 ; GFX940-NEXT: buffer_inv sc1
1978 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
1979 ; GFX940-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1980 ; GFX940-NEXT: v_mov_b32_e32 v3, v4
1981 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[4:5]
1982 ; GFX940-NEXT: s_cbranch_execnz .LBB6_1
1983 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
1984 ; GFX940-NEXT: s_or_b64 exec, exec, s[4:5]
1985 ; GFX940-NEXT: v_lshrrev_b32_e32 v0, s6, v4
1986 ; GFX940-NEXT: s_setpc_b64 s[30:31]
1988 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
1990 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1991 ; GFX11-NEXT: s_addk_i32 s6, 0x200
1992 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
1993 ; GFX11-NEXT: s_and_b32 s4, s6, -4
1994 ; GFX11-NEXT: v_mov_b32_e32 v5, s4
1995 ; GFX11-NEXT: s_and_b32 s4, s6, 3
1996 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
1997 ; GFX11-NEXT: s_lshl_b32 s4, s4, 3
1998 ; GFX11-NEXT: s_lshl_b32 s5, 0xffff, s4
1999 ; GFX11-NEXT: buffer_load_b32 v2, v5, s[0:3], 0 offen
2000 ; GFX11-NEXT: s_not_b32 s6, s5
2001 ; GFX11-NEXT: s_mov_b32 s5, 0
2002 ; GFX11-NEXT: .LBB6_1: ; %atomicrmw.start
2003 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
2004 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2005 ; GFX11-NEXT: v_lshrrev_b32_e32 v1, s4, v2
2006 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2007 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2008 ; GFX11-NEXT: v_add_f16_e32 v1, v1, v0
2009 ; GFX11-NEXT: v_and_b32_e32 v1, 0xffff, v1
2010 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2011 ; GFX11-NEXT: v_lshlrev_b32_e32 v1, s4, v1
2012 ; GFX11-NEXT: v_and_or_b32 v1, v2, s6, v1
2013 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
2014 ; GFX11-NEXT: v_dual_mov_b32 v4, v2 :: v_dual_mov_b32 v3, v1
2015 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[3:4], v5, s[0:3], 0 offen glc
2016 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2017 ; GFX11-NEXT: buffer_gl1_inv
2018 ; GFX11-NEXT: buffer_gl0_inv
2019 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v2
2020 ; GFX11-NEXT: v_mov_b32_e32 v2, v3
2021 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
2022 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2023 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
2024 ; GFX11-NEXT: s_cbranch_execnz .LBB6_1
2025 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
2026 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
2027 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, s4, v3
2028 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2030 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
2032 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2033 ; GFX10-NEXT: s_addk_i32 s18, 0x200
2034 ; GFX10-NEXT: s_mov_b32 s11, s17
2035 ; GFX10-NEXT: s_and_b32 s4, s18, -4
2036 ; GFX10-NEXT: s_mov_b32 s10, s16
2037 ; GFX10-NEXT: v_mov_b32_e32 v5, s4
2038 ; GFX10-NEXT: s_mov_b32 s9, s7
2039 ; GFX10-NEXT: s_mov_b32 s8, s6
2040 ; GFX10-NEXT: s_and_b32 s4, s18, 3
2041 ; GFX10-NEXT: s_lshl_b32 s4, s4, 3
2042 ; GFX10-NEXT: buffer_load_dword v2, v5, s[8:11], 0 offen
2043 ; GFX10-NEXT: s_lshl_b32 s5, 0xffff, s4
2044 ; GFX10-NEXT: s_not_b32 s6, s5
2045 ; GFX10-NEXT: s_mov_b32 s5, 0
2046 ; GFX10-NEXT: .LBB6_1: ; %atomicrmw.start
2047 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
2048 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2049 ; GFX10-NEXT: v_lshrrev_b32_e32 v1, s4, v2
2050 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2051 ; GFX10-NEXT: v_add_f16_e32 v1, v1, v0
2052 ; GFX10-NEXT: v_lshlrev_b32_sdwa v1, s4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
2053 ; GFX10-NEXT: v_and_or_b32 v1, v2, s6, v1
2054 ; GFX10-NEXT: v_mov_b32_e32 v4, v2
2055 ; GFX10-NEXT: v_mov_b32_e32 v3, v1
2056 ; GFX10-NEXT: buffer_atomic_cmpswap v[3:4], v5, s[8:11], 0 offen glc
2057 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2058 ; GFX10-NEXT: buffer_gl1_inv
2059 ; GFX10-NEXT: buffer_gl0_inv
2060 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v2
2061 ; GFX10-NEXT: v_mov_b32_e32 v2, v3
2062 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
2063 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
2064 ; GFX10-NEXT: s_cbranch_execnz .LBB6_1
2065 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
2066 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
2067 ; GFX10-NEXT: v_lshrrev_b32_e32 v0, s4, v3
2068 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2070 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
2072 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2073 ; GFX90A-NEXT: s_addk_i32 s18, 0x200
2074 ; GFX90A-NEXT: s_and_b32 s4, s18, -4
2075 ; GFX90A-NEXT: s_mov_b32 s11, s17
2076 ; GFX90A-NEXT: s_mov_b32 s10, s16
2077 ; GFX90A-NEXT: s_mov_b32 s9, s7
2078 ; GFX90A-NEXT: s_mov_b32 s8, s6
2079 ; GFX90A-NEXT: v_mov_b32_e32 v1, s4
2080 ; GFX90A-NEXT: buffer_load_dword v3, v1, s[8:11], 0 offen
2081 ; GFX90A-NEXT: s_and_b32 s4, s18, 3
2082 ; GFX90A-NEXT: s_lshl_b32 s6, s4, 3
2083 ; GFX90A-NEXT: s_lshl_b32 s4, 0xffff, s6
2084 ; GFX90A-NEXT: s_not_b32 s7, s4
2085 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
2086 ; GFX90A-NEXT: .LBB6_1: ; %atomicrmw.start
2087 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
2088 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2089 ; GFX90A-NEXT: v_lshrrev_b32_e32 v2, s6, v3
2090 ; GFX90A-NEXT: v_add_f16_e32 v2, v2, v0
2091 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, s6, v2
2092 ; GFX90A-NEXT: v_and_or_b32 v2, v3, s7, v2
2093 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[2:3], v[2:3] op_sel:[0,1]
2094 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[8:11], 0 offen glc
2095 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2096 ; GFX90A-NEXT: buffer_wbinvl1
2097 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
2098 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2099 ; GFX90A-NEXT: v_mov_b32_e32 v3, v4
2100 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
2101 ; GFX90A-NEXT: s_cbranch_execnz .LBB6_1
2102 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
2103 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
2104 ; GFX90A-NEXT: v_lshrrev_b32_e32 v0, s6, v4
2105 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
2107 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
2109 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2110 ; GFX908-NEXT: s_addk_i32 s18, 0x200
2111 ; GFX908-NEXT: s_and_b32 s4, s18, -4
2112 ; GFX908-NEXT: s_mov_b32 s11, s17
2113 ; GFX908-NEXT: s_mov_b32 s10, s16
2114 ; GFX908-NEXT: s_mov_b32 s9, s7
2115 ; GFX908-NEXT: s_mov_b32 s8, s6
2116 ; GFX908-NEXT: v_mov_b32_e32 v5, s4
2117 ; GFX908-NEXT: buffer_load_dword v2, v5, s[8:11], 0 offen
2118 ; GFX908-NEXT: s_and_b32 s4, s18, 3
2119 ; GFX908-NEXT: s_lshl_b32 s6, s4, 3
2120 ; GFX908-NEXT: s_lshl_b32 s4, 0xffff, s6
2121 ; GFX908-NEXT: s_not_b32 s7, s4
2122 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
2123 ; GFX908-NEXT: .LBB6_1: ; %atomicrmw.start
2124 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
2125 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2126 ; GFX908-NEXT: v_lshrrev_b32_e32 v1, s6, v2
2127 ; GFX908-NEXT: v_add_f16_e32 v1, v1, v0
2128 ; GFX908-NEXT: v_lshlrev_b32_e32 v1, s6, v1
2129 ; GFX908-NEXT: v_and_or_b32 v1, v2, s7, v1
2130 ; GFX908-NEXT: v_mov_b32_e32 v4, v2
2131 ; GFX908-NEXT: v_mov_b32_e32 v3, v1
2132 ; GFX908-NEXT: buffer_atomic_cmpswap v[3:4], v5, s[8:11], 0 offen glc
2133 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2134 ; GFX908-NEXT: buffer_wbinvl1
2135 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v3, v2
2136 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2137 ; GFX908-NEXT: v_mov_b32_e32 v2, v3
2138 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
2139 ; GFX908-NEXT: s_cbranch_execnz .LBB6_1
2140 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
2141 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
2142 ; GFX908-NEXT: v_lshrrev_b32_e32 v0, s6, v3
2143 ; GFX908-NEXT: s_setpc_b64 s[30:31]
2145 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
2147 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2148 ; GFX8-NEXT: s_addk_i32 s18, 0x200
2149 ; GFX8-NEXT: s_and_b32 s4, s18, -4
2150 ; GFX8-NEXT: s_mov_b32 s11, s17
2151 ; GFX8-NEXT: s_mov_b32 s10, s16
2152 ; GFX8-NEXT: s_mov_b32 s9, s7
2153 ; GFX8-NEXT: s_mov_b32 s8, s6
2154 ; GFX8-NEXT: v_mov_b32_e32 v5, s4
2155 ; GFX8-NEXT: buffer_load_dword v2, v5, s[8:11], 0 offen
2156 ; GFX8-NEXT: s_and_b32 s4, s18, 3
2157 ; GFX8-NEXT: s_lshl_b32 s6, s4, 3
2158 ; GFX8-NEXT: s_lshl_b32 s4, 0xffff, s6
2159 ; GFX8-NEXT: s_not_b32 s7, s4
2160 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
2161 ; GFX8-NEXT: .LBB6_1: ; %atomicrmw.start
2162 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
2163 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2164 ; GFX8-NEXT: v_lshrrev_b32_e32 v1, s6, v2
2165 ; GFX8-NEXT: v_add_f16_e32 v1, v1, v0
2166 ; GFX8-NEXT: v_and_b32_e32 v3, s7, v2
2167 ; GFX8-NEXT: v_lshlrev_b32_e32 v1, s6, v1
2168 ; GFX8-NEXT: v_or_b32_e32 v1, v3, v1
2169 ; GFX8-NEXT: v_mov_b32_e32 v4, v2
2170 ; GFX8-NEXT: v_mov_b32_e32 v3, v1
2171 ; GFX8-NEXT: buffer_atomic_cmpswap v[3:4], v5, s[8:11], 0 offen glc
2172 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2173 ; GFX8-NEXT: buffer_wbinvl1
2174 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v3, v2
2175 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2176 ; GFX8-NEXT: v_mov_b32_e32 v2, v3
2177 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
2178 ; GFX8-NEXT: s_cbranch_execnz .LBB6_1
2179 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
2180 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
2181 ; GFX8-NEXT: v_lshrrev_b32_e32 v0, s6, v3
2182 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2184 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
2186 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2187 ; GFX7-NEXT: s_addk_i32 s18, 0x200
2188 ; GFX7-NEXT: s_and_b32 s4, s18, -4
2189 ; GFX7-NEXT: s_mov_b32 s11, s17
2190 ; GFX7-NEXT: s_mov_b32 s10, s16
2191 ; GFX7-NEXT: s_mov_b32 s9, s7
2192 ; GFX7-NEXT: s_mov_b32 s8, s6
2193 ; GFX7-NEXT: v_mov_b32_e32 v4, s4
2194 ; GFX7-NEXT: buffer_load_dword v1, v4, s[8:11], 0 offen
2195 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
2196 ; GFX7-NEXT: s_and_b32 s4, s18, 3
2197 ; GFX7-NEXT: s_lshl_b32 s6, s4, 3
2198 ; GFX7-NEXT: s_lshl_b32 s4, 0xffff, s6
2199 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v0
2200 ; GFX7-NEXT: s_not_b32 s7, s4
2201 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
2202 ; GFX7-NEXT: .LBB6_1: ; %atomicrmw.start
2203 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
2204 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2205 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v1
2206 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0
2207 ; GFX7-NEXT: v_and_b32_e32 v2, s7, v1
2208 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v5
2209 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
2210 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, s6, v0
2211 ; GFX7-NEXT: v_or_b32_e32 v0, v2, v0
2212 ; GFX7-NEXT: v_mov_b32_e32 v3, v1
2213 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
2214 ; GFX7-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[8:11], 0 offen glc
2215 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2216 ; GFX7-NEXT: buffer_wbinvl1
2217 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
2218 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2219 ; GFX7-NEXT: v_mov_b32_e32 v1, v2
2220 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
2221 ; GFX7-NEXT: s_cbranch_execnz .LBB6_1
2222 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
2223 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
2224 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v2
2225 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0
2226 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2228 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset:
2230 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2231 ; GFX6-NEXT: s_addk_i32 s18, 0x200
2232 ; GFX6-NEXT: s_and_b32 s4, s18, -4
2233 ; GFX6-NEXT: s_mov_b32 s11, s17
2234 ; GFX6-NEXT: s_mov_b32 s10, s16
2235 ; GFX6-NEXT: s_mov_b32 s9, s7
2236 ; GFX6-NEXT: s_mov_b32 s8, s6
2237 ; GFX6-NEXT: v_mov_b32_e32 v4, s4
2238 ; GFX6-NEXT: buffer_load_dword v1, v4, s[8:11], 0 offen
2239 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
2240 ; GFX6-NEXT: s_and_b32 s4, s18, 3
2241 ; GFX6-NEXT: s_lshl_b32 s6, s4, 3
2242 ; GFX6-NEXT: s_lshl_b32 s4, 0xffff, s6
2243 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v0
2244 ; GFX6-NEXT: s_not_b32 s7, s4
2245 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
2246 ; GFX6-NEXT: .LBB6_1: ; %atomicrmw.start
2247 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
2248 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2249 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v1
2250 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
2251 ; GFX6-NEXT: s_waitcnt expcnt(0)
2252 ; GFX6-NEXT: v_and_b32_e32 v2, s7, v1
2253 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v5
2254 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
2255 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, s6, v0
2256 ; GFX6-NEXT: v_or_b32_e32 v0, v2, v0
2257 ; GFX6-NEXT: v_mov_b32_e32 v3, v1
2258 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
2259 ; GFX6-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[8:11], 0 offen glc
2260 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2261 ; GFX6-NEXT: buffer_wbinvl1
2262 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
2263 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2264 ; GFX6-NEXT: v_mov_b32_e32 v1, v2
2265 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
2266 ; GFX6-NEXT: s_cbranch_execnz .LBB6_1
2267 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
2268 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
2269 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v2
2270 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
2271 ; GFX6-NEXT: s_waitcnt expcnt(0)
2272 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2273 %gep = getelementptr half, ptr addrspace(7) %ptr, i32 256
2274 %result = atomicrmw fadd ptr addrspace(7) %gep, half %val syncscope("agent") seq_cst
2278 define void @buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset(ptr addrspace(7) inreg %ptr, half %val) #0 {
2279 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2281 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2282 ; GFX12-NEXT: s_wait_expcnt 0x0
2283 ; GFX12-NEXT: s_wait_samplecnt 0x0
2284 ; GFX12-NEXT: s_wait_bvhcnt 0x0
2285 ; GFX12-NEXT: s_wait_kmcnt 0x0
2286 ; GFX12-NEXT: s_addk_co_i32 s6, 0x200
2287 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2288 ; GFX12-NEXT: s_and_b32 s4, s6, -4
2289 ; GFX12-NEXT: v_mov_b32_e32 v3, s4
2290 ; GFX12-NEXT: s_and_b32 s4, s6, 3
2291 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2292 ; GFX12-NEXT: s_lshl_b32 s4, s4, 3
2293 ; GFX12-NEXT: s_lshl_b32 s5, 0xffff, s4
2294 ; GFX12-NEXT: buffer_load_b32 v2, v3, s[0:3], null offen
2295 ; GFX12-NEXT: s_not_b32 s6, s5
2296 ; GFX12-NEXT: s_mov_b32 s5, 0
2297 ; GFX12-NEXT: .LBB7_1: ; %atomicrmw.start
2298 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
2299 ; GFX12-NEXT: s_wait_loadcnt 0x0
2300 ; GFX12-NEXT: v_lshrrev_b32_e32 v1, s4, v2
2301 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
2302 ; GFX12-NEXT: s_wait_storecnt 0x0
2303 ; GFX12-NEXT: v_add_f16_e32 v1, v1, v0
2304 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2305 ; GFX12-NEXT: v_and_b32_e32 v1, 0xffff, v1
2306 ; GFX12-NEXT: v_lshlrev_b32_e32 v1, s4, v1
2307 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2308 ; GFX12-NEXT: v_and_or_b32 v1, v2, s6, v1
2309 ; GFX12-NEXT: v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v4, v1
2310 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v3, s[0:3], null offen th:TH_ATOMIC_RETURN
2311 ; GFX12-NEXT: s_wait_loadcnt 0x0
2312 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
2313 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
2314 ; GFX12-NEXT: v_mov_b32_e32 v2, v4
2315 ; GFX12-NEXT: s_or_b32 s5, vcc_lo, s5
2316 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2317 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
2318 ; GFX12-NEXT: s_cbranch_execnz .LBB7_1
2319 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
2320 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s5
2321 ; GFX12-NEXT: s_setpc_b64 s[30:31]
2323 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2325 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2326 ; GFX940-NEXT: s_addk_i32 s6, 0x200
2327 ; GFX940-NEXT: s_and_b32 s4, s6, -4
2328 ; GFX940-NEXT: v_mov_b32_e32 v1, s4
2329 ; GFX940-NEXT: buffer_load_dword v3, v1, s[0:3], 0 offen
2330 ; GFX940-NEXT: s_and_b32 s4, s6, 3
2331 ; GFX940-NEXT: s_lshl_b32 s6, s4, 3
2332 ; GFX940-NEXT: s_lshl_b32 s4, 0xffff, s6
2333 ; GFX940-NEXT: s_not_b32 s7, s4
2334 ; GFX940-NEXT: s_mov_b64 s[4:5], 0
2335 ; GFX940-NEXT: .LBB7_1: ; %atomicrmw.start
2336 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
2337 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2338 ; GFX940-NEXT: v_lshrrev_b32_e32 v2, s6, v3
2339 ; GFX940-NEXT: v_add_f16_e32 v2, v2, v0
2340 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, s6, v2
2341 ; GFX940-NEXT: v_and_or_b32 v2, v3, s7, v2
2342 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[2:3]
2343 ; GFX940-NEXT: buffer_wbl2 sc1
2344 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[0:3], 0 offen sc0
2345 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2346 ; GFX940-NEXT: buffer_inv sc1
2347 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
2348 ; GFX940-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2349 ; GFX940-NEXT: v_mov_b32_e32 v3, v4
2350 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[4:5]
2351 ; GFX940-NEXT: s_cbranch_execnz .LBB7_1
2352 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
2353 ; GFX940-NEXT: s_or_b64 exec, exec, s[4:5]
2354 ; GFX940-NEXT: s_setpc_b64 s[30:31]
2356 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2358 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2359 ; GFX11-NEXT: s_addk_i32 s6, 0x200
2360 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2361 ; GFX11-NEXT: s_and_b32 s4, s6, -4
2362 ; GFX11-NEXT: v_mov_b32_e32 v3, s4
2363 ; GFX11-NEXT: s_and_b32 s4, s6, 3
2364 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2365 ; GFX11-NEXT: s_lshl_b32 s4, s4, 3
2366 ; GFX11-NEXT: s_lshl_b32 s5, 0xffff, s4
2367 ; GFX11-NEXT: buffer_load_b32 v2, v3, s[0:3], 0 offen
2368 ; GFX11-NEXT: s_not_b32 s6, s5
2369 ; GFX11-NEXT: s_mov_b32 s5, 0
2370 ; GFX11-NEXT: .LBB7_1: ; %atomicrmw.start
2371 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
2372 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2373 ; GFX11-NEXT: v_lshrrev_b32_e32 v1, s4, v2
2374 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2375 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2376 ; GFX11-NEXT: v_add_f16_e32 v1, v1, v0
2377 ; GFX11-NEXT: v_and_b32_e32 v1, 0xffff, v1
2378 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2379 ; GFX11-NEXT: v_lshlrev_b32_e32 v1, s4, v1
2380 ; GFX11-NEXT: v_and_or_b32 v1, v2, s6, v1
2381 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
2382 ; GFX11-NEXT: v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v4, v1
2383 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v3, s[0:3], 0 offen glc
2384 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2385 ; GFX11-NEXT: buffer_gl1_inv
2386 ; GFX11-NEXT: buffer_gl0_inv
2387 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
2388 ; GFX11-NEXT: v_mov_b32_e32 v2, v4
2389 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
2390 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2391 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
2392 ; GFX11-NEXT: s_cbranch_execnz .LBB7_1
2393 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
2394 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
2395 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2397 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2399 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2400 ; GFX10-NEXT: s_addk_i32 s18, 0x200
2401 ; GFX10-NEXT: s_mov_b32 s11, s17
2402 ; GFX10-NEXT: s_and_b32 s4, s18, -4
2403 ; GFX10-NEXT: s_mov_b32 s10, s16
2404 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
2405 ; GFX10-NEXT: s_mov_b32 s9, s7
2406 ; GFX10-NEXT: s_mov_b32 s8, s6
2407 ; GFX10-NEXT: s_and_b32 s4, s18, 3
2408 ; GFX10-NEXT: s_lshl_b32 s4, s4, 3
2409 ; GFX10-NEXT: buffer_load_dword v2, v3, s[8:11], 0 offen
2410 ; GFX10-NEXT: s_lshl_b32 s5, 0xffff, s4
2411 ; GFX10-NEXT: s_not_b32 s6, s5
2412 ; GFX10-NEXT: s_mov_b32 s5, 0
2413 ; GFX10-NEXT: .LBB7_1: ; %atomicrmw.start
2414 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
2415 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2416 ; GFX10-NEXT: v_lshrrev_b32_e32 v1, s4, v2
2417 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2418 ; GFX10-NEXT: v_add_f16_e32 v1, v1, v0
2419 ; GFX10-NEXT: v_lshlrev_b32_sdwa v1, s4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
2420 ; GFX10-NEXT: v_and_or_b32 v1, v2, s6, v1
2421 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
2422 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
2423 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
2424 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2425 ; GFX10-NEXT: buffer_gl1_inv
2426 ; GFX10-NEXT: buffer_gl0_inv
2427 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
2428 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
2429 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
2430 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
2431 ; GFX10-NEXT: s_cbranch_execnz .LBB7_1
2432 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
2433 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
2434 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2436 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2438 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2439 ; GFX90A-NEXT: s_addk_i32 s18, 0x200
2440 ; GFX90A-NEXT: s_and_b32 s4, s18, -4
2441 ; GFX90A-NEXT: s_mov_b32 s11, s17
2442 ; GFX90A-NEXT: s_mov_b32 s10, s16
2443 ; GFX90A-NEXT: s_mov_b32 s9, s7
2444 ; GFX90A-NEXT: s_mov_b32 s8, s6
2445 ; GFX90A-NEXT: v_mov_b32_e32 v1, s4
2446 ; GFX90A-NEXT: buffer_load_dword v3, v1, s[8:11], 0 offen
2447 ; GFX90A-NEXT: s_and_b32 s4, s18, 3
2448 ; GFX90A-NEXT: s_lshl_b32 s6, s4, 3
2449 ; GFX90A-NEXT: s_lshl_b32 s4, 0xffff, s6
2450 ; GFX90A-NEXT: s_not_b32 s7, s4
2451 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
2452 ; GFX90A-NEXT: .LBB7_1: ; %atomicrmw.start
2453 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
2454 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2455 ; GFX90A-NEXT: v_lshrrev_b32_e32 v2, s6, v3
2456 ; GFX90A-NEXT: v_add_f16_e32 v2, v2, v0
2457 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, s6, v2
2458 ; GFX90A-NEXT: v_and_or_b32 v2, v3, s7, v2
2459 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[2:3], v[2:3] op_sel:[0,1]
2460 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[8:11], 0 offen glc
2461 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2462 ; GFX90A-NEXT: buffer_wbinvl1
2463 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
2464 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2465 ; GFX90A-NEXT: v_mov_b32_e32 v3, v4
2466 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
2467 ; GFX90A-NEXT: s_cbranch_execnz .LBB7_1
2468 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
2469 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
2470 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
2472 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2474 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2475 ; GFX908-NEXT: s_addk_i32 s18, 0x200
2476 ; GFX908-NEXT: s_and_b32 s4, s18, -4
2477 ; GFX908-NEXT: s_mov_b32 s11, s17
2478 ; GFX908-NEXT: s_mov_b32 s10, s16
2479 ; GFX908-NEXT: s_mov_b32 s9, s7
2480 ; GFX908-NEXT: s_mov_b32 s8, s6
2481 ; GFX908-NEXT: v_mov_b32_e32 v3, s4
2482 ; GFX908-NEXT: buffer_load_dword v2, v3, s[8:11], 0 offen
2483 ; GFX908-NEXT: s_and_b32 s4, s18, 3
2484 ; GFX908-NEXT: s_lshl_b32 s6, s4, 3
2485 ; GFX908-NEXT: s_lshl_b32 s4, 0xffff, s6
2486 ; GFX908-NEXT: s_not_b32 s7, s4
2487 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
2488 ; GFX908-NEXT: .LBB7_1: ; %atomicrmw.start
2489 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
2490 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2491 ; GFX908-NEXT: v_lshrrev_b32_e32 v1, s6, v2
2492 ; GFX908-NEXT: v_add_f16_e32 v1, v1, v0
2493 ; GFX908-NEXT: v_lshlrev_b32_e32 v1, s6, v1
2494 ; GFX908-NEXT: v_and_or_b32 v1, v2, s7, v1
2495 ; GFX908-NEXT: v_mov_b32_e32 v5, v2
2496 ; GFX908-NEXT: v_mov_b32_e32 v4, v1
2497 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
2498 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2499 ; GFX908-NEXT: buffer_wbinvl1
2500 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
2501 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2502 ; GFX908-NEXT: v_mov_b32_e32 v2, v4
2503 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
2504 ; GFX908-NEXT: s_cbranch_execnz .LBB7_1
2505 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
2506 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
2507 ; GFX908-NEXT: s_setpc_b64 s[30:31]
2509 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2511 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2512 ; GFX8-NEXT: s_addk_i32 s18, 0x200
2513 ; GFX8-NEXT: s_and_b32 s4, s18, -4
2514 ; GFX8-NEXT: s_mov_b32 s11, s17
2515 ; GFX8-NEXT: s_mov_b32 s10, s16
2516 ; GFX8-NEXT: s_mov_b32 s9, s7
2517 ; GFX8-NEXT: s_mov_b32 s8, s6
2518 ; GFX8-NEXT: v_mov_b32_e32 v3, s4
2519 ; GFX8-NEXT: buffer_load_dword v2, v3, s[8:11], 0 offen
2520 ; GFX8-NEXT: s_and_b32 s4, s18, 3
2521 ; GFX8-NEXT: s_lshl_b32 s6, s4, 3
2522 ; GFX8-NEXT: s_lshl_b32 s4, 0xffff, s6
2523 ; GFX8-NEXT: s_not_b32 s7, s4
2524 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
2525 ; GFX8-NEXT: .LBB7_1: ; %atomicrmw.start
2526 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
2527 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2528 ; GFX8-NEXT: v_lshrrev_b32_e32 v1, s6, v2
2529 ; GFX8-NEXT: v_add_f16_e32 v1, v1, v0
2530 ; GFX8-NEXT: v_and_b32_e32 v4, s7, v2
2531 ; GFX8-NEXT: v_lshlrev_b32_e32 v1, s6, v1
2532 ; GFX8-NEXT: v_or_b32_e32 v1, v4, v1
2533 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
2534 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
2535 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
2536 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2537 ; GFX8-NEXT: buffer_wbinvl1
2538 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
2539 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2540 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
2541 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
2542 ; GFX8-NEXT: s_cbranch_execnz .LBB7_1
2543 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
2544 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
2545 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2547 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2549 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2550 ; GFX7-NEXT: s_addk_i32 s18, 0x200
2551 ; GFX7-NEXT: s_and_b32 s4, s18, -4
2552 ; GFX7-NEXT: s_mov_b32 s11, s17
2553 ; GFX7-NEXT: s_mov_b32 s10, s16
2554 ; GFX7-NEXT: s_mov_b32 s9, s7
2555 ; GFX7-NEXT: s_mov_b32 s8, s6
2556 ; GFX7-NEXT: v_mov_b32_e32 v2, s4
2557 ; GFX7-NEXT: buffer_load_dword v1, v2, s[8:11], 0 offen
2558 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
2559 ; GFX7-NEXT: s_and_b32 s4, s18, 3
2560 ; GFX7-NEXT: s_lshl_b32 s6, s4, 3
2561 ; GFX7-NEXT: s_lshl_b32 s4, 0xffff, s6
2562 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v0
2563 ; GFX7-NEXT: s_not_b32 s7, s4
2564 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
2565 ; GFX7-NEXT: .LBB7_1: ; %atomicrmw.start
2566 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
2567 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2568 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v1
2569 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0
2570 ; GFX7-NEXT: v_and_b32_e32 v4, s7, v1
2571 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v3
2572 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
2573 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, s6, v0
2574 ; GFX7-NEXT: v_or_b32_e32 v0, v4, v0
2575 ; GFX7-NEXT: v_mov_b32_e32 v5, v1
2576 ; GFX7-NEXT: v_mov_b32_e32 v4, v0
2577 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[8:11], 0 offen glc
2578 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2579 ; GFX7-NEXT: buffer_wbinvl1
2580 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
2581 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2582 ; GFX7-NEXT: v_mov_b32_e32 v1, v4
2583 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
2584 ; GFX7-NEXT: s_cbranch_execnz .LBB7_1
2585 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
2586 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
2587 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2589 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset:
2591 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2592 ; GFX6-NEXT: s_addk_i32 s18, 0x200
2593 ; GFX6-NEXT: s_and_b32 s4, s18, -4
2594 ; GFX6-NEXT: s_mov_b32 s11, s17
2595 ; GFX6-NEXT: s_mov_b32 s10, s16
2596 ; GFX6-NEXT: s_mov_b32 s9, s7
2597 ; GFX6-NEXT: s_mov_b32 s8, s6
2598 ; GFX6-NEXT: v_mov_b32_e32 v2, s4
2599 ; GFX6-NEXT: buffer_load_dword v1, v2, s[8:11], 0 offen
2600 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
2601 ; GFX6-NEXT: s_and_b32 s4, s18, 3
2602 ; GFX6-NEXT: s_lshl_b32 s6, s4, 3
2603 ; GFX6-NEXT: s_lshl_b32 s4, 0xffff, s6
2604 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v0
2605 ; GFX6-NEXT: s_not_b32 s7, s4
2606 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
2607 ; GFX6-NEXT: .LBB7_1: ; %atomicrmw.start
2608 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
2609 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2610 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v1
2611 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
2612 ; GFX6-NEXT: s_waitcnt expcnt(0)
2613 ; GFX6-NEXT: v_and_b32_e32 v4, s7, v1
2614 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v3
2615 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
2616 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, s6, v0
2617 ; GFX6-NEXT: v_or_b32_e32 v0, v4, v0
2618 ; GFX6-NEXT: v_mov_b32_e32 v5, v1
2619 ; GFX6-NEXT: v_mov_b32_e32 v4, v0
2620 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[8:11], 0 offen glc
2621 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2622 ; GFX6-NEXT: buffer_wbinvl1
2623 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
2624 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2625 ; GFX6-NEXT: v_mov_b32_e32 v1, v4
2626 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
2627 ; GFX6-NEXT: s_cbranch_execnz .LBB7_1
2628 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
2629 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
2630 ; GFX6-NEXT: s_waitcnt expcnt(0)
2631 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2632 %gep = getelementptr half, ptr addrspace(7) %ptr, i32 256
2633 %unused = atomicrmw fadd ptr addrspace(7) %gep, half %val syncscope("agent") seq_cst
2637 define half @buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall(ptr addrspace(7) %ptr, half %val) #0 {
2638 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
2640 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2641 ; GFX12-NEXT: s_wait_expcnt 0x0
2642 ; GFX12-NEXT: s_wait_samplecnt 0x0
2643 ; GFX12-NEXT: s_wait_bvhcnt 0x0
2644 ; GFX12-NEXT: s_wait_kmcnt 0x0
2645 ; GFX12-NEXT: v_add_nc_u32_e32 v6, 0x200, v4
2646 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
2647 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
2648 ; GFX12-NEXT: v_and_b32_e32 v4, 3, v6
2649 ; GFX12-NEXT: v_and_b32_e32 v10, -4, v6
2650 ; GFX12-NEXT: v_lshlrev_b32_e32 v4, 3, v4
2651 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2652 ; GFX12-NEXT: v_lshlrev_b32_e64 v7, v4, 0xffff
2653 ; GFX12-NEXT: v_not_b32_e32 v11, v7
2654 ; GFX12-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
2655 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
2656 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
2657 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
2658 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
2659 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
2660 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
2661 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
2662 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2663 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
2664 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
2665 ; GFX12-NEXT: buffer_load_b32 v7, v10, s[4:7], null offen
2666 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
2667 ; GFX12-NEXT: s_cbranch_execnz .LBB8_1
2668 ; GFX12-NEXT: ; %bb.2:
2669 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
2670 ; GFX12-NEXT: s_mov_b32 s1, 0
2671 ; GFX12-NEXT: .LBB8_3: ; %atomicrmw.start
2672 ; GFX12-NEXT: ; =>This Loop Header: Depth=1
2673 ; GFX12-NEXT: ; Child Loop BB8_4 Depth 2
2674 ; GFX12-NEXT: s_wait_loadcnt 0x0
2675 ; GFX12-NEXT: v_lshrrev_b32_e32 v6, v4, v7
2676 ; GFX12-NEXT: s_mov_b32 s2, exec_lo
2677 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
2678 ; GFX12-NEXT: s_wait_storecnt 0x0
2679 ; GFX12-NEXT: v_add_f16_e32 v6, v6, v5
2680 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2681 ; GFX12-NEXT: v_and_b32_e32 v6, 0xffff, v6
2682 ; GFX12-NEXT: v_lshlrev_b32_e32 v6, v4, v6
2683 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2684 ; GFX12-NEXT: v_and_or_b32 v6, v7, v11, v6
2685 ; GFX12-NEXT: v_dual_mov_b32 v9, v7 :: v_dual_mov_b32 v8, v6
2686 ; GFX12-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
2687 ; GFX12-NEXT: ; => This Inner Loop Header: Depth=2
2688 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
2689 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
2690 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
2691 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
2692 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
2693 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
2694 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
2695 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2696 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
2697 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
2698 ; GFX12-NEXT: s_wait_loadcnt 0x0
2699 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[8:9], v10, s[4:7], null offen th:TH_ATOMIC_RETURN
2700 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
2701 ; GFX12-NEXT: s_cbranch_execnz .LBB8_4
2702 ; GFX12-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
2703 ; GFX12-NEXT: s_mov_b32 exec_lo, s2
2704 ; GFX12-NEXT: s_wait_loadcnt 0x0
2705 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v8, v7
2706 ; GFX12-NEXT: v_mov_b32_e32 v7, v8
2707 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
2708 ; GFX12-NEXT: s_or_b32 s1, vcc_lo, s1
2709 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2710 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
2711 ; GFX12-NEXT: s_cbranch_execnz .LBB8_3
2712 ; GFX12-NEXT: ; %bb.6: ; %atomicrmw.end
2713 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s1
2714 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, v4, v8
2715 ; GFX12-NEXT: s_setpc_b64 s[30:31]
2717 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
2719 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2720 ; GFX940-NEXT: v_add_u32_e32 v4, 0x200, v4
2721 ; GFX940-NEXT: v_and_b32_e32 v10, -4, v4
2722 ; GFX940-NEXT: v_and_b32_e32 v4, 3, v4
2723 ; GFX940-NEXT: v_lshlrev_b32_e32 v4, 3, v4
2724 ; GFX940-NEXT: s_mov_b32 s0, 0xffff
2725 ; GFX940-NEXT: v_lshlrev_b32_e64 v6, v4, s0
2726 ; GFX940-NEXT: v_not_b32_e32 v11, v6
2727 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
2728 ; GFX940-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
2729 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
2730 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
2731 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
2732 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
2733 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
2734 ; GFX940-NEXT: s_nop 0
2735 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
2736 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
2737 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
2738 ; GFX940-NEXT: buffer_load_dword v7, v10, s[4:7], 0 offen
2739 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
2740 ; GFX940-NEXT: s_cbranch_execnz .LBB8_1
2741 ; GFX940-NEXT: ; %bb.2:
2742 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
2743 ; GFX940-NEXT: s_mov_b64 s[2:3], 0
2744 ; GFX940-NEXT: .LBB8_3: ; %atomicrmw.start
2745 ; GFX940-NEXT: ; =>This Loop Header: Depth=1
2746 ; GFX940-NEXT: ; Child Loop BB8_4 Depth 2
2747 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2748 ; GFX940-NEXT: v_lshrrev_b32_e32 v6, v4, v7
2749 ; GFX940-NEXT: v_add_f16_e32 v6, v6, v5
2750 ; GFX940-NEXT: v_lshlrev_b32_e32 v6, v4, v6
2751 ; GFX940-NEXT: v_and_or_b32 v6, v7, v11, v6
2752 ; GFX940-NEXT: s_mov_b64 s[8:9], exec
2753 ; GFX940-NEXT: v_mov_b64_e32 v[8:9], v[6:7]
2754 ; GFX940-NEXT: buffer_wbl2 sc1
2755 ; GFX940-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
2756 ; GFX940-NEXT: ; => This Inner Loop Header: Depth=2
2757 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
2758 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
2759 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
2760 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
2761 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
2762 ; GFX940-NEXT: s_nop 0
2763 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
2764 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
2765 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
2766 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2767 ; GFX940-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[4:7], 0 offen sc0
2768 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
2769 ; GFX940-NEXT: s_cbranch_execnz .LBB8_4
2770 ; GFX940-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
2771 ; GFX940-NEXT: s_mov_b64 exec, s[8:9]
2772 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2773 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v8, v7
2774 ; GFX940-NEXT: s_or_b64 s[2:3], vcc, s[2:3]
2775 ; GFX940-NEXT: v_mov_b32_e32 v7, v8
2776 ; GFX940-NEXT: buffer_inv sc1
2777 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[2:3]
2778 ; GFX940-NEXT: s_cbranch_execnz .LBB8_3
2779 ; GFX940-NEXT: ; %bb.6: ; %atomicrmw.end
2780 ; GFX940-NEXT: s_or_b64 exec, exec, s[2:3]
2781 ; GFX940-NEXT: v_lshrrev_b32_e32 v0, v4, v8
2782 ; GFX940-NEXT: s_setpc_b64 s[30:31]
2784 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
2786 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2787 ; GFX11-NEXT: v_add_nc_u32_e32 v6, 0x200, v4
2788 ; GFX11-NEXT: s_mov_b32 s1, 0
2789 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
2790 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
2791 ; GFX11-NEXT: v_and_b32_e32 v4, 3, v6
2792 ; GFX11-NEXT: v_and_b32_e32 v10, -4, v6
2793 ; GFX11-NEXT: v_lshlrev_b32_e32 v4, 3, v4
2794 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2795 ; GFX11-NEXT: v_lshlrev_b32_e64 v7, v4, 0xffff
2796 ; GFX11-NEXT: v_not_b32_e32 v11, v7
2797 ; GFX11-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
2798 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
2799 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
2800 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
2801 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
2802 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
2803 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
2804 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
2805 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2806 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
2807 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
2808 ; GFX11-NEXT: buffer_load_b32 v7, v10, s[4:7], 0 offen
2809 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
2810 ; GFX11-NEXT: s_cbranch_execnz .LBB8_1
2811 ; GFX11-NEXT: ; %bb.2:
2812 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
2813 ; GFX11-NEXT: .p2align 6
2814 ; GFX11-NEXT: .LBB8_3: ; %atomicrmw.start
2815 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
2816 ; GFX11-NEXT: ; Child Loop BB8_4 Depth 2
2817 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2818 ; GFX11-NEXT: v_lshrrev_b32_e32 v6, v4, v7
2819 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
2820 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2821 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2822 ; GFX11-NEXT: v_add_f16_e32 v6, v6, v5
2823 ; GFX11-NEXT: v_and_b32_e32 v6, 0xffff, v6
2824 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2825 ; GFX11-NEXT: v_lshlrev_b32_e32 v6, v4, v6
2826 ; GFX11-NEXT: v_and_or_b32 v6, v7, v11, v6
2827 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
2828 ; GFX11-NEXT: v_dual_mov_b32 v9, v7 :: v_dual_mov_b32 v8, v6
2829 ; GFX11-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
2830 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
2831 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
2832 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
2833 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
2834 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
2835 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
2836 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
2837 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
2838 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2839 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
2840 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
2841 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2842 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[8:9], v10, s[4:7], 0 offen glc
2843 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
2844 ; GFX11-NEXT: s_cbranch_execnz .LBB8_4
2845 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
2846 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
2847 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2848 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v8, v7
2849 ; GFX11-NEXT: v_mov_b32_e32 v7, v8
2850 ; GFX11-NEXT: buffer_gl1_inv
2851 ; GFX11-NEXT: buffer_gl0_inv
2852 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
2853 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2854 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
2855 ; GFX11-NEXT: s_cbranch_execnz .LBB8_3
2856 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
2857 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
2858 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, v4, v8
2859 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2861 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
2863 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2864 ; GFX10-NEXT: v_add_nc_u32_e32 v6, 0x200, v4
2865 ; GFX10-NEXT: s_mov_b32 s5, 0
2866 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
2867 ; GFX10-NEXT: v_and_b32_e32 v4, 3, v6
2868 ; GFX10-NEXT: v_and_b32_e32 v10, -4, v6
2869 ; GFX10-NEXT: v_lshlrev_b32_e32 v4, 3, v4
2870 ; GFX10-NEXT: v_lshlrev_b32_e64 v7, v4, 0xffff
2871 ; GFX10-NEXT: v_not_b32_e32 v11, v7
2872 ; GFX10-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
2873 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
2874 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
2875 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
2876 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
2877 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
2878 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
2879 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
2880 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
2881 ; GFX10-NEXT: buffer_load_dword v7, v10, s[8:11], 0 offen
2882 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
2883 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
2884 ; GFX10-NEXT: s_cbranch_execnz .LBB8_1
2885 ; GFX10-NEXT: ; %bb.2:
2886 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
2887 ; GFX10-NEXT: .LBB8_3: ; %atomicrmw.start
2888 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
2889 ; GFX10-NEXT: ; Child Loop BB8_4 Depth 2
2890 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2891 ; GFX10-NEXT: v_lshrrev_b32_e32 v6, v4, v7
2892 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
2893 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2894 ; GFX10-NEXT: v_add_f16_e32 v6, v6, v5
2895 ; GFX10-NEXT: v_lshlrev_b32_sdwa v6, v4, v6 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
2896 ; GFX10-NEXT: v_and_or_b32 v6, v7, v11, v6
2897 ; GFX10-NEXT: v_mov_b32_e32 v9, v7
2898 ; GFX10-NEXT: v_mov_b32_e32 v8, v6
2899 ; GFX10-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
2900 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
2901 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
2902 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
2903 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
2904 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
2905 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
2906 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
2907 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
2908 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
2909 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2910 ; GFX10-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[8:11], 0 offen glc
2911 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
2912 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
2913 ; GFX10-NEXT: s_cbranch_execnz .LBB8_4
2914 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
2915 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
2916 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2917 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v8, v7
2918 ; GFX10-NEXT: v_mov_b32_e32 v7, v8
2919 ; GFX10-NEXT: buffer_gl1_inv
2920 ; GFX10-NEXT: buffer_gl0_inv
2921 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
2922 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
2923 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
2924 ; GFX10-NEXT: s_cbranch_execnz .LBB8_3
2925 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
2926 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
2927 ; GFX10-NEXT: v_lshrrev_b32_e32 v0, v4, v8
2928 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2930 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
2932 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2933 ; GFX90A-NEXT: v_add_u32_e32 v4, 0x200, v4
2934 ; GFX90A-NEXT: v_and_b32_e32 v10, -4, v4
2935 ; GFX90A-NEXT: v_and_b32_e32 v4, 3, v4
2936 ; GFX90A-NEXT: v_lshlrev_b32_e32 v4, 3, v4
2937 ; GFX90A-NEXT: s_mov_b32 s4, 0xffff
2938 ; GFX90A-NEXT: v_lshlrev_b32_e64 v6, v4, s4
2939 ; GFX90A-NEXT: v_not_b32_e32 v11, v6
2940 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
2941 ; GFX90A-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
2942 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
2943 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
2944 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
2945 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
2946 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
2947 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
2948 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2949 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2950 ; GFX90A-NEXT: s_nop 0
2951 ; GFX90A-NEXT: buffer_load_dword v7, v10, s[8:11], 0 offen
2952 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
2953 ; GFX90A-NEXT: s_cbranch_execnz .LBB8_1
2954 ; GFX90A-NEXT: ; %bb.2:
2955 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
2956 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
2957 ; GFX90A-NEXT: .LBB8_3: ; %atomicrmw.start
2958 ; GFX90A-NEXT: ; =>This Loop Header: Depth=1
2959 ; GFX90A-NEXT: ; Child Loop BB8_4 Depth 2
2960 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2961 ; GFX90A-NEXT: v_lshrrev_b32_e32 v6, v4, v7
2962 ; GFX90A-NEXT: v_add_f16_e32 v6, v6, v5
2963 ; GFX90A-NEXT: v_lshlrev_b32_e32 v6, v4, v6
2964 ; GFX90A-NEXT: v_and_or_b32 v6, v7, v11, v6
2965 ; GFX90A-NEXT: s_mov_b64 s[12:13], exec
2966 ; GFX90A-NEXT: v_pk_mov_b32 v[8:9], v[6:7], v[6:7] op_sel:[0,1]
2967 ; GFX90A-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
2968 ; GFX90A-NEXT: ; => This Inner Loop Header: Depth=2
2969 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
2970 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
2971 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
2972 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
2973 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
2974 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
2975 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2976 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2977 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2978 ; GFX90A-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[8:11], 0 offen glc
2979 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
2980 ; GFX90A-NEXT: s_cbranch_execnz .LBB8_4
2981 ; GFX90A-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
2982 ; GFX90A-NEXT: s_mov_b64 exec, s[12:13]
2983 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2984 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v8, v7
2985 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
2986 ; GFX90A-NEXT: v_mov_b32_e32 v7, v8
2987 ; GFX90A-NEXT: buffer_wbinvl1
2988 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
2989 ; GFX90A-NEXT: s_cbranch_execnz .LBB8_3
2990 ; GFX90A-NEXT: ; %bb.6: ; %atomicrmw.end
2991 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
2992 ; GFX90A-NEXT: v_lshrrev_b32_e32 v0, v4, v8
2993 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
2995 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
2997 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2998 ; GFX908-NEXT: v_add_u32_e32 v4, 0x200, v4
2999 ; GFX908-NEXT: v_and_b32_e32 v10, -4, v4
3000 ; GFX908-NEXT: v_and_b32_e32 v4, 3, v4
3001 ; GFX908-NEXT: v_lshlrev_b32_e32 v4, 3, v4
3002 ; GFX908-NEXT: s_mov_b32 s4, 0xffff
3003 ; GFX908-NEXT: v_lshlrev_b32_e64 v6, v4, s4
3004 ; GFX908-NEXT: v_not_b32_e32 v11, v6
3005 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
3006 ; GFX908-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
3007 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
3008 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
3009 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
3010 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
3011 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
3012 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
3013 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
3014 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
3015 ; GFX908-NEXT: s_nop 0
3016 ; GFX908-NEXT: buffer_load_dword v7, v10, s[8:11], 0 offen
3017 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
3018 ; GFX908-NEXT: s_cbranch_execnz .LBB8_1
3019 ; GFX908-NEXT: ; %bb.2:
3020 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
3021 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
3022 ; GFX908-NEXT: .LBB8_3: ; %atomicrmw.start
3023 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
3024 ; GFX908-NEXT: ; Child Loop BB8_4 Depth 2
3025 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3026 ; GFX908-NEXT: v_lshrrev_b32_e32 v6, v4, v7
3027 ; GFX908-NEXT: v_add_f16_e32 v6, v6, v5
3028 ; GFX908-NEXT: v_lshlrev_b32_e32 v6, v4, v6
3029 ; GFX908-NEXT: v_and_or_b32 v6, v7, v11, v6
3030 ; GFX908-NEXT: v_mov_b32_e32 v9, v7
3031 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
3032 ; GFX908-NEXT: v_mov_b32_e32 v8, v6
3033 ; GFX908-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
3034 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
3035 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
3036 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
3037 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
3038 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
3039 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
3040 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
3041 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
3042 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
3043 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3044 ; GFX908-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[8:11], 0 offen glc
3045 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
3046 ; GFX908-NEXT: s_cbranch_execnz .LBB8_4
3047 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
3048 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
3049 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3050 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v8, v7
3051 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
3052 ; GFX908-NEXT: v_mov_b32_e32 v7, v8
3053 ; GFX908-NEXT: buffer_wbinvl1
3054 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
3055 ; GFX908-NEXT: s_cbranch_execnz .LBB8_3
3056 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
3057 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
3058 ; GFX908-NEXT: v_lshrrev_b32_e32 v0, v4, v8
3059 ; GFX908-NEXT: s_setpc_b64 s[30:31]
3061 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
3063 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3064 ; GFX8-NEXT: v_add_u32_e32 v4, vcc, 0x200, v4
3065 ; GFX8-NEXT: v_and_b32_e32 v10, -4, v4
3066 ; GFX8-NEXT: v_and_b32_e32 v4, 3, v4
3067 ; GFX8-NEXT: v_lshlrev_b32_e32 v4, 3, v4
3068 ; GFX8-NEXT: s_mov_b32 s4, 0xffff
3069 ; GFX8-NEXT: v_lshlrev_b32_e64 v6, v4, s4
3070 ; GFX8-NEXT: v_not_b32_e32 v11, v6
3071 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
3072 ; GFX8-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
3073 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
3074 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
3075 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
3076 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
3077 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
3078 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
3079 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
3080 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
3081 ; GFX8-NEXT: s_nop 0
3082 ; GFX8-NEXT: buffer_load_dword v7, v10, s[8:11], 0 offen
3083 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
3084 ; GFX8-NEXT: s_cbranch_execnz .LBB8_1
3085 ; GFX8-NEXT: ; %bb.2:
3086 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
3087 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
3088 ; GFX8-NEXT: .LBB8_3: ; %atomicrmw.start
3089 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
3090 ; GFX8-NEXT: ; Child Loop BB8_4 Depth 2
3091 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3092 ; GFX8-NEXT: v_lshrrev_b32_e32 v6, v4, v7
3093 ; GFX8-NEXT: v_add_f16_e32 v6, v6, v5
3094 ; GFX8-NEXT: v_lshlrev_b32_e32 v6, v4, v6
3095 ; GFX8-NEXT: v_and_b32_e32 v8, v7, v11
3096 ; GFX8-NEXT: v_or_b32_e32 v6, v8, v6
3097 ; GFX8-NEXT: v_mov_b32_e32 v9, v7
3098 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
3099 ; GFX8-NEXT: v_mov_b32_e32 v8, v6
3100 ; GFX8-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
3101 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
3102 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
3103 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
3104 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
3105 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
3106 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
3107 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
3108 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
3109 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
3110 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3111 ; GFX8-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[8:11], 0 offen glc
3112 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
3113 ; GFX8-NEXT: s_cbranch_execnz .LBB8_4
3114 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
3115 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
3116 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3117 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v8, v7
3118 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
3119 ; GFX8-NEXT: v_mov_b32_e32 v7, v8
3120 ; GFX8-NEXT: buffer_wbinvl1
3121 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
3122 ; GFX8-NEXT: s_cbranch_execnz .LBB8_3
3123 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
3124 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
3125 ; GFX8-NEXT: v_lshrrev_b32_e32 v0, v4, v8
3126 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3128 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
3130 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3131 ; GFX7-NEXT: v_add_i32_e32 v4, vcc, 0x200, v4
3132 ; GFX7-NEXT: v_and_b32_e32 v8, -4, v4
3133 ; GFX7-NEXT: v_and_b32_e32 v4, 3, v4
3134 ; GFX7-NEXT: v_lshlrev_b32_e32 v7, 3, v4
3135 ; GFX7-NEXT: v_lshl_b32_e32 v4, 0xffff, v7
3136 ; GFX7-NEXT: v_not_b32_e32 v9, v4
3137 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
3138 ; GFX7-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
3139 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
3140 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
3141 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
3142 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
3143 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
3144 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
3145 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
3146 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
3147 ; GFX7-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
3148 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
3149 ; GFX7-NEXT: s_cbranch_execnz .LBB8_1
3150 ; GFX7-NEXT: ; %bb.2:
3151 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
3152 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v5
3153 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
3154 ; GFX7-NEXT: v_cvt_f32_f16_e32 v10, v4
3155 ; GFX7-NEXT: .LBB8_3: ; %atomicrmw.start
3156 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
3157 ; GFX7-NEXT: ; Child Loop BB8_4 Depth 2
3158 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3159 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, v7, v6
3160 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v4
3161 ; GFX7-NEXT: v_and_b32_e32 v5, v6, v9
3162 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
3163 ; GFX7-NEXT: v_add_f32_e32 v4, v4, v10
3164 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v4
3165 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, v7, v4
3166 ; GFX7-NEXT: v_or_b32_e32 v5, v5, v4
3167 ; GFX7-NEXT: v_mov_b32_e32 v4, v5
3168 ; GFX7-NEXT: v_mov_b32_e32 v5, v6
3169 ; GFX7-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
3170 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
3171 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
3172 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
3173 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
3174 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
3175 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
3176 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
3177 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
3178 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
3179 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3180 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
3181 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
3182 ; GFX7-NEXT: s_cbranch_execnz .LBB8_4
3183 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
3184 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
3185 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3186 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
3187 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
3188 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
3189 ; GFX7-NEXT: buffer_wbinvl1
3190 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
3191 ; GFX7-NEXT: s_cbranch_execnz .LBB8_3
3192 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
3193 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
3194 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, v7, v4
3195 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0
3196 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3198 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall:
3200 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3201 ; GFX6-NEXT: v_add_i32_e32 v4, vcc, 0x200, v4
3202 ; GFX6-NEXT: v_and_b32_e32 v8, -4, v4
3203 ; GFX6-NEXT: v_and_b32_e32 v4, 3, v4
3204 ; GFX6-NEXT: v_lshlrev_b32_e32 v7, 3, v4
3205 ; GFX6-NEXT: v_lshl_b32_e32 v4, 0xffff, v7
3206 ; GFX6-NEXT: v_not_b32_e32 v9, v4
3207 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
3208 ; GFX6-NEXT: .LBB8_1: ; =>This Inner Loop Header: Depth=1
3209 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
3210 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
3211 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
3212 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
3213 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
3214 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
3215 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
3216 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
3217 ; GFX6-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
3218 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
3219 ; GFX6-NEXT: s_cbranch_execnz .LBB8_1
3220 ; GFX6-NEXT: ; %bb.2:
3221 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
3222 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v5
3223 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
3224 ; GFX6-NEXT: v_cvt_f32_f16_e32 v10, v4
3225 ; GFX6-NEXT: .LBB8_3: ; %atomicrmw.start
3226 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
3227 ; GFX6-NEXT: ; Child Loop BB8_4 Depth 2
3228 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
3229 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, v7, v6
3230 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v4
3231 ; GFX6-NEXT: v_and_b32_e32 v5, v6, v9
3232 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
3233 ; GFX6-NEXT: v_add_f32_e32 v4, v4, v10
3234 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v4
3235 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, v7, v4
3236 ; GFX6-NEXT: v_or_b32_e32 v5, v5, v4
3237 ; GFX6-NEXT: v_mov_b32_e32 v4, v5
3238 ; GFX6-NEXT: v_mov_b32_e32 v5, v6
3239 ; GFX6-NEXT: .LBB8_4: ; Parent Loop BB8_3 Depth=1
3240 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
3241 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
3242 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
3243 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
3244 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
3245 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
3246 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
3247 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
3248 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
3249 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
3250 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
3251 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
3252 ; GFX6-NEXT: s_cbranch_execnz .LBB8_4
3253 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB8_3 Depth=1
3254 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
3255 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3256 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
3257 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
3258 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
3259 ; GFX6-NEXT: buffer_wbinvl1
3260 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
3261 ; GFX6-NEXT: s_cbranch_execnz .LBB8_3
3262 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
3263 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
3264 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, v7, v4
3265 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
3266 ; GFX6-NEXT: s_waitcnt expcnt(0)
3267 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3268 %gep = getelementptr half, ptr addrspace(7) %ptr, i32 256
3269 %result = atomicrmw fadd ptr addrspace(7) %gep, half %val syncscope("agent") seq_cst
3273 ; --------------------------------------------------------------------
3275 ; --------------------------------------------------------------------
3277 define bfloat @buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset(ptr addrspace(7) inreg %ptr, bfloat %val) #0 {
3278 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3280 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
3281 ; GFX12-NEXT: s_wait_expcnt 0x0
3282 ; GFX12-NEXT: s_wait_samplecnt 0x0
3283 ; GFX12-NEXT: s_wait_bvhcnt 0x0
3284 ; GFX12-NEXT: s_wait_kmcnt 0x0
3285 ; GFX12-NEXT: s_addk_co_i32 s6, 0x200
3286 ; GFX12-NEXT: v_lshlrev_b32_e32 v5, 16, v0
3287 ; GFX12-NEXT: s_and_b32 s4, s6, -4
3288 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
3289 ; GFX12-NEXT: v_mov_b32_e32 v4, s4
3290 ; GFX12-NEXT: s_and_b32 s4, s6, 3
3291 ; GFX12-NEXT: s_lshl_b32 s4, s4, 3
3292 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3293 ; GFX12-NEXT: s_lshl_b32 s5, 0xffff, s4
3294 ; GFX12-NEXT: buffer_load_b32 v1, v4, s[0:3], null offen
3295 ; GFX12-NEXT: s_not_b32 s6, s5
3296 ; GFX12-NEXT: s_mov_b32 s5, 0
3297 ; GFX12-NEXT: .LBB9_1: ; %atomicrmw.start
3298 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
3299 ; GFX12-NEXT: s_wait_loadcnt 0x0
3300 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, s4, v1
3301 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
3302 ; GFX12-NEXT: s_wait_storecnt 0x0
3303 ; GFX12-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3304 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3305 ; GFX12-NEXT: v_add_f32_e32 v0, v0, v5
3306 ; GFX12-NEXT: v_bfe_u32 v2, v0, 16, 1
3307 ; GFX12-NEXT: v_or_b32_e32 v3, 0x400000, v0
3308 ; GFX12-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3309 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3310 ; GFX12-NEXT: v_add3_u32 v2, v2, v0, 0x7fff
3311 ; GFX12-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc_lo
3312 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3313 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3314 ; GFX12-NEXT: v_lshlrev_b32_e32 v0, s4, v0
3315 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3316 ; GFX12-NEXT: v_and_or_b32 v0, v1, s6, v0
3317 ; GFX12-NEXT: v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
3318 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[2:3], v4, s[0:3], null offen th:TH_ATOMIC_RETURN
3319 ; GFX12-NEXT: s_wait_loadcnt 0x0
3320 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
3321 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v1
3322 ; GFX12-NEXT: v_mov_b32_e32 v1, v2
3323 ; GFX12-NEXT: s_or_b32 s5, vcc_lo, s5
3324 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3325 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
3326 ; GFX12-NEXT: s_cbranch_execnz .LBB9_1
3327 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
3328 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s5
3329 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, s4, v2
3330 ; GFX12-NEXT: s_setpc_b64 s[30:31]
3332 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3334 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3335 ; GFX940-NEXT: s_addk_i32 s6, 0x200
3336 ; GFX940-NEXT: s_and_b32 s4, s6, -4
3337 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
3338 ; GFX940-NEXT: buffer_load_dword v1, v4, s[0:3], 0 offen
3339 ; GFX940-NEXT: s_and_b32 s4, s6, 3
3340 ; GFX940-NEXT: s_lshl_b32 s6, s4, 3
3341 ; GFX940-NEXT: s_lshl_b32 s4, 0xffff, s6
3342 ; GFX940-NEXT: s_not_b32 s7, s4
3343 ; GFX940-NEXT: s_mov_b64 s[4:5], 0
3344 ; GFX940-NEXT: v_lshlrev_b32_e32 v5, 16, v0
3345 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
3346 ; GFX940-NEXT: .LBB9_1: ; %atomicrmw.start
3347 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
3348 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3349 ; GFX940-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3350 ; GFX940-NEXT: buffer_wbl2 sc1
3351 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v5
3352 ; GFX940-NEXT: v_bfe_u32 v2, v0, 16, 1
3353 ; GFX940-NEXT: v_or_b32_e32 v3, 0x400000, v0
3354 ; GFX940-NEXT: v_add3_u32 v2, v2, v0, s8
3355 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3356 ; GFX940-NEXT: s_nop 1
3357 ; GFX940-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc
3358 ; GFX940-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3359 ; GFX940-NEXT: v_and_or_b32 v0, v1, s7, v0
3360 ; GFX940-NEXT: v_mov_b64_e32 v[2:3], v[0:1]
3361 ; GFX940-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[0:3], 0 offen sc0
3362 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3363 ; GFX940-NEXT: buffer_inv sc1
3364 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
3365 ; GFX940-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3366 ; GFX940-NEXT: v_mov_b32_e32 v1, v2
3367 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[4:5]
3368 ; GFX940-NEXT: s_cbranch_execnz .LBB9_1
3369 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
3370 ; GFX940-NEXT: s_or_b64 exec, exec, s[4:5]
3371 ; GFX940-NEXT: v_lshrrev_b32_e32 v0, s6, v2
3372 ; GFX940-NEXT: s_setpc_b64 s[30:31]
3374 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3376 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3377 ; GFX11-NEXT: s_addk_i32 s6, 0x200
3378 ; GFX11-NEXT: v_lshlrev_b32_e32 v5, 16, v0
3379 ; GFX11-NEXT: s_and_b32 s4, s6, -4
3380 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
3381 ; GFX11-NEXT: v_mov_b32_e32 v4, s4
3382 ; GFX11-NEXT: s_and_b32 s4, s6, 3
3383 ; GFX11-NEXT: s_lshl_b32 s4, s4, 3
3384 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3385 ; GFX11-NEXT: s_lshl_b32 s5, 0xffff, s4
3386 ; GFX11-NEXT: buffer_load_b32 v1, v4, s[0:3], 0 offen
3387 ; GFX11-NEXT: s_not_b32 s6, s5
3388 ; GFX11-NEXT: s_mov_b32 s5, 0
3389 ; GFX11-NEXT: .p2align 6
3390 ; GFX11-NEXT: .LBB9_1: ; %atomicrmw.start
3391 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
3392 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3393 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, s4, v1
3394 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
3395 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3396 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3397 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v5
3398 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
3399 ; GFX11-NEXT: v_bfe_u32 v2, v0, 16, 1
3400 ; GFX11-NEXT: v_or_b32_e32 v3, 0x400000, v0
3401 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3402 ; GFX11-NEXT: v_add3_u32 v2, v2, v0, 0x7fff
3403 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3404 ; GFX11-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc_lo
3405 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3406 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3407 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, s4, v0
3408 ; GFX11-NEXT: v_and_or_b32 v0, v1, s6, v0
3409 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
3410 ; GFX11-NEXT: v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
3411 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[2:3], v4, s[0:3], 0 offen glc
3412 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3413 ; GFX11-NEXT: buffer_gl1_inv
3414 ; GFX11-NEXT: buffer_gl0_inv
3415 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v1
3416 ; GFX11-NEXT: v_mov_b32_e32 v1, v2
3417 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
3418 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3419 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
3420 ; GFX11-NEXT: s_cbranch_execnz .LBB9_1
3421 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
3422 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
3423 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, s4, v2
3424 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3426 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3428 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3429 ; GFX10-NEXT: s_addk_i32 s18, 0x200
3430 ; GFX10-NEXT: s_mov_b32 s11, s17
3431 ; GFX10-NEXT: s_and_b32 s4, s18, -4
3432 ; GFX10-NEXT: s_mov_b32 s10, s16
3433 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3434 ; GFX10-NEXT: s_mov_b32 s9, s7
3435 ; GFX10-NEXT: s_mov_b32 s8, s6
3436 ; GFX10-NEXT: s_and_b32 s4, s18, 3
3437 ; GFX10-NEXT: v_lshlrev_b32_e32 v5, 16, v0
3438 ; GFX10-NEXT: buffer_load_dword v1, v4, s[8:11], 0 offen
3439 ; GFX10-NEXT: s_lshl_b32 s4, s4, 3
3440 ; GFX10-NEXT: s_lshl_b32 s5, 0xffff, s4
3441 ; GFX10-NEXT: s_not_b32 s6, s5
3442 ; GFX10-NEXT: s_mov_b32 s5, 0
3443 ; GFX10-NEXT: .LBB9_1: ; %atomicrmw.start
3444 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
3445 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3446 ; GFX10-NEXT: v_lshrrev_b32_sdwa v0, s4, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3447 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
3448 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v5
3449 ; GFX10-NEXT: v_bfe_u32 v2, v0, 16, 1
3450 ; GFX10-NEXT: v_or_b32_e32 v3, 0x400000, v0
3451 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3452 ; GFX10-NEXT: v_add3_u32 v2, v2, v0, 0x7fff
3453 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc_lo
3454 ; GFX10-NEXT: v_lshlrev_b32_sdwa v0, s4, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3455 ; GFX10-NEXT: v_and_or_b32 v0, v1, s6, v0
3456 ; GFX10-NEXT: v_mov_b32_e32 v3, v1
3457 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
3458 ; GFX10-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[8:11], 0 offen glc
3459 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3460 ; GFX10-NEXT: buffer_gl1_inv
3461 ; GFX10-NEXT: buffer_gl0_inv
3462 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v1
3463 ; GFX10-NEXT: v_mov_b32_e32 v1, v2
3464 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
3465 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
3466 ; GFX10-NEXT: s_cbranch_execnz .LBB9_1
3467 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
3468 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
3469 ; GFX10-NEXT: v_lshrrev_b32_e32 v0, s4, v2
3470 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3472 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3474 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3475 ; GFX90A-NEXT: s_addk_i32 s18, 0x200
3476 ; GFX90A-NEXT: s_and_b32 s4, s18, -4
3477 ; GFX90A-NEXT: s_mov_b32 s11, s17
3478 ; GFX90A-NEXT: s_mov_b32 s10, s16
3479 ; GFX90A-NEXT: s_mov_b32 s9, s7
3480 ; GFX90A-NEXT: s_mov_b32 s8, s6
3481 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
3482 ; GFX90A-NEXT: buffer_load_dword v1, v4, s[8:11], 0 offen
3483 ; GFX90A-NEXT: s_and_b32 s4, s18, 3
3484 ; GFX90A-NEXT: s_lshl_b32 s6, s4, 3
3485 ; GFX90A-NEXT: s_lshl_b32 s4, 0xffff, s6
3486 ; GFX90A-NEXT: s_not_b32 s7, s4
3487 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
3488 ; GFX90A-NEXT: v_lshlrev_b32_e32 v5, 16, v0
3489 ; GFX90A-NEXT: s_movk_i32 s12, 0x7fff
3490 ; GFX90A-NEXT: .LBB9_1: ; %atomicrmw.start
3491 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
3492 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3493 ; GFX90A-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3494 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v5
3495 ; GFX90A-NEXT: v_bfe_u32 v2, v0, 16, 1
3496 ; GFX90A-NEXT: v_or_b32_e32 v3, 0x400000, v0
3497 ; GFX90A-NEXT: v_add3_u32 v2, v2, v0, s12
3498 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3499 ; GFX90A-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc
3500 ; GFX90A-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3501 ; GFX90A-NEXT: v_and_or_b32 v0, v1, s7, v0
3502 ; GFX90A-NEXT: v_pk_mov_b32 v[2:3], v[0:1], v[0:1] op_sel:[0,1]
3503 ; GFX90A-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[8:11], 0 offen glc
3504 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3505 ; GFX90A-NEXT: buffer_wbinvl1
3506 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
3507 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3508 ; GFX90A-NEXT: v_mov_b32_e32 v1, v2
3509 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
3510 ; GFX90A-NEXT: s_cbranch_execnz .LBB9_1
3511 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
3512 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
3513 ; GFX90A-NEXT: v_lshrrev_b32_e32 v0, s6, v2
3514 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
3516 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3518 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3519 ; GFX908-NEXT: s_addk_i32 s18, 0x200
3520 ; GFX908-NEXT: s_and_b32 s4, s18, -4
3521 ; GFX908-NEXT: s_mov_b32 s11, s17
3522 ; GFX908-NEXT: s_mov_b32 s10, s16
3523 ; GFX908-NEXT: s_mov_b32 s9, s7
3524 ; GFX908-NEXT: s_mov_b32 s8, s6
3525 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
3526 ; GFX908-NEXT: buffer_load_dword v1, v4, s[8:11], 0 offen
3527 ; GFX908-NEXT: s_and_b32 s4, s18, 3
3528 ; GFX908-NEXT: s_lshl_b32 s6, s4, 3
3529 ; GFX908-NEXT: s_lshl_b32 s4, 0xffff, s6
3530 ; GFX908-NEXT: s_not_b32 s7, s4
3531 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
3532 ; GFX908-NEXT: v_lshlrev_b32_e32 v5, 16, v0
3533 ; GFX908-NEXT: s_movk_i32 s12, 0x7fff
3534 ; GFX908-NEXT: .LBB9_1: ; %atomicrmw.start
3535 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
3536 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3537 ; GFX908-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3538 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v5
3539 ; GFX908-NEXT: v_bfe_u32 v2, v0, 16, 1
3540 ; GFX908-NEXT: v_or_b32_e32 v3, 0x400000, v0
3541 ; GFX908-NEXT: v_add3_u32 v2, v2, v0, s12
3542 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3543 ; GFX908-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc
3544 ; GFX908-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3545 ; GFX908-NEXT: v_and_or_b32 v0, v1, s7, v0
3546 ; GFX908-NEXT: v_mov_b32_e32 v3, v1
3547 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
3548 ; GFX908-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[8:11], 0 offen glc
3549 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3550 ; GFX908-NEXT: buffer_wbinvl1
3551 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
3552 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3553 ; GFX908-NEXT: v_mov_b32_e32 v1, v2
3554 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
3555 ; GFX908-NEXT: s_cbranch_execnz .LBB9_1
3556 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
3557 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
3558 ; GFX908-NEXT: v_lshrrev_b32_e32 v0, s6, v2
3559 ; GFX908-NEXT: s_setpc_b64 s[30:31]
3561 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3563 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3564 ; GFX8-NEXT: s_addk_i32 s18, 0x200
3565 ; GFX8-NEXT: s_and_b32 s4, s18, -4
3566 ; GFX8-NEXT: s_mov_b32 s11, s17
3567 ; GFX8-NEXT: s_mov_b32 s10, s16
3568 ; GFX8-NEXT: s_mov_b32 s9, s7
3569 ; GFX8-NEXT: s_mov_b32 s8, s6
3570 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
3571 ; GFX8-NEXT: buffer_load_dword v1, v4, s[8:11], 0 offen
3572 ; GFX8-NEXT: s_and_b32 s4, s18, 3
3573 ; GFX8-NEXT: s_lshl_b32 s6, s4, 3
3574 ; GFX8-NEXT: s_lshl_b32 s4, 0xffff, s6
3575 ; GFX8-NEXT: s_not_b32 s7, s4
3576 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
3577 ; GFX8-NEXT: v_lshlrev_b32_e32 v5, 16, v0
3578 ; GFX8-NEXT: .LBB9_1: ; %atomicrmw.start
3579 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
3580 ; GFX8-NEXT: v_mov_b32_e32 v0, s6
3581 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3582 ; GFX8-NEXT: v_lshrrev_b32_sdwa v3, v0, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3583 ; GFX8-NEXT: v_add_f32_e32 v3, v3, v5
3584 ; GFX8-NEXT: v_bfe_u32 v6, v3, 16, 1
3585 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v3
3586 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
3587 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v3
3588 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v3, v3
3589 ; GFX8-NEXT: v_cndmask_b32_e32 v3, v6, v7, vcc
3590 ; GFX8-NEXT: v_and_b32_e32 v2, s7, v1
3591 ; GFX8-NEXT: v_lshlrev_b32_sdwa v0, v0, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3592 ; GFX8-NEXT: v_or_b32_e32 v0, v2, v0
3593 ; GFX8-NEXT: v_mov_b32_e32 v3, v1
3594 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
3595 ; GFX8-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[8:11], 0 offen glc
3596 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3597 ; GFX8-NEXT: buffer_wbinvl1
3598 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
3599 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3600 ; GFX8-NEXT: v_mov_b32_e32 v1, v2
3601 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
3602 ; GFX8-NEXT: s_cbranch_execnz .LBB9_1
3603 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
3604 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
3605 ; GFX8-NEXT: v_lshrrev_b32_e32 v0, s6, v2
3606 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3608 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3610 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3611 ; GFX7-NEXT: s_addk_i32 s18, 0x200
3612 ; GFX7-NEXT: s_and_b32 s4, s18, -4
3613 ; GFX7-NEXT: s_mov_b32 s11, s17
3614 ; GFX7-NEXT: s_mov_b32 s10, s16
3615 ; GFX7-NEXT: s_mov_b32 s9, s7
3616 ; GFX7-NEXT: s_mov_b32 s8, s6
3617 ; GFX7-NEXT: v_mov_b32_e32 v4, s4
3618 ; GFX7-NEXT: buffer_load_dword v1, v4, s[8:11], 0 offen
3619 ; GFX7-NEXT: s_and_b32 s4, s18, 3
3620 ; GFX7-NEXT: s_lshl_b32 s6, s4, 3
3621 ; GFX7-NEXT: s_lshl_b32 s4, 0xffff, s6
3622 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
3623 ; GFX7-NEXT: s_not_b32 s7, s4
3624 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
3625 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
3626 ; GFX7-NEXT: .LBB9_1: ; %atomicrmw.start
3627 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
3628 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3629 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v1
3630 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3631 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v5
3632 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3633 ; GFX7-NEXT: v_and_b32_e32 v2, s7, v1
3634 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, s6, v0
3635 ; GFX7-NEXT: v_or_b32_e32 v0, v2, v0
3636 ; GFX7-NEXT: v_mov_b32_e32 v3, v1
3637 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
3638 ; GFX7-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[8:11], 0 offen glc
3639 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3640 ; GFX7-NEXT: buffer_wbinvl1
3641 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
3642 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3643 ; GFX7-NEXT: v_mov_b32_e32 v1, v2
3644 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
3645 ; GFX7-NEXT: s_cbranch_execnz .LBB9_1
3646 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
3647 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
3648 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v2
3649 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3650 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3652 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset:
3654 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3655 ; GFX6-NEXT: s_addk_i32 s18, 0x200
3656 ; GFX6-NEXT: s_and_b32 s4, s18, -4
3657 ; GFX6-NEXT: s_mov_b32 s11, s17
3658 ; GFX6-NEXT: s_mov_b32 s10, s16
3659 ; GFX6-NEXT: s_mov_b32 s9, s7
3660 ; GFX6-NEXT: s_mov_b32 s8, s6
3661 ; GFX6-NEXT: v_mov_b32_e32 v4, s4
3662 ; GFX6-NEXT: buffer_load_dword v1, v4, s[8:11], 0 offen
3663 ; GFX6-NEXT: s_and_b32 s4, s18, 3
3664 ; GFX6-NEXT: s_lshl_b32 s6, s4, 3
3665 ; GFX6-NEXT: s_lshl_b32 s4, 0xffff, s6
3666 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
3667 ; GFX6-NEXT: s_not_b32 s7, s4
3668 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
3669 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
3670 ; GFX6-NEXT: .LBB9_1: ; %atomicrmw.start
3671 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
3672 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3673 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v1
3674 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3675 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v5
3676 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3677 ; GFX6-NEXT: s_waitcnt expcnt(0)
3678 ; GFX6-NEXT: v_and_b32_e32 v2, s7, v1
3679 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, s6, v0
3680 ; GFX6-NEXT: v_or_b32_e32 v0, v2, v0
3681 ; GFX6-NEXT: v_mov_b32_e32 v3, v1
3682 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
3683 ; GFX6-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[8:11], 0 offen glc
3684 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3685 ; GFX6-NEXT: buffer_wbinvl1
3686 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
3687 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3688 ; GFX6-NEXT: v_mov_b32_e32 v1, v2
3689 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
3690 ; GFX6-NEXT: s_cbranch_execnz .LBB9_1
3691 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
3692 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
3693 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v2
3694 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3695 ; GFX6-NEXT: s_waitcnt expcnt(0)
3696 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3697 %gep = getelementptr bfloat, ptr addrspace(7) %ptr, i32 256
3698 %result = atomicrmw fadd ptr addrspace(7) %gep, bfloat %val syncscope("agent") seq_cst
3702 define void @buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset(ptr addrspace(7) inreg %ptr, bfloat %val) #0 {
3703 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
3705 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
3706 ; GFX12-NEXT: s_wait_expcnt 0x0
3707 ; GFX12-NEXT: s_wait_samplecnt 0x0
3708 ; GFX12-NEXT: s_wait_bvhcnt 0x0
3709 ; GFX12-NEXT: s_wait_kmcnt 0x0
3710 ; GFX12-NEXT: s_addk_co_i32 s6, 0x200
3711 ; GFX12-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3712 ; GFX12-NEXT: s_and_b32 s4, s6, -4
3713 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
3714 ; GFX12-NEXT: v_mov_b32_e32 v2, s4
3715 ; GFX12-NEXT: s_and_b32 s4, s6, 3
3716 ; GFX12-NEXT: s_lshl_b32 s4, s4, 3
3717 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3718 ; GFX12-NEXT: s_lshl_b32 s5, 0xffff, s4
3719 ; GFX12-NEXT: buffer_load_b32 v1, v2, s[0:3], null offen
3720 ; GFX12-NEXT: s_not_b32 s6, s5
3721 ; GFX12-NEXT: s_mov_b32 s5, 0
3722 ; GFX12-NEXT: .LBB10_1: ; %atomicrmw.start
3723 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
3724 ; GFX12-NEXT: s_wait_loadcnt 0x0
3725 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, s4, v1
3726 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
3727 ; GFX12-NEXT: s_wait_storecnt 0x0
3728 ; GFX12-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3729 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3730 ; GFX12-NEXT: v_add_f32_e32 v0, v0, v3
3731 ; GFX12-NEXT: v_bfe_u32 v4, v0, 16, 1
3732 ; GFX12-NEXT: v_or_b32_e32 v5, 0x400000, v0
3733 ; GFX12-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3734 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
3735 ; GFX12-NEXT: v_add3_u32 v4, v4, v0, 0x7fff
3736 ; GFX12-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc_lo
3737 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3738 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3739 ; GFX12-NEXT: v_lshlrev_b32_e32 v0, s4, v0
3740 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3741 ; GFX12-NEXT: v_and_or_b32 v0, v1, s6, v0
3742 ; GFX12-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
3743 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v2, s[0:3], null offen th:TH_ATOMIC_RETURN
3744 ; GFX12-NEXT: s_wait_loadcnt 0x0
3745 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
3746 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v1
3747 ; GFX12-NEXT: v_mov_b32_e32 v1, v4
3748 ; GFX12-NEXT: s_or_b32 s5, vcc_lo, s5
3749 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3750 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
3751 ; GFX12-NEXT: s_cbranch_execnz .LBB10_1
3752 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
3753 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s5
3754 ; GFX12-NEXT: s_setpc_b64 s[30:31]
3756 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
3758 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3759 ; GFX940-NEXT: s_addk_i32 s6, 0x200
3760 ; GFX940-NEXT: s_and_b32 s4, s6, -4
3761 ; GFX940-NEXT: v_mov_b32_e32 v2, s4
3762 ; GFX940-NEXT: buffer_load_dword v1, v2, s[0:3], 0 offen
3763 ; GFX940-NEXT: s_and_b32 s4, s6, 3
3764 ; GFX940-NEXT: s_lshl_b32 s6, s4, 3
3765 ; GFX940-NEXT: s_lshl_b32 s4, 0xffff, s6
3766 ; GFX940-NEXT: s_not_b32 s7, s4
3767 ; GFX940-NEXT: s_mov_b64 s[4:5], 0
3768 ; GFX940-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3769 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
3770 ; GFX940-NEXT: .LBB10_1: ; %atomicrmw.start
3771 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
3772 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3773 ; GFX940-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3774 ; GFX940-NEXT: buffer_wbl2 sc1
3775 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v3
3776 ; GFX940-NEXT: v_bfe_u32 v4, v0, 16, 1
3777 ; GFX940-NEXT: v_or_b32_e32 v5, 0x400000, v0
3778 ; GFX940-NEXT: v_add3_u32 v4, v4, v0, s8
3779 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3780 ; GFX940-NEXT: s_nop 1
3781 ; GFX940-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc
3782 ; GFX940-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3783 ; GFX940-NEXT: v_and_or_b32 v0, v1, s7, v0
3784 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[0:1]
3785 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[0:3], 0 offen sc0
3786 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3787 ; GFX940-NEXT: buffer_inv sc1
3788 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
3789 ; GFX940-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3790 ; GFX940-NEXT: v_mov_b32_e32 v1, v4
3791 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[4:5]
3792 ; GFX940-NEXT: s_cbranch_execnz .LBB10_1
3793 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
3794 ; GFX940-NEXT: s_or_b64 exec, exec, s[4:5]
3795 ; GFX940-NEXT: s_setpc_b64 s[30:31]
3797 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
3799 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3800 ; GFX11-NEXT: s_addk_i32 s6, 0x200
3801 ; GFX11-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3802 ; GFX11-NEXT: s_and_b32 s4, s6, -4
3803 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
3804 ; GFX11-NEXT: v_mov_b32_e32 v2, s4
3805 ; GFX11-NEXT: s_and_b32 s4, s6, 3
3806 ; GFX11-NEXT: s_lshl_b32 s4, s4, 3
3807 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3808 ; GFX11-NEXT: s_lshl_b32 s5, 0xffff, s4
3809 ; GFX11-NEXT: buffer_load_b32 v1, v2, s[0:3], 0 offen
3810 ; GFX11-NEXT: s_not_b32 s6, s5
3811 ; GFX11-NEXT: s_mov_b32 s5, 0
3812 ; GFX11-NEXT: .p2align 6
3813 ; GFX11-NEXT: .LBB10_1: ; %atomicrmw.start
3814 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
3815 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3816 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, s4, v1
3817 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
3818 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3819 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v0
3820 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v3
3821 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
3822 ; GFX11-NEXT: v_bfe_u32 v4, v0, 16, 1
3823 ; GFX11-NEXT: v_or_b32_e32 v5, 0x400000, v0
3824 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3825 ; GFX11-NEXT: v_add3_u32 v4, v4, v0, 0x7fff
3826 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3827 ; GFX11-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc_lo
3828 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, 16, v0
3829 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3830 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, s4, v0
3831 ; GFX11-NEXT: v_and_or_b32 v0, v1, s6, v0
3832 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
3833 ; GFX11-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
3834 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v2, s[0:3], 0 offen glc
3835 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3836 ; GFX11-NEXT: buffer_gl1_inv
3837 ; GFX11-NEXT: buffer_gl0_inv
3838 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v1
3839 ; GFX11-NEXT: v_mov_b32_e32 v1, v4
3840 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
3841 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3842 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
3843 ; GFX11-NEXT: s_cbranch_execnz .LBB10_1
3844 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
3845 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
3846 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3848 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
3850 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3851 ; GFX10-NEXT: s_addk_i32 s18, 0x200
3852 ; GFX10-NEXT: s_mov_b32 s11, s17
3853 ; GFX10-NEXT: s_and_b32 s4, s18, -4
3854 ; GFX10-NEXT: s_mov_b32 s10, s16
3855 ; GFX10-NEXT: v_mov_b32_e32 v2, s4
3856 ; GFX10-NEXT: s_mov_b32 s9, s7
3857 ; GFX10-NEXT: s_mov_b32 s8, s6
3858 ; GFX10-NEXT: s_and_b32 s4, s18, 3
3859 ; GFX10-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3860 ; GFX10-NEXT: buffer_load_dword v1, v2, s[8:11], 0 offen
3861 ; GFX10-NEXT: s_lshl_b32 s4, s4, 3
3862 ; GFX10-NEXT: s_lshl_b32 s5, 0xffff, s4
3863 ; GFX10-NEXT: s_not_b32 s6, s5
3864 ; GFX10-NEXT: s_mov_b32 s5, 0
3865 ; GFX10-NEXT: .LBB10_1: ; %atomicrmw.start
3866 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
3867 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3868 ; GFX10-NEXT: v_lshrrev_b32_sdwa v0, s4, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3869 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
3870 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v3
3871 ; GFX10-NEXT: v_bfe_u32 v4, v0, 16, 1
3872 ; GFX10-NEXT: v_or_b32_e32 v5, 0x400000, v0
3873 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
3874 ; GFX10-NEXT: v_add3_u32 v4, v4, v0, 0x7fff
3875 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc_lo
3876 ; GFX10-NEXT: v_lshlrev_b32_sdwa v0, s4, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3877 ; GFX10-NEXT: v_and_or_b32 v0, v1, s6, v0
3878 ; GFX10-NEXT: v_mov_b32_e32 v5, v1
3879 ; GFX10-NEXT: v_mov_b32_e32 v4, v0
3880 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[8:11], 0 offen glc
3881 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3882 ; GFX10-NEXT: buffer_gl1_inv
3883 ; GFX10-NEXT: buffer_gl0_inv
3884 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v1
3885 ; GFX10-NEXT: v_mov_b32_e32 v1, v4
3886 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
3887 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
3888 ; GFX10-NEXT: s_cbranch_execnz .LBB10_1
3889 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
3890 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
3891 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3893 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
3895 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3896 ; GFX90A-NEXT: s_addk_i32 s18, 0x200
3897 ; GFX90A-NEXT: s_and_b32 s4, s18, -4
3898 ; GFX90A-NEXT: s_mov_b32 s11, s17
3899 ; GFX90A-NEXT: s_mov_b32 s10, s16
3900 ; GFX90A-NEXT: s_mov_b32 s9, s7
3901 ; GFX90A-NEXT: s_mov_b32 s8, s6
3902 ; GFX90A-NEXT: v_mov_b32_e32 v2, s4
3903 ; GFX90A-NEXT: buffer_load_dword v1, v2, s[8:11], 0 offen
3904 ; GFX90A-NEXT: s_and_b32 s4, s18, 3
3905 ; GFX90A-NEXT: s_lshl_b32 s6, s4, 3
3906 ; GFX90A-NEXT: s_lshl_b32 s4, 0xffff, s6
3907 ; GFX90A-NEXT: s_not_b32 s7, s4
3908 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
3909 ; GFX90A-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3910 ; GFX90A-NEXT: s_movk_i32 s12, 0x7fff
3911 ; GFX90A-NEXT: .LBB10_1: ; %atomicrmw.start
3912 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
3913 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3914 ; GFX90A-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3915 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v3
3916 ; GFX90A-NEXT: v_bfe_u32 v4, v0, 16, 1
3917 ; GFX90A-NEXT: v_or_b32_e32 v5, 0x400000, v0
3918 ; GFX90A-NEXT: v_add3_u32 v4, v4, v0, s12
3919 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3920 ; GFX90A-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc
3921 ; GFX90A-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3922 ; GFX90A-NEXT: v_and_or_b32 v0, v1, s7, v0
3923 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[0:1], v[0:1] op_sel:[0,1]
3924 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[8:11], 0 offen glc
3925 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3926 ; GFX90A-NEXT: buffer_wbinvl1
3927 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
3928 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3929 ; GFX90A-NEXT: v_mov_b32_e32 v1, v4
3930 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
3931 ; GFX90A-NEXT: s_cbranch_execnz .LBB10_1
3932 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
3933 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
3934 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
3936 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
3938 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3939 ; GFX908-NEXT: s_addk_i32 s18, 0x200
3940 ; GFX908-NEXT: s_and_b32 s4, s18, -4
3941 ; GFX908-NEXT: s_mov_b32 s11, s17
3942 ; GFX908-NEXT: s_mov_b32 s10, s16
3943 ; GFX908-NEXT: s_mov_b32 s9, s7
3944 ; GFX908-NEXT: s_mov_b32 s8, s6
3945 ; GFX908-NEXT: v_mov_b32_e32 v2, s4
3946 ; GFX908-NEXT: buffer_load_dword v1, v2, s[8:11], 0 offen
3947 ; GFX908-NEXT: s_and_b32 s4, s18, 3
3948 ; GFX908-NEXT: s_lshl_b32 s6, s4, 3
3949 ; GFX908-NEXT: s_lshl_b32 s4, 0xffff, s6
3950 ; GFX908-NEXT: s_not_b32 s7, s4
3951 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
3952 ; GFX908-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3953 ; GFX908-NEXT: s_movk_i32 s12, 0x7fff
3954 ; GFX908-NEXT: .LBB10_1: ; %atomicrmw.start
3955 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
3956 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3957 ; GFX908-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
3958 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v3
3959 ; GFX908-NEXT: v_bfe_u32 v4, v0, 16, 1
3960 ; GFX908-NEXT: v_or_b32_e32 v5, 0x400000, v0
3961 ; GFX908-NEXT: v_add3_u32 v4, v4, v0, s12
3962 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
3963 ; GFX908-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc
3964 ; GFX908-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
3965 ; GFX908-NEXT: v_and_or_b32 v0, v1, s7, v0
3966 ; GFX908-NEXT: v_mov_b32_e32 v5, v1
3967 ; GFX908-NEXT: v_mov_b32_e32 v4, v0
3968 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[8:11], 0 offen glc
3969 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3970 ; GFX908-NEXT: buffer_wbinvl1
3971 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
3972 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3973 ; GFX908-NEXT: v_mov_b32_e32 v1, v4
3974 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
3975 ; GFX908-NEXT: s_cbranch_execnz .LBB10_1
3976 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
3977 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
3978 ; GFX908-NEXT: s_setpc_b64 s[30:31]
3980 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
3982 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3983 ; GFX8-NEXT: s_addk_i32 s18, 0x200
3984 ; GFX8-NEXT: s_and_b32 s4, s18, -4
3985 ; GFX8-NEXT: s_mov_b32 s11, s17
3986 ; GFX8-NEXT: s_mov_b32 s10, s16
3987 ; GFX8-NEXT: s_mov_b32 s9, s7
3988 ; GFX8-NEXT: s_mov_b32 s8, s6
3989 ; GFX8-NEXT: v_mov_b32_e32 v2, s4
3990 ; GFX8-NEXT: buffer_load_dword v1, v2, s[8:11], 0 offen
3991 ; GFX8-NEXT: s_and_b32 s4, s18, 3
3992 ; GFX8-NEXT: s_lshl_b32 s6, s4, 3
3993 ; GFX8-NEXT: s_lshl_b32 s4, 0xffff, s6
3994 ; GFX8-NEXT: s_not_b32 s7, s4
3995 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
3996 ; GFX8-NEXT: v_lshlrev_b32_e32 v3, 16, v0
3997 ; GFX8-NEXT: .LBB10_1: ; %atomicrmw.start
3998 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
3999 ; GFX8-NEXT: v_mov_b32_e32 v0, s6
4000 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4001 ; GFX8-NEXT: v_lshrrev_b32_sdwa v5, v0, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4002 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v3
4003 ; GFX8-NEXT: v_bfe_u32 v6, v5, 16, 1
4004 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v5
4005 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
4006 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v5
4007 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
4008 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v6, v7, vcc
4009 ; GFX8-NEXT: v_and_b32_e32 v4, s7, v1
4010 ; GFX8-NEXT: v_lshlrev_b32_sdwa v0, v0, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4011 ; GFX8-NEXT: v_or_b32_e32 v0, v4, v0
4012 ; GFX8-NEXT: v_mov_b32_e32 v5, v1
4013 ; GFX8-NEXT: v_mov_b32_e32 v4, v0
4014 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[8:11], 0 offen glc
4015 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4016 ; GFX8-NEXT: buffer_wbinvl1
4017 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
4018 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4019 ; GFX8-NEXT: v_mov_b32_e32 v1, v4
4020 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
4021 ; GFX8-NEXT: s_cbranch_execnz .LBB10_1
4022 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
4023 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
4024 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4026 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
4028 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4029 ; GFX7-NEXT: s_addk_i32 s18, 0x200
4030 ; GFX7-NEXT: s_and_b32 s4, s18, -4
4031 ; GFX7-NEXT: s_mov_b32 s11, s17
4032 ; GFX7-NEXT: s_mov_b32 s10, s16
4033 ; GFX7-NEXT: s_mov_b32 s9, s7
4034 ; GFX7-NEXT: s_mov_b32 s8, s6
4035 ; GFX7-NEXT: v_mov_b32_e32 v2, s4
4036 ; GFX7-NEXT: buffer_load_dword v1, v2, s[8:11], 0 offen
4037 ; GFX7-NEXT: s_and_b32 s4, s18, 3
4038 ; GFX7-NEXT: s_lshl_b32 s6, s4, 3
4039 ; GFX7-NEXT: s_lshl_b32 s4, 0xffff, s6
4040 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
4041 ; GFX7-NEXT: s_not_b32 s7, s4
4042 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
4043 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
4044 ; GFX7-NEXT: .LBB10_1: ; %atomicrmw.start
4045 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
4046 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4047 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v1
4048 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v0
4049 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v3
4050 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v0
4051 ; GFX7-NEXT: v_and_b32_e32 v4, s7, v1
4052 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, s6, v0
4053 ; GFX7-NEXT: v_or_b32_e32 v0, v4, v0
4054 ; GFX7-NEXT: v_mov_b32_e32 v5, v1
4055 ; GFX7-NEXT: v_mov_b32_e32 v4, v0
4056 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[8:11], 0 offen glc
4057 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4058 ; GFX7-NEXT: buffer_wbinvl1
4059 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
4060 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4061 ; GFX7-NEXT: v_mov_b32_e32 v1, v4
4062 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
4063 ; GFX7-NEXT: s_cbranch_execnz .LBB10_1
4064 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
4065 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
4066 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4068 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset:
4070 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4071 ; GFX6-NEXT: s_addk_i32 s18, 0x200
4072 ; GFX6-NEXT: s_and_b32 s4, s18, -4
4073 ; GFX6-NEXT: s_mov_b32 s11, s17
4074 ; GFX6-NEXT: s_mov_b32 s10, s16
4075 ; GFX6-NEXT: s_mov_b32 s9, s7
4076 ; GFX6-NEXT: s_mov_b32 s8, s6
4077 ; GFX6-NEXT: v_mov_b32_e32 v2, s4
4078 ; GFX6-NEXT: buffer_load_dword v1, v2, s[8:11], 0 offen
4079 ; GFX6-NEXT: s_and_b32 s4, s18, 3
4080 ; GFX6-NEXT: s_lshl_b32 s6, s4, 3
4081 ; GFX6-NEXT: s_lshl_b32 s4, 0xffff, s6
4082 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
4083 ; GFX6-NEXT: s_not_b32 s7, s4
4084 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
4085 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
4086 ; GFX6-NEXT: .LBB10_1: ; %atomicrmw.start
4087 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
4088 ; GFX6-NEXT: s_waitcnt vmcnt(0)
4089 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v1
4090 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v0
4091 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v3
4092 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, 16, v0
4093 ; GFX6-NEXT: s_waitcnt expcnt(0)
4094 ; GFX6-NEXT: v_and_b32_e32 v4, s7, v1
4095 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, s6, v0
4096 ; GFX6-NEXT: v_or_b32_e32 v0, v4, v0
4097 ; GFX6-NEXT: v_mov_b32_e32 v5, v1
4098 ; GFX6-NEXT: v_mov_b32_e32 v4, v0
4099 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[8:11], 0 offen glc
4100 ; GFX6-NEXT: s_waitcnt vmcnt(0)
4101 ; GFX6-NEXT: buffer_wbinvl1
4102 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
4103 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4104 ; GFX6-NEXT: v_mov_b32_e32 v1, v4
4105 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
4106 ; GFX6-NEXT: s_cbranch_execnz .LBB10_1
4107 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
4108 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
4109 ; GFX6-NEXT: s_waitcnt expcnt(0)
4110 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4111 %gep = getelementptr bfloat, ptr addrspace(7) %ptr, i32 256
4112 %unused = atomicrmw fadd ptr addrspace(7) %gep, bfloat %val syncscope("agent") seq_cst
4116 define bfloat @buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall(ptr addrspace(7) %ptr, bfloat %val) #0 {
4117 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4119 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
4120 ; GFX12-NEXT: s_wait_expcnt 0x0
4121 ; GFX12-NEXT: s_wait_samplecnt 0x0
4122 ; GFX12-NEXT: s_wait_bvhcnt 0x0
4123 ; GFX12-NEXT: s_wait_kmcnt 0x0
4124 ; GFX12-NEXT: v_add_nc_u32_e32 v4, 0x200, v4
4125 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
4126 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
4127 ; GFX12-NEXT: v_and_b32_e32 v6, 3, v4
4128 ; GFX12-NEXT: v_and_b32_e32 v8, -4, v4
4129 ; GFX12-NEXT: v_lshlrev_b32_e32 v7, 3, v6
4130 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4131 ; GFX12-NEXT: v_lshlrev_b32_e64 v6, v7, 0xffff
4132 ; GFX12-NEXT: v_not_b32_e32 v9, v6
4133 ; GFX12-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4134 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
4135 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
4136 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
4137 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
4138 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
4139 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
4140 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
4141 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
4142 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
4143 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
4144 ; GFX12-NEXT: buffer_load_b32 v6, v8, s[4:7], null offen
4145 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
4146 ; GFX12-NEXT: s_cbranch_execnz .LBB11_1
4147 ; GFX12-NEXT: ; %bb.2:
4148 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
4149 ; GFX12-NEXT: v_lshlrev_b32_e32 v10, 16, v5
4150 ; GFX12-NEXT: s_mov_b32 s1, 0
4151 ; GFX12-NEXT: .LBB11_3: ; %atomicrmw.start
4152 ; GFX12-NEXT: ; =>This Loop Header: Depth=1
4153 ; GFX12-NEXT: ; Child Loop BB11_4 Depth 2
4154 ; GFX12-NEXT: s_wait_loadcnt 0x0
4155 ; GFX12-NEXT: v_lshrrev_b32_e32 v4, v7, v6
4156 ; GFX12-NEXT: s_mov_b32 s2, exec_lo
4157 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
4158 ; GFX12-NEXT: s_wait_storecnt 0x0
4159 ; GFX12-NEXT: v_lshlrev_b32_e32 v4, 16, v4
4160 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4161 ; GFX12-NEXT: v_add_f32_e32 v4, v4, v10
4162 ; GFX12-NEXT: v_bfe_u32 v5, v4, 16, 1
4163 ; GFX12-NEXT: v_or_b32_e32 v11, 0x400000, v4
4164 ; GFX12-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
4165 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
4166 ; GFX12-NEXT: v_add3_u32 v5, v5, v4, 0x7fff
4167 ; GFX12-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc_lo
4168 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4169 ; GFX12-NEXT: v_lshrrev_b32_e32 v4, 16, v4
4170 ; GFX12-NEXT: v_lshlrev_b32_e32 v4, v7, v4
4171 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4172 ; GFX12-NEXT: v_and_or_b32 v5, v6, v9, v4
4173 ; GFX12-NEXT: v_mov_b32_e32 v4, v5
4174 ; GFX12-NEXT: v_mov_b32_e32 v5, v6
4175 ; GFX12-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4176 ; GFX12-NEXT: ; => This Inner Loop Header: Depth=2
4177 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
4178 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
4179 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
4180 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
4181 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
4182 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
4183 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
4184 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
4185 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
4186 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
4187 ; GFX12-NEXT: s_wait_loadcnt 0x0
4188 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v8, s[4:7], null offen th:TH_ATOMIC_RETURN
4189 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
4190 ; GFX12-NEXT: s_cbranch_execnz .LBB11_4
4191 ; GFX12-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4192 ; GFX12-NEXT: s_mov_b32 exec_lo, s2
4193 ; GFX12-NEXT: s_wait_loadcnt 0x0
4194 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
4195 ; GFX12-NEXT: v_mov_b32_e32 v6, v4
4196 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
4197 ; GFX12-NEXT: s_or_b32 s1, vcc_lo, s1
4198 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4199 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
4200 ; GFX12-NEXT: s_cbranch_execnz .LBB11_3
4201 ; GFX12-NEXT: ; %bb.6: ; %atomicrmw.end
4202 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s1
4203 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4204 ; GFX12-NEXT: s_setpc_b64 s[30:31]
4206 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4208 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4209 ; GFX940-NEXT: v_add_u32_e32 v4, 0x200, v4
4210 ; GFX940-NEXT: v_and_b32_e32 v9, -4, v4
4211 ; GFX940-NEXT: v_and_b32_e32 v4, 3, v4
4212 ; GFX940-NEXT: v_lshlrev_b32_e32 v8, 3, v4
4213 ; GFX940-NEXT: s_mov_b32 s0, 0xffff
4214 ; GFX940-NEXT: v_lshlrev_b32_e64 v4, v8, s0
4215 ; GFX940-NEXT: v_not_b32_e32 v10, v4
4216 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
4217 ; GFX940-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4218 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
4219 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
4220 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
4221 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
4222 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
4223 ; GFX940-NEXT: s_nop 0
4224 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
4225 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
4226 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
4227 ; GFX940-NEXT: buffer_load_dword v7, v9, s[4:7], 0 offen
4228 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
4229 ; GFX940-NEXT: s_cbranch_execnz .LBB11_1
4230 ; GFX940-NEXT: ; %bb.2:
4231 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
4232 ; GFX940-NEXT: s_mov_b64 s[2:3], 0
4233 ; GFX940-NEXT: v_lshlrev_b32_e32 v11, 16, v5
4234 ; GFX940-NEXT: s_movk_i32 s10, 0x7fff
4235 ; GFX940-NEXT: .LBB11_3: ; %atomicrmw.start
4236 ; GFX940-NEXT: ; =>This Loop Header: Depth=1
4237 ; GFX940-NEXT: ; Child Loop BB11_4 Depth 2
4238 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4239 ; GFX940-NEXT: v_lshrrev_b32_sdwa v4, v8, v7 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4240 ; GFX940-NEXT: s_mov_b64 s[8:9], exec
4241 ; GFX940-NEXT: v_add_f32_e32 v4, v4, v11
4242 ; GFX940-NEXT: v_bfe_u32 v5, v4, 16, 1
4243 ; GFX940-NEXT: v_add3_u32 v5, v5, v4, s10
4244 ; GFX940-NEXT: v_or_b32_e32 v6, 0x400000, v4
4245 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
4246 ; GFX940-NEXT: buffer_wbl2 sc1
4247 ; GFX940-NEXT: s_nop 0
4248 ; GFX940-NEXT: v_cndmask_b32_e32 v4, v5, v6, vcc
4249 ; GFX940-NEXT: v_lshlrev_b32_sdwa v4, v8, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4250 ; GFX940-NEXT: v_and_or_b32 v6, v7, v10, v4
4251 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[6:7]
4252 ; GFX940-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4253 ; GFX940-NEXT: ; => This Inner Loop Header: Depth=2
4254 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
4255 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
4256 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
4257 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
4258 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
4259 ; GFX940-NEXT: s_nop 0
4260 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
4261 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
4262 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
4263 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4264 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v9, s[4:7], 0 offen sc0
4265 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
4266 ; GFX940-NEXT: s_cbranch_execnz .LBB11_4
4267 ; GFX940-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4268 ; GFX940-NEXT: s_mov_b64 exec, s[8:9]
4269 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4270 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v7
4271 ; GFX940-NEXT: s_or_b64 s[2:3], vcc, s[2:3]
4272 ; GFX940-NEXT: v_mov_b32_e32 v7, v4
4273 ; GFX940-NEXT: buffer_inv sc1
4274 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[2:3]
4275 ; GFX940-NEXT: s_cbranch_execnz .LBB11_3
4276 ; GFX940-NEXT: ; %bb.6: ; %atomicrmw.end
4277 ; GFX940-NEXT: s_or_b64 exec, exec, s[2:3]
4278 ; GFX940-NEXT: v_lshrrev_b32_e32 v0, v8, v4
4279 ; GFX940-NEXT: s_setpc_b64 s[30:31]
4281 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4283 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4284 ; GFX11-NEXT: v_add_nc_u32_e32 v4, 0x200, v4
4285 ; GFX11-NEXT: s_mov_b32 s1, 0
4286 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
4287 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
4288 ; GFX11-NEXT: v_and_b32_e32 v6, 3, v4
4289 ; GFX11-NEXT: v_and_b32_e32 v8, -4, v4
4290 ; GFX11-NEXT: v_lshlrev_b32_e32 v7, 3, v6
4291 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4292 ; GFX11-NEXT: v_lshlrev_b32_e64 v6, v7, 0xffff
4293 ; GFX11-NEXT: v_not_b32_e32 v9, v6
4294 ; GFX11-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4295 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
4296 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
4297 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
4298 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
4299 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
4300 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
4301 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
4302 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
4303 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
4304 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
4305 ; GFX11-NEXT: buffer_load_b32 v6, v8, s[4:7], 0 offen
4306 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
4307 ; GFX11-NEXT: s_cbranch_execnz .LBB11_1
4308 ; GFX11-NEXT: ; %bb.2:
4309 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
4310 ; GFX11-NEXT: v_lshlrev_b32_e32 v10, 16, v5
4311 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
4312 ; GFX11-NEXT: .p2align 6
4313 ; GFX11-NEXT: .LBB11_3: ; %atomicrmw.start
4314 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
4315 ; GFX11-NEXT: ; Child Loop BB11_4 Depth 2
4316 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4317 ; GFX11-NEXT: v_lshrrev_b32_e32 v4, v7, v6
4318 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
4319 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
4320 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4321 ; GFX11-NEXT: v_lshlrev_b32_e32 v4, 16, v4
4322 ; GFX11-NEXT: v_add_f32_e32 v4, v4, v10
4323 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
4324 ; GFX11-NEXT: v_bfe_u32 v5, v4, 16, 1
4325 ; GFX11-NEXT: v_or_b32_e32 v11, 0x400000, v4
4326 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
4327 ; GFX11-NEXT: v_add3_u32 v5, v5, v4, 0x7fff
4328 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4329 ; GFX11-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc_lo
4330 ; GFX11-NEXT: v_lshrrev_b32_e32 v4, 16, v4
4331 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4332 ; GFX11-NEXT: v_lshlrev_b32_e32 v4, v7, v4
4333 ; GFX11-NEXT: v_and_or_b32 v5, v6, v9, v4
4334 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
4335 ; GFX11-NEXT: v_mov_b32_e32 v4, v5
4336 ; GFX11-NEXT: v_mov_b32_e32 v5, v6
4337 ; GFX11-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4338 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
4339 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
4340 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
4341 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
4342 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
4343 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
4344 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
4345 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
4346 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
4347 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
4348 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
4349 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4350 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v8, s[4:7], 0 offen glc
4351 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
4352 ; GFX11-NEXT: s_cbranch_execnz .LBB11_4
4353 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4354 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
4355 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4356 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
4357 ; GFX11-NEXT: v_mov_b32_e32 v6, v4
4358 ; GFX11-NEXT: buffer_gl1_inv
4359 ; GFX11-NEXT: buffer_gl0_inv
4360 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
4361 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4362 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
4363 ; GFX11-NEXT: s_cbranch_execnz .LBB11_3
4364 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
4365 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
4366 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
4367 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4368 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4370 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4372 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4373 ; GFX10-NEXT: v_add_nc_u32_e32 v4, 0x200, v4
4374 ; GFX10-NEXT: s_mov_b32 s5, 0
4375 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
4376 ; GFX10-NEXT: v_and_b32_e32 v6, 3, v4
4377 ; GFX10-NEXT: v_and_b32_e32 v8, -4, v4
4378 ; GFX10-NEXT: v_lshlrev_b32_e32 v7, 3, v6
4379 ; GFX10-NEXT: v_lshlrev_b32_e64 v6, v7, 0xffff
4380 ; GFX10-NEXT: v_not_b32_e32 v9, v6
4381 ; GFX10-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4382 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
4383 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
4384 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
4385 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
4386 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
4387 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
4388 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
4389 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
4390 ; GFX10-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
4391 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
4392 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
4393 ; GFX10-NEXT: s_cbranch_execnz .LBB11_1
4394 ; GFX10-NEXT: ; %bb.2:
4395 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
4396 ; GFX10-NEXT: v_lshlrev_b32_e32 v10, 16, v5
4397 ; GFX10-NEXT: .LBB11_3: ; %atomicrmw.start
4398 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
4399 ; GFX10-NEXT: ; Child Loop BB11_4 Depth 2
4400 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4401 ; GFX10-NEXT: v_lshrrev_b32_sdwa v4, v7, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4402 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
4403 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
4404 ; GFX10-NEXT: v_add_f32_e32 v4, v4, v10
4405 ; GFX10-NEXT: v_bfe_u32 v5, v4, 16, 1
4406 ; GFX10-NEXT: v_or_b32_e32 v11, 0x400000, v4
4407 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
4408 ; GFX10-NEXT: v_add3_u32 v5, v5, v4, 0x7fff
4409 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc_lo
4410 ; GFX10-NEXT: v_lshlrev_b32_sdwa v4, v7, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4411 ; GFX10-NEXT: v_and_or_b32 v5, v6, v9, v4
4412 ; GFX10-NEXT: v_mov_b32_e32 v4, v5
4413 ; GFX10-NEXT: v_mov_b32_e32 v5, v6
4414 ; GFX10-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4415 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
4416 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
4417 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
4418 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
4419 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
4420 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
4421 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
4422 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
4423 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
4424 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4425 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
4426 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
4427 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
4428 ; GFX10-NEXT: s_cbranch_execnz .LBB11_4
4429 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4430 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
4431 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4432 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
4433 ; GFX10-NEXT: v_mov_b32_e32 v6, v4
4434 ; GFX10-NEXT: buffer_gl1_inv
4435 ; GFX10-NEXT: buffer_gl0_inv
4436 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
4437 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
4438 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
4439 ; GFX10-NEXT: s_cbranch_execnz .LBB11_3
4440 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
4441 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
4442 ; GFX10-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4443 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4445 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4447 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4448 ; GFX90A-NEXT: v_add_u32_e32 v4, 0x200, v4
4449 ; GFX90A-NEXT: v_and_b32_e32 v9, -4, v4
4450 ; GFX90A-NEXT: v_and_b32_e32 v4, 3, v4
4451 ; GFX90A-NEXT: v_lshlrev_b32_e32 v8, 3, v4
4452 ; GFX90A-NEXT: s_mov_b32 s4, 0xffff
4453 ; GFX90A-NEXT: v_lshlrev_b32_e64 v4, v8, s4
4454 ; GFX90A-NEXT: v_not_b32_e32 v10, v4
4455 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
4456 ; GFX90A-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4457 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
4458 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
4459 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
4460 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
4461 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4462 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4463 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4464 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4465 ; GFX90A-NEXT: s_nop 0
4466 ; GFX90A-NEXT: buffer_load_dword v7, v9, s[8:11], 0 offen
4467 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
4468 ; GFX90A-NEXT: s_cbranch_execnz .LBB11_1
4469 ; GFX90A-NEXT: ; %bb.2:
4470 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
4471 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
4472 ; GFX90A-NEXT: v_lshlrev_b32_e32 v11, 16, v5
4473 ; GFX90A-NEXT: s_movk_i32 s14, 0x7fff
4474 ; GFX90A-NEXT: .LBB11_3: ; %atomicrmw.start
4475 ; GFX90A-NEXT: ; =>This Loop Header: Depth=1
4476 ; GFX90A-NEXT: ; Child Loop BB11_4 Depth 2
4477 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4478 ; GFX90A-NEXT: v_lshrrev_b32_sdwa v4, v8, v7 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4479 ; GFX90A-NEXT: v_add_f32_e32 v4, v4, v11
4480 ; GFX90A-NEXT: v_bfe_u32 v5, v4, 16, 1
4481 ; GFX90A-NEXT: v_add3_u32 v5, v5, v4, s14
4482 ; GFX90A-NEXT: v_or_b32_e32 v6, 0x400000, v4
4483 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
4484 ; GFX90A-NEXT: v_cndmask_b32_e32 v4, v5, v6, vcc
4485 ; GFX90A-NEXT: v_lshlrev_b32_sdwa v4, v8, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4486 ; GFX90A-NEXT: v_and_or_b32 v6, v7, v10, v4
4487 ; GFX90A-NEXT: s_mov_b64 s[12:13], exec
4488 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[6:7], v[6:7] op_sel:[0,1]
4489 ; GFX90A-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4490 ; GFX90A-NEXT: ; => This Inner Loop Header: Depth=2
4491 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
4492 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
4493 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
4494 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
4495 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4496 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4497 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4498 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4499 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4500 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v9, s[8:11], 0 offen glc
4501 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
4502 ; GFX90A-NEXT: s_cbranch_execnz .LBB11_4
4503 ; GFX90A-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4504 ; GFX90A-NEXT: s_mov_b64 exec, s[12:13]
4505 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4506 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v7
4507 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4508 ; GFX90A-NEXT: v_mov_b32_e32 v7, v4
4509 ; GFX90A-NEXT: buffer_wbinvl1
4510 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
4511 ; GFX90A-NEXT: s_cbranch_execnz .LBB11_3
4512 ; GFX90A-NEXT: ; %bb.6: ; %atomicrmw.end
4513 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
4514 ; GFX90A-NEXT: v_lshrrev_b32_e32 v0, v8, v4
4515 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
4517 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4519 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4520 ; GFX908-NEXT: v_add_u32_e32 v4, 0x200, v4
4521 ; GFX908-NEXT: v_and_b32_e32 v8, -4, v4
4522 ; GFX908-NEXT: v_and_b32_e32 v4, 3, v4
4523 ; GFX908-NEXT: v_lshlrev_b32_e32 v7, 3, v4
4524 ; GFX908-NEXT: s_mov_b32 s4, 0xffff
4525 ; GFX908-NEXT: v_lshlrev_b32_e64 v4, v7, s4
4526 ; GFX908-NEXT: v_not_b32_e32 v9, v4
4527 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
4528 ; GFX908-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4529 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
4530 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
4531 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
4532 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
4533 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4534 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4535 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4536 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4537 ; GFX908-NEXT: s_nop 0
4538 ; GFX908-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
4539 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
4540 ; GFX908-NEXT: s_cbranch_execnz .LBB11_1
4541 ; GFX908-NEXT: ; %bb.2:
4542 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
4543 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
4544 ; GFX908-NEXT: v_lshlrev_b32_e32 v10, 16, v5
4545 ; GFX908-NEXT: s_movk_i32 s14, 0x7fff
4546 ; GFX908-NEXT: .LBB11_3: ; %atomicrmw.start
4547 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
4548 ; GFX908-NEXT: ; Child Loop BB11_4 Depth 2
4549 ; GFX908-NEXT: s_waitcnt vmcnt(0)
4550 ; GFX908-NEXT: v_lshrrev_b32_sdwa v4, v7, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4551 ; GFX908-NEXT: v_add_f32_e32 v4, v4, v10
4552 ; GFX908-NEXT: v_bfe_u32 v5, v4, 16, 1
4553 ; GFX908-NEXT: v_add3_u32 v5, v5, v4, s14
4554 ; GFX908-NEXT: v_or_b32_e32 v11, 0x400000, v4
4555 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
4556 ; GFX908-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc
4557 ; GFX908-NEXT: v_lshlrev_b32_sdwa v4, v7, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4558 ; GFX908-NEXT: v_and_or_b32 v5, v6, v9, v4
4559 ; GFX908-NEXT: v_mov_b32_e32 v4, v5
4560 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
4561 ; GFX908-NEXT: v_mov_b32_e32 v5, v6
4562 ; GFX908-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4563 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
4564 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
4565 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
4566 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
4567 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
4568 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4569 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4570 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4571 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4572 ; GFX908-NEXT: s_waitcnt vmcnt(0)
4573 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
4574 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
4575 ; GFX908-NEXT: s_cbranch_execnz .LBB11_4
4576 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4577 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
4578 ; GFX908-NEXT: s_waitcnt vmcnt(0)
4579 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
4580 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4581 ; GFX908-NEXT: v_mov_b32_e32 v6, v4
4582 ; GFX908-NEXT: buffer_wbinvl1
4583 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
4584 ; GFX908-NEXT: s_cbranch_execnz .LBB11_3
4585 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
4586 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
4587 ; GFX908-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4588 ; GFX908-NEXT: s_setpc_b64 s[30:31]
4590 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4592 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4593 ; GFX8-NEXT: v_add_u32_e32 v4, vcc, 0x200, v4
4594 ; GFX8-NEXT: v_and_b32_e32 v8, -4, v4
4595 ; GFX8-NEXT: v_and_b32_e32 v4, 3, v4
4596 ; GFX8-NEXT: v_lshlrev_b32_e32 v7, 3, v4
4597 ; GFX8-NEXT: s_mov_b32 s4, 0xffff
4598 ; GFX8-NEXT: v_lshlrev_b32_e64 v4, v7, s4
4599 ; GFX8-NEXT: v_not_b32_e32 v9, v4
4600 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
4601 ; GFX8-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4602 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
4603 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
4604 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
4605 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
4606 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4607 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4608 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4609 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4610 ; GFX8-NEXT: s_nop 0
4611 ; GFX8-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
4612 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
4613 ; GFX8-NEXT: s_cbranch_execnz .LBB11_1
4614 ; GFX8-NEXT: ; %bb.2:
4615 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
4616 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
4617 ; GFX8-NEXT: v_lshlrev_b32_e32 v10, 16, v5
4618 ; GFX8-NEXT: .LBB11_3: ; %atomicrmw.start
4619 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
4620 ; GFX8-NEXT: ; Child Loop BB11_4 Depth 2
4621 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4622 ; GFX8-NEXT: v_lshrrev_b32_sdwa v4, v7, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4623 ; GFX8-NEXT: v_add_f32_e32 v4, v4, v10
4624 ; GFX8-NEXT: v_bfe_u32 v5, v4, 16, 1
4625 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, v5, v4
4626 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, 0x7fff, v5
4627 ; GFX8-NEXT: v_or_b32_e32 v11, 0x400000, v4
4628 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
4629 ; GFX8-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc
4630 ; GFX8-NEXT: v_lshlrev_b32_sdwa v4, v7, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4631 ; GFX8-NEXT: v_and_b32_e32 v5, v6, v9
4632 ; GFX8-NEXT: v_or_b32_e32 v5, v5, v4
4633 ; GFX8-NEXT: v_mov_b32_e32 v4, v5
4634 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
4635 ; GFX8-NEXT: v_mov_b32_e32 v5, v6
4636 ; GFX8-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4637 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
4638 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
4639 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
4640 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
4641 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
4642 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4643 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4644 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4645 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4646 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4647 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
4648 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
4649 ; GFX8-NEXT: s_cbranch_execnz .LBB11_4
4650 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4651 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
4652 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4653 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
4654 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4655 ; GFX8-NEXT: v_mov_b32_e32 v6, v4
4656 ; GFX8-NEXT: buffer_wbinvl1
4657 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
4658 ; GFX8-NEXT: s_cbranch_execnz .LBB11_3
4659 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
4660 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
4661 ; GFX8-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4662 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4664 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4666 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4667 ; GFX7-NEXT: v_add_i32_e32 v4, vcc, 0x200, v4
4668 ; GFX7-NEXT: v_and_b32_e32 v8, -4, v4
4669 ; GFX7-NEXT: v_and_b32_e32 v4, 3, v4
4670 ; GFX7-NEXT: v_lshlrev_b32_e32 v7, 3, v4
4671 ; GFX7-NEXT: v_lshl_b32_e32 v4, 0xffff, v7
4672 ; GFX7-NEXT: v_not_b32_e32 v9, v4
4673 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
4674 ; GFX7-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4675 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
4676 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
4677 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
4678 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
4679 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4680 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4681 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4682 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4683 ; GFX7-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
4684 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
4685 ; GFX7-NEXT: s_cbranch_execnz .LBB11_1
4686 ; GFX7-NEXT: ; %bb.2:
4687 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
4688 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v5
4689 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
4690 ; GFX7-NEXT: v_and_b32_e32 v10, 0xffff0000, v4
4691 ; GFX7-NEXT: .LBB11_3: ; %atomicrmw.start
4692 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
4693 ; GFX7-NEXT: ; Child Loop BB11_4 Depth 2
4694 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4695 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, v7, v6
4696 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v4
4697 ; GFX7-NEXT: v_add_f32_e32 v4, v4, v10
4698 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, 16, v4
4699 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, v7, v4
4700 ; GFX7-NEXT: v_and_b32_e32 v5, v6, v9
4701 ; GFX7-NEXT: v_or_b32_e32 v5, v5, v4
4702 ; GFX7-NEXT: v_mov_b32_e32 v4, v5
4703 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
4704 ; GFX7-NEXT: v_mov_b32_e32 v5, v6
4705 ; GFX7-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4706 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
4707 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
4708 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
4709 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
4710 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
4711 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4712 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4713 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4714 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4715 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4716 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
4717 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
4718 ; GFX7-NEXT: s_cbranch_execnz .LBB11_4
4719 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4720 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
4721 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4722 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
4723 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4724 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
4725 ; GFX7-NEXT: buffer_wbinvl1
4726 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
4727 ; GFX7-NEXT: s_cbranch_execnz .LBB11_3
4728 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
4729 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
4730 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4731 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v0
4732 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4734 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall:
4736 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4737 ; GFX6-NEXT: v_add_i32_e32 v4, vcc, 0x200, v4
4738 ; GFX6-NEXT: v_and_b32_e32 v8, -4, v4
4739 ; GFX6-NEXT: v_and_b32_e32 v4, 3, v4
4740 ; GFX6-NEXT: v_lshlrev_b32_e32 v7, 3, v4
4741 ; GFX6-NEXT: v_lshl_b32_e32 v4, 0xffff, v7
4742 ; GFX6-NEXT: v_not_b32_e32 v9, v4
4743 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
4744 ; GFX6-NEXT: .LBB11_1: ; =>This Inner Loop Header: Depth=1
4745 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
4746 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
4747 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
4748 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
4749 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4750 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4751 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4752 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4753 ; GFX6-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
4754 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
4755 ; GFX6-NEXT: s_cbranch_execnz .LBB11_1
4756 ; GFX6-NEXT: ; %bb.2:
4757 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
4758 ; GFX6-NEXT: v_mul_f32_e32 v4, 1.0, v5
4759 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
4760 ; GFX6-NEXT: v_and_b32_e32 v10, 0xffff0000, v4
4761 ; GFX6-NEXT: .LBB11_3: ; %atomicrmw.start
4762 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
4763 ; GFX6-NEXT: ; Child Loop BB11_4 Depth 2
4764 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
4765 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, v7, v6
4766 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v4
4767 ; GFX6-NEXT: v_add_f32_e32 v4, v4, v10
4768 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, 16, v4
4769 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, v7, v4
4770 ; GFX6-NEXT: v_and_b32_e32 v5, v6, v9
4771 ; GFX6-NEXT: v_or_b32_e32 v5, v5, v4
4772 ; GFX6-NEXT: v_mov_b32_e32 v4, v5
4773 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
4774 ; GFX6-NEXT: v_mov_b32_e32 v5, v6
4775 ; GFX6-NEXT: .LBB11_4: ; Parent Loop BB11_3 Depth=1
4776 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
4777 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
4778 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
4779 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
4780 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
4781 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4782 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4783 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4784 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4785 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
4786 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
4787 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
4788 ; GFX6-NEXT: s_cbranch_execnz .LBB11_4
4789 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB11_3 Depth=1
4790 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
4791 ; GFX6-NEXT: s_waitcnt vmcnt(0)
4792 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
4793 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4794 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
4795 ; GFX6-NEXT: buffer_wbinvl1
4796 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
4797 ; GFX6-NEXT: s_cbranch_execnz .LBB11_3
4798 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
4799 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
4800 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4801 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v0
4802 ; GFX6-NEXT: s_waitcnt expcnt(0)
4803 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4804 %gep = getelementptr bfloat, ptr addrspace(7) %ptr, i32 256
4805 %result = atomicrmw fadd ptr addrspace(7) %gep, bfloat %val syncscope("agent") seq_cst
4809 ; --------------------------------------------------------------------
4811 ; --------------------------------------------------------------------
4813 define <2 x half> @buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset(ptr addrspace(7) inreg %ptr, <2 x half> %val) #0 {
4814 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
4816 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
4817 ; GFX12-NEXT: s_wait_expcnt 0x0
4818 ; GFX12-NEXT: s_wait_samplecnt 0x0
4819 ; GFX12-NEXT: s_wait_bvhcnt 0x0
4820 ; GFX12-NEXT: s_wait_kmcnt 0x0
4821 ; GFX12-NEXT: v_mov_b32_e32 v1, s6
4822 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
4823 ; GFX12-NEXT: s_wait_storecnt 0x0
4824 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
4825 ; GFX12-NEXT: s_wait_loadcnt 0x0
4826 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
4827 ; GFX12-NEXT: s_setpc_b64 s[30:31]
4829 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
4831 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4832 ; GFX940-NEXT: v_mov_b32_e32 v1, s6
4833 ; GFX940-NEXT: buffer_wbl2 sc1
4834 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], 0 offen offset:1024 sc0
4835 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4836 ; GFX940-NEXT: buffer_inv sc1
4837 ; GFX940-NEXT: s_setpc_b64 s[30:31]
4839 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
4841 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4842 ; GFX11-NEXT: s_add_i32 s4, s6, 0x400
4843 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4844 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
4845 ; GFX11-NEXT: v_mov_b32_e32 v0, s6
4846 ; GFX11-NEXT: s_mov_b32 s4, 0
4847 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
4848 ; GFX11-NEXT: .LBB12_1: ; %atomicrmw.start
4849 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
4850 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4851 ; GFX11-NEXT: v_mov_b32_e32 v5, v0
4852 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
4853 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4854 ; GFX11-NEXT: v_pk_add_f16 v4, v5, v2
4855 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
4856 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], 0 offen glc
4857 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4858 ; GFX11-NEXT: buffer_gl1_inv
4859 ; GFX11-NEXT: buffer_gl0_inv
4860 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
4861 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
4862 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4863 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
4864 ; GFX11-NEXT: s_cbranch_execnz .LBB12_1
4865 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
4866 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
4867 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4869 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
4871 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4872 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
4873 ; GFX10-NEXT: v_mov_b32_e32 v0, s18
4874 ; GFX10-NEXT: s_mov_b32 s11, s17
4875 ; GFX10-NEXT: s_mov_b32 s10, s16
4876 ; GFX10-NEXT: s_mov_b32 s9, s7
4877 ; GFX10-NEXT: s_mov_b32 s8, s6
4878 ; GFX10-NEXT: s_add_i32 s4, s18, 0x400
4879 ; GFX10-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
4880 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
4881 ; GFX10-NEXT: s_mov_b32 s4, 0
4882 ; GFX10-NEXT: .LBB12_1: ; %atomicrmw.start
4883 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
4884 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4885 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
4886 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
4887 ; GFX10-NEXT: v_pk_add_f16 v4, v5, v2
4888 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
4889 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
4890 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
4891 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4892 ; GFX10-NEXT: buffer_gl1_inv
4893 ; GFX10-NEXT: buffer_gl0_inv
4894 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
4895 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
4896 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
4897 ; GFX10-NEXT: s_cbranch_execnz .LBB12_1
4898 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
4899 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
4900 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4902 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
4904 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4905 ; GFX90A-NEXT: s_mov_b32 s11, s17
4906 ; GFX90A-NEXT: s_mov_b32 s10, s16
4907 ; GFX90A-NEXT: s_mov_b32 s9, s7
4908 ; GFX90A-NEXT: s_mov_b32 s8, s6
4909 ; GFX90A-NEXT: v_mov_b32_e32 v1, s18
4910 ; GFX90A-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[8:11], 0 offen offset:1024 glc
4911 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4912 ; GFX90A-NEXT: buffer_wbinvl1
4913 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
4915 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
4917 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4918 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
4919 ; GFX908-NEXT: s_mov_b32 s11, s17
4920 ; GFX908-NEXT: s_mov_b32 s10, s16
4921 ; GFX908-NEXT: s_mov_b32 s9, s7
4922 ; GFX908-NEXT: s_mov_b32 s8, s6
4923 ; GFX908-NEXT: v_mov_b32_e32 v0, s18
4924 ; GFX908-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
4925 ; GFX908-NEXT: s_add_i32 s6, s18, 0x400
4926 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
4927 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
4928 ; GFX908-NEXT: .LBB12_1: ; %atomicrmw.start
4929 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
4930 ; GFX908-NEXT: s_waitcnt vmcnt(0)
4931 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
4932 ; GFX908-NEXT: v_pk_add_f16 v4, v5, v2
4933 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
4934 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
4935 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
4936 ; GFX908-NEXT: s_waitcnt vmcnt(0)
4937 ; GFX908-NEXT: buffer_wbinvl1
4938 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
4939 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4940 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
4941 ; GFX908-NEXT: s_cbranch_execnz .LBB12_1
4942 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
4943 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
4944 ; GFX908-NEXT: s_setpc_b64 s[30:31]
4946 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
4948 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4949 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
4950 ; GFX8-NEXT: s_mov_b32 s11, s17
4951 ; GFX8-NEXT: s_mov_b32 s10, s16
4952 ; GFX8-NEXT: s_mov_b32 s9, s7
4953 ; GFX8-NEXT: s_mov_b32 s8, s6
4954 ; GFX8-NEXT: v_mov_b32_e32 v0, s18
4955 ; GFX8-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
4956 ; GFX8-NEXT: s_add_i32 s6, s18, 0x400
4957 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
4958 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
4959 ; GFX8-NEXT: .LBB12_1: ; %atomicrmw.start
4960 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
4961 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4962 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
4963 ; GFX8-NEXT: v_add_f16_sdwa v0, v5, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_1
4964 ; GFX8-NEXT: v_add_f16_e32 v1, v5, v2
4965 ; GFX8-NEXT: v_or_b32_e32 v4, v1, v0
4966 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
4967 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
4968 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
4969 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4970 ; GFX8-NEXT: buffer_wbinvl1
4971 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
4972 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4973 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
4974 ; GFX8-NEXT: s_cbranch_execnz .LBB12_1
4975 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
4976 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
4977 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4979 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
4981 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4982 ; GFX7-NEXT: s_mov_b32 s11, s17
4983 ; GFX7-NEXT: s_mov_b32 s10, s16
4984 ; GFX7-NEXT: s_mov_b32 s9, s7
4985 ; GFX7-NEXT: s_mov_b32 s8, s6
4986 ; GFX7-NEXT: v_mov_b32_e32 v2, s18
4987 ; GFX7-NEXT: buffer_load_dword v3, v2, s[8:11], 0 offen offset:1024
4988 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
4989 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v0
4990 ; GFX7-NEXT: s_add_i32 s6, s18, 0x400
4991 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
4992 ; GFX7-NEXT: v_cvt_f32_f16_e32 v2, v1
4993 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4994 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v3
4995 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v3
4996 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1
4997 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v4
4998 ; GFX7-NEXT: v_mov_b32_e32 v4, s6
4999 ; GFX7-NEXT: .LBB12_1: ; %atomicrmw.start
5000 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
5001 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
5002 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
5003 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v1
5004 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v0
5005 ; GFX7-NEXT: v_lshlrev_b32_e32 v1, 16, v1
5006 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v2
5007 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v3
5008 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v5
5009 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v6
5010 ; GFX7-NEXT: v_or_b32_e32 v6, v0, v1
5011 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v5
5012 ; GFX7-NEXT: v_or_b32_e32 v5, v7, v0
5013 ; GFX7-NEXT: v_mov_b32_e32 v8, v6
5014 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
5015 ; GFX7-NEXT: buffer_atomic_cmpswap v[7:8], v4, s[8:11], 0 offen glc
5016 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5017 ; GFX7-NEXT: buffer_wbinvl1
5018 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v7
5019 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v7
5020 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1
5021 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
5022 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5023 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
5024 ; GFX7-NEXT: s_cbranch_execnz .LBB12_1
5025 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
5026 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
5027 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5029 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
5031 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5032 ; GFX6-NEXT: s_mov_b32 s11, s17
5033 ; GFX6-NEXT: s_mov_b32 s10, s16
5034 ; GFX6-NEXT: s_mov_b32 s9, s7
5035 ; GFX6-NEXT: s_mov_b32 s8, s6
5036 ; GFX6-NEXT: v_mov_b32_e32 v2, s18
5037 ; GFX6-NEXT: buffer_load_dword v3, v2, s[8:11], 0 offen offset:1024
5038 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
5039 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v0
5040 ; GFX6-NEXT: s_add_i32 s6, s18, 0x400
5041 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
5042 ; GFX6-NEXT: v_cvt_f32_f16_e32 v2, v1
5043 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5044 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v3
5045 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v3
5046 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v1
5047 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v4
5048 ; GFX6-NEXT: v_mov_b32_e32 v4, s6
5049 ; GFX6-NEXT: .LBB12_1: ; %atomicrmw.start
5050 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
5051 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
5052 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
5053 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v1
5054 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v0
5055 ; GFX6-NEXT: v_lshlrev_b32_e32 v1, 16, v1
5056 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v2
5057 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v3
5058 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v5
5059 ; GFX6-NEXT: s_waitcnt expcnt(0)
5060 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v6
5061 ; GFX6-NEXT: v_or_b32_e32 v6, v0, v1
5062 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v5
5063 ; GFX6-NEXT: v_or_b32_e32 v5, v7, v0
5064 ; GFX6-NEXT: v_mov_b32_e32 v8, v6
5065 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
5066 ; GFX6-NEXT: buffer_atomic_cmpswap v[7:8], v4, s[8:11], 0 offen glc
5067 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5068 ; GFX6-NEXT: buffer_wbinvl1
5069 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v7
5070 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v7
5071 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v1
5072 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
5073 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5074 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
5075 ; GFX6-NEXT: s_cbranch_execnz .LBB12_1
5076 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
5077 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
5078 ; GFX6-NEXT: s_waitcnt expcnt(0)
5079 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5080 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
5081 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst
5082 ret <2 x half> %result
5085 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset(ptr addrspace(7) inreg %ptr, <2 x half> %val) #0 {
5086 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5088 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
5089 ; GFX12-NEXT: s_wait_expcnt 0x0
5090 ; GFX12-NEXT: s_wait_samplecnt 0x0
5091 ; GFX12-NEXT: s_wait_bvhcnt 0x0
5092 ; GFX12-NEXT: s_wait_kmcnt 0x0
5093 ; GFX12-NEXT: v_mov_b32_e32 v1, s6
5094 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
5095 ; GFX12-NEXT: s_wait_storecnt 0x0
5096 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], null offen offset:1024
5097 ; GFX12-NEXT: s_wait_storecnt 0x0
5098 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
5099 ; GFX12-NEXT: s_setpc_b64 s[30:31]
5101 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5103 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5104 ; GFX940-NEXT: v_mov_b32_e32 v1, s6
5105 ; GFX940-NEXT: buffer_wbl2 sc1
5106 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], 0 offen offset:1024
5107 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5108 ; GFX940-NEXT: buffer_inv sc1
5109 ; GFX940-NEXT: s_setpc_b64 s[30:31]
5111 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5113 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5114 ; GFX11-NEXT: v_mov_b32_e32 v1, s6
5115 ; GFX11-NEXT: s_add_i32 s4, s6, 0x400
5116 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
5117 ; GFX11-NEXT: v_mov_b32_e32 v3, s4
5118 ; GFX11-NEXT: s_mov_b32 s4, 0
5119 ; GFX11-NEXT: buffer_load_b32 v2, v1, s[0:3], 0 offen offset:1024
5120 ; GFX11-NEXT: .LBB13_1: ; %atomicrmw.start
5121 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
5122 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5123 ; GFX11-NEXT: v_pk_add_f16 v1, v2, v0
5124 ; GFX11-NEXT: v_mov_b32_e32 v5, v2
5125 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
5126 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
5127 ; GFX11-NEXT: v_mov_b32_e32 v4, v1
5128 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v3, s[0:3], 0 offen glc
5129 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5130 ; GFX11-NEXT: buffer_gl1_inv
5131 ; GFX11-NEXT: buffer_gl0_inv
5132 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
5133 ; GFX11-NEXT: v_mov_b32_e32 v2, v4
5134 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
5135 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
5136 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
5137 ; GFX11-NEXT: s_cbranch_execnz .LBB13_1
5138 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
5139 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
5140 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5142 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5144 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5145 ; GFX10-NEXT: v_mov_b32_e32 v1, s18
5146 ; GFX10-NEXT: s_mov_b32 s11, s17
5147 ; GFX10-NEXT: s_mov_b32 s10, s16
5148 ; GFX10-NEXT: s_mov_b32 s9, s7
5149 ; GFX10-NEXT: s_mov_b32 s8, s6
5150 ; GFX10-NEXT: s_add_i32 s4, s18, 0x400
5151 ; GFX10-NEXT: buffer_load_dword v2, v1, s[8:11], 0 offen offset:1024
5152 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
5153 ; GFX10-NEXT: s_mov_b32 s4, 0
5154 ; GFX10-NEXT: .LBB13_1: ; %atomicrmw.start
5155 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
5156 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5157 ; GFX10-NEXT: v_pk_add_f16 v1, v2, v0
5158 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
5159 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
5160 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
5161 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
5162 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5163 ; GFX10-NEXT: buffer_gl1_inv
5164 ; GFX10-NEXT: buffer_gl0_inv
5165 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
5166 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
5167 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
5168 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
5169 ; GFX10-NEXT: s_cbranch_execnz .LBB13_1
5170 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
5171 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
5172 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5174 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5176 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5177 ; GFX90A-NEXT: s_mov_b32 s11, s17
5178 ; GFX90A-NEXT: s_mov_b32 s10, s16
5179 ; GFX90A-NEXT: s_mov_b32 s9, s7
5180 ; GFX90A-NEXT: s_mov_b32 s8, s6
5181 ; GFX90A-NEXT: v_mov_b32_e32 v1, s18
5182 ; GFX90A-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[8:11], 0 offen offset:1024
5183 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
5184 ; GFX90A-NEXT: buffer_wbinvl1
5185 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
5187 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5189 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5190 ; GFX908-NEXT: s_mov_b32 s11, s17
5191 ; GFX908-NEXT: s_mov_b32 s10, s16
5192 ; GFX908-NEXT: s_mov_b32 s9, s7
5193 ; GFX908-NEXT: s_mov_b32 s8, s6
5194 ; GFX908-NEXT: v_mov_b32_e32 v1, s18
5195 ; GFX908-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[8:11], 0 offen offset:1024
5196 ; GFX908-NEXT: s_waitcnt vmcnt(0)
5197 ; GFX908-NEXT: buffer_wbinvl1
5198 ; GFX908-NEXT: s_setpc_b64 s[30:31]
5200 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5202 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5203 ; GFX8-NEXT: s_mov_b32 s11, s17
5204 ; GFX8-NEXT: s_mov_b32 s10, s16
5205 ; GFX8-NEXT: s_mov_b32 s9, s7
5206 ; GFX8-NEXT: s_mov_b32 s8, s6
5207 ; GFX8-NEXT: v_mov_b32_e32 v1, s18
5208 ; GFX8-NEXT: buffer_load_dword v2, v1, s[8:11], 0 offen offset:1024
5209 ; GFX8-NEXT: s_add_i32 s6, s18, 0x400
5210 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
5211 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
5212 ; GFX8-NEXT: .LBB13_1: ; %atomicrmw.start
5213 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
5214 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5215 ; GFX8-NEXT: v_add_f16_sdwa v1, v2, v0 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_1
5216 ; GFX8-NEXT: v_add_f16_e32 v4, v2, v0
5217 ; GFX8-NEXT: v_or_b32_e32 v1, v4, v1
5218 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
5219 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
5220 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[8:11], 0 offen glc
5221 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5222 ; GFX8-NEXT: buffer_wbinvl1
5223 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
5224 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5225 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
5226 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
5227 ; GFX8-NEXT: s_cbranch_execnz .LBB13_1
5228 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
5229 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
5230 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5232 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5234 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5235 ; GFX7-NEXT: s_mov_b32 s11, s17
5236 ; GFX7-NEXT: s_mov_b32 s10, s16
5237 ; GFX7-NEXT: s_mov_b32 s9, s7
5238 ; GFX7-NEXT: s_mov_b32 s8, s6
5239 ; GFX7-NEXT: v_mov_b32_e32 v2, s18
5240 ; GFX7-NEXT: buffer_load_dword v2, v2, s[8:11], 0 offen offset:1024
5241 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
5242 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v0
5243 ; GFX7-NEXT: s_add_i32 s6, s18, 0x400
5244 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
5245 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v1
5246 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5247 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v2
5248 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v2
5249 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v1
5250 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v5
5251 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
5252 ; GFX7-NEXT: .LBB13_1: ; %atomicrmw.start
5253 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
5254 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v4
5255 ; GFX7-NEXT: v_cvt_f16_f32_e32 v3, v3
5256 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v4
5257 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v3
5258 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v4
5259 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
5260 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
5261 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v5
5262 ; GFX7-NEXT: v_cvt_f16_f32_e32 v6, v6
5263 ; GFX7-NEXT: v_or_b32_e32 v5, v3, v4
5264 ; GFX7-NEXT: v_lshlrev_b32_e32 v3, 16, v7
5265 ; GFX7-NEXT: v_or_b32_e32 v4, v6, v3
5266 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
5267 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
5268 ; GFX7-NEXT: buffer_atomic_cmpswap v[6:7], v2, s[8:11], 0 offen glc
5269 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5270 ; GFX7-NEXT: buffer_wbinvl1
5271 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, 16, v6
5272 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v6
5273 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v4
5274 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
5275 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5276 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
5277 ; GFX7-NEXT: s_cbranch_execnz .LBB13_1
5278 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
5279 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
5280 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5282 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
5284 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5285 ; GFX6-NEXT: s_mov_b32 s11, s17
5286 ; GFX6-NEXT: s_mov_b32 s10, s16
5287 ; GFX6-NEXT: s_mov_b32 s9, s7
5288 ; GFX6-NEXT: s_mov_b32 s8, s6
5289 ; GFX6-NEXT: v_mov_b32_e32 v2, s18
5290 ; GFX6-NEXT: buffer_load_dword v2, v2, s[8:11], 0 offen offset:1024
5291 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
5292 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v0
5293 ; GFX6-NEXT: s_add_i32 s6, s18, 0x400
5294 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
5295 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v1
5296 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5297 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v2
5298 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v2
5299 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v1
5300 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v5
5301 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
5302 ; GFX6-NEXT: .LBB13_1: ; %atomicrmw.start
5303 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
5304 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v4
5305 ; GFX6-NEXT: v_cvt_f16_f32_e32 v3, v3
5306 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v4
5307 ; GFX6-NEXT: s_waitcnt expcnt(0)
5308 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v3
5309 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v4
5310 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
5311 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
5312 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v5
5313 ; GFX6-NEXT: v_cvt_f16_f32_e32 v6, v6
5314 ; GFX6-NEXT: v_or_b32_e32 v5, v3, v4
5315 ; GFX6-NEXT: v_lshlrev_b32_e32 v3, 16, v7
5316 ; GFX6-NEXT: v_or_b32_e32 v4, v6, v3
5317 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
5318 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
5319 ; GFX6-NEXT: buffer_atomic_cmpswap v[6:7], v2, s[8:11], 0 offen glc
5320 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5321 ; GFX6-NEXT: buffer_wbinvl1
5322 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, 16, v6
5323 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v6
5324 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v4
5325 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
5326 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5327 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
5328 ; GFX6-NEXT: s_cbranch_execnz .LBB13_1
5329 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
5330 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
5331 ; GFX6-NEXT: s_waitcnt expcnt(0)
5332 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5333 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
5334 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst
5338 define <2 x half> @buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall(ptr addrspace(7) %ptr, <2 x half> %val) #0 {
5339 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5341 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
5342 ; GFX12-NEXT: s_wait_expcnt 0x0
5343 ; GFX12-NEXT: s_wait_samplecnt 0x0
5344 ; GFX12-NEXT: s_wait_bvhcnt 0x0
5345 ; GFX12-NEXT: s_wait_kmcnt 0x0
5346 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
5347 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
5348 ; GFX12-NEXT: s_wait_storecnt 0x0
5349 ; GFX12-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5350 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
5351 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
5352 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
5353 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
5354 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
5355 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
5356 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
5357 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
5358 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
5359 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
5360 ; GFX12-NEXT: s_wait_loadcnt 0x0
5361 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v5, v4, s[4:7], null offen offset:1024 th:TH_ATOMIC_RETURN
5362 ; GFX12-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
5363 ; GFX12-NEXT: ; implicit-def: $vgpr4
5364 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
5365 ; GFX12-NEXT: s_cbranch_execnz .LBB14_1
5366 ; GFX12-NEXT: ; %bb.2:
5367 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
5368 ; GFX12-NEXT: s_wait_loadcnt 0x0
5369 ; GFX12-NEXT: v_mov_b32_e32 v0, v5
5370 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
5371 ; GFX12-NEXT: s_setpc_b64 s[30:31]
5373 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5375 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5376 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
5377 ; GFX940-NEXT: buffer_wbl2 sc1
5378 ; GFX940-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5379 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
5380 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
5381 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
5382 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
5383 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
5384 ; GFX940-NEXT: s_nop 0
5385 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
5386 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
5387 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
5388 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5389 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v5, v4, s[4:7], 0 offen offset:1024 sc0
5390 ; GFX940-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
5391 ; GFX940-NEXT: ; implicit-def: $vgpr4
5392 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
5393 ; GFX940-NEXT: s_cbranch_execnz .LBB14_1
5394 ; GFX940-NEXT: ; %bb.2:
5395 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
5396 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5397 ; GFX940-NEXT: v_mov_b32_e32 v0, v5
5398 ; GFX940-NEXT: buffer_inv sc1
5399 ; GFX940-NEXT: s_setpc_b64 s[30:31]
5401 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5403 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5404 ; GFX11-NEXT: v_add_nc_u32_e32 v9, 0x400, v4
5405 ; GFX11-NEXT: s_mov_b32 s1, 0
5406 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
5407 ; GFX11-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5408 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
5409 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
5410 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
5411 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
5412 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
5413 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
5414 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
5415 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
5416 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
5417 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
5418 ; GFX11-NEXT: buffer_load_b32 v8, v4, s[4:7], 0 offen offset:1024
5419 ; GFX11-NEXT: ; implicit-def: $vgpr4
5420 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
5421 ; GFX11-NEXT: s_cbranch_execnz .LBB14_1
5422 ; GFX11-NEXT: ; %bb.2:
5423 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
5424 ; GFX11-NEXT: .p2align 6
5425 ; GFX11-NEXT: .LBB14_3: ; %atomicrmw.start
5426 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
5427 ; GFX11-NEXT: ; Child Loop BB14_4 Depth 2
5428 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5429 ; GFX11-NEXT: v_pk_add_f16 v7, v8, v5
5430 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
5431 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
5432 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
5433 ; GFX11-NEXT: v_mov_b32_e32 v6, v7
5434 ; GFX11-NEXT: v_mov_b32_e32 v7, v8
5435 ; GFX11-NEXT: .LBB14_4: ; Parent Loop BB14_3 Depth=1
5436 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
5437 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
5438 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
5439 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
5440 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
5441 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
5442 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
5443 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
5444 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
5445 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
5446 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
5447 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5448 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[6:7], v9, s[4:7], 0 offen glc
5449 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
5450 ; GFX11-NEXT: s_cbranch_execnz .LBB14_4
5451 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB14_3 Depth=1
5452 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
5453 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5454 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v6, v8
5455 ; GFX11-NEXT: v_mov_b32_e32 v8, v6
5456 ; GFX11-NEXT: buffer_gl1_inv
5457 ; GFX11-NEXT: buffer_gl0_inv
5458 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
5459 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
5460 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
5461 ; GFX11-NEXT: s_cbranch_execnz .LBB14_3
5462 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
5463 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
5464 ; GFX11-NEXT: v_mov_b32_e32 v0, v6
5465 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5467 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5469 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5470 ; GFX10-NEXT: v_add_nc_u32_e32 v9, 0x400, v4
5471 ; GFX10-NEXT: s_mov_b32 s5, 0
5472 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
5473 ; GFX10-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5474 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
5475 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
5476 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
5477 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
5478 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
5479 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
5480 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
5481 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
5482 ; GFX10-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
5483 ; GFX10-NEXT: ; implicit-def: $vgpr4
5484 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
5485 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
5486 ; GFX10-NEXT: s_cbranch_execnz .LBB14_1
5487 ; GFX10-NEXT: ; %bb.2:
5488 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
5489 ; GFX10-NEXT: .LBB14_3: ; %atomicrmw.start
5490 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
5491 ; GFX10-NEXT: ; Child Loop BB14_4 Depth 2
5492 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5493 ; GFX10-NEXT: v_pk_add_f16 v7, v8, v5
5494 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
5495 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
5496 ; GFX10-NEXT: v_mov_b32_e32 v6, v7
5497 ; GFX10-NEXT: v_mov_b32_e32 v7, v8
5498 ; GFX10-NEXT: .LBB14_4: ; Parent Loop BB14_3 Depth=1
5499 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
5500 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
5501 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
5502 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
5503 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
5504 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
5505 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
5506 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
5507 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
5508 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5509 ; GFX10-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
5510 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
5511 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
5512 ; GFX10-NEXT: s_cbranch_execnz .LBB14_4
5513 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB14_3 Depth=1
5514 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
5515 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5516 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v6, v8
5517 ; GFX10-NEXT: v_mov_b32_e32 v8, v6
5518 ; GFX10-NEXT: buffer_gl1_inv
5519 ; GFX10-NEXT: buffer_gl0_inv
5520 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
5521 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
5522 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
5523 ; GFX10-NEXT: s_cbranch_execnz .LBB14_3
5524 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
5525 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
5526 ; GFX10-NEXT: v_mov_b32_e32 v0, v6
5527 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5529 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5531 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5532 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
5533 ; GFX90A-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5534 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
5535 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
5536 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
5537 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
5538 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5539 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5540 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5541 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5542 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
5543 ; GFX90A-NEXT: buffer_atomic_pk_add_f16 v5, v4, s[8:11], 0 offen offset:1024 glc
5544 ; GFX90A-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
5545 ; GFX90A-NEXT: ; implicit-def: $vgpr4
5546 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
5547 ; GFX90A-NEXT: s_cbranch_execnz .LBB14_1
5548 ; GFX90A-NEXT: ; %bb.2:
5549 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
5550 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
5551 ; GFX90A-NEXT: v_mov_b32_e32 v0, v5
5552 ; GFX90A-NEXT: buffer_wbinvl1
5553 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
5555 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5557 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5558 ; GFX908-NEXT: v_add_u32_e32 v9, 0x400, v4
5559 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
5560 ; GFX908-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5561 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
5562 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
5563 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
5564 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
5565 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5566 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5567 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5568 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5569 ; GFX908-NEXT: s_nop 0
5570 ; GFX908-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
5571 ; GFX908-NEXT: ; implicit-def: $vgpr4
5572 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
5573 ; GFX908-NEXT: s_cbranch_execnz .LBB14_1
5574 ; GFX908-NEXT: ; %bb.2:
5575 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
5576 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
5577 ; GFX908-NEXT: .LBB14_3: ; %atomicrmw.start
5578 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
5579 ; GFX908-NEXT: ; Child Loop BB14_4 Depth 2
5580 ; GFX908-NEXT: s_waitcnt vmcnt(0)
5581 ; GFX908-NEXT: v_pk_add_f16 v7, v8, v5
5582 ; GFX908-NEXT: v_mov_b32_e32 v6, v7
5583 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
5584 ; GFX908-NEXT: v_mov_b32_e32 v7, v8
5585 ; GFX908-NEXT: .LBB14_4: ; Parent Loop BB14_3 Depth=1
5586 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
5587 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
5588 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
5589 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
5590 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
5591 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5592 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5593 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5594 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5595 ; GFX908-NEXT: s_waitcnt vmcnt(0)
5596 ; GFX908-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
5597 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
5598 ; GFX908-NEXT: s_cbranch_execnz .LBB14_4
5599 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB14_3 Depth=1
5600 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
5601 ; GFX908-NEXT: s_waitcnt vmcnt(0)
5602 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
5603 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
5604 ; GFX908-NEXT: v_mov_b32_e32 v8, v6
5605 ; GFX908-NEXT: buffer_wbinvl1
5606 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
5607 ; GFX908-NEXT: s_cbranch_execnz .LBB14_3
5608 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
5609 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
5610 ; GFX908-NEXT: v_mov_b32_e32 v0, v6
5611 ; GFX908-NEXT: s_setpc_b64 s[30:31]
5613 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5615 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5616 ; GFX8-NEXT: v_add_u32_e32 v9, vcc, 0x400, v4
5617 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
5618 ; GFX8-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5619 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
5620 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
5621 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
5622 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
5623 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5624 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5625 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5626 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5627 ; GFX8-NEXT: s_nop 0
5628 ; GFX8-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
5629 ; GFX8-NEXT: ; implicit-def: $vgpr4
5630 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
5631 ; GFX8-NEXT: s_cbranch_execnz .LBB14_1
5632 ; GFX8-NEXT: ; %bb.2:
5633 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
5634 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
5635 ; GFX8-NEXT: .LBB14_3: ; %atomicrmw.start
5636 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
5637 ; GFX8-NEXT: ; Child Loop BB14_4 Depth 2
5638 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5639 ; GFX8-NEXT: v_add_f16_sdwa v4, v8, v5 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_1
5640 ; GFX8-NEXT: v_add_f16_e32 v6, v8, v5
5641 ; GFX8-NEXT: v_or_b32_e32 v7, v6, v4
5642 ; GFX8-NEXT: v_mov_b32_e32 v6, v7
5643 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
5644 ; GFX8-NEXT: v_mov_b32_e32 v7, v8
5645 ; GFX8-NEXT: .LBB14_4: ; Parent Loop BB14_3 Depth=1
5646 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
5647 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
5648 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
5649 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
5650 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
5651 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5652 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5653 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5654 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5655 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5656 ; GFX8-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
5657 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
5658 ; GFX8-NEXT: s_cbranch_execnz .LBB14_4
5659 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB14_3 Depth=1
5660 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
5661 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5662 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
5663 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
5664 ; GFX8-NEXT: v_mov_b32_e32 v8, v6
5665 ; GFX8-NEXT: buffer_wbinvl1
5666 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
5667 ; GFX8-NEXT: s_cbranch_execnz .LBB14_3
5668 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
5669 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
5670 ; GFX8-NEXT: v_mov_b32_e32 v0, v6
5671 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5673 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5675 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5676 ; GFX7-NEXT: v_add_i32_e32 v9, vcc, 0x400, v4
5677 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
5678 ; GFX7-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5679 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
5680 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
5681 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
5682 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
5683 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5684 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5685 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5686 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5687 ; GFX7-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
5688 ; GFX7-NEXT: ; implicit-def: $vgpr4
5689 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
5690 ; GFX7-NEXT: s_cbranch_execnz .LBB14_1
5691 ; GFX7-NEXT: ; %bb.2:
5692 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
5693 ; GFX7-NEXT: v_cvt_f16_f32_e32 v6, v6
5694 ; GFX7-NEXT: v_cvt_f16_f32_e32 v8, v5
5695 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5696 ; GFX7-NEXT: v_lshrrev_b32_e32 v5, 16, v7
5697 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v7
5698 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v5
5699 ; GFX7-NEXT: v_cvt_f32_f16_e32 v10, v6
5700 ; GFX7-NEXT: v_cvt_f32_f16_e32 v11, v8
5701 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
5702 ; GFX7-NEXT: .LBB14_3: ; %atomicrmw.start
5703 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
5704 ; GFX7-NEXT: ; Child Loop BB14_4 Depth 2
5705 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v5
5706 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v4
5707 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
5708 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v5
5709 ; GFX7-NEXT: v_cvt_f32_f16_e32 v7, v4
5710 ; GFX7-NEXT: v_lshlrev_b32_e32 v5, 16, v5
5711 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v10
5712 ; GFX7-NEXT: v_add_f32_e32 v7, v7, v11
5713 ; GFX7-NEXT: v_cvt_f16_f32_e32 v8, v6
5714 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v7
5715 ; GFX7-NEXT: v_or_b32_e32 v6, v4, v5
5716 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v8
5717 ; GFX7-NEXT: v_or_b32_e32 v5, v7, v4
5718 ; GFX7-NEXT: v_mov_b32_e32 v8, v6
5719 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
5720 ; GFX7-NEXT: .LBB14_4: ; Parent Loop BB14_3 Depth=1
5721 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
5722 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
5723 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
5724 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
5725 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
5726 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5727 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5728 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5729 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5730 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5731 ; GFX7-NEXT: buffer_atomic_cmpswap v[7:8], v9, s[8:11], 0 offen glc
5732 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
5733 ; GFX7-NEXT: s_cbranch_execnz .LBB14_4
5734 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB14_3 Depth=1
5735 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
5736 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5737 ; GFX7-NEXT: v_lshrrev_b32_e32 v5, 16, v7
5738 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v7
5739 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v5
5740 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
5741 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
5742 ; GFX7-NEXT: buffer_wbinvl1
5743 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
5744 ; GFX7-NEXT: s_cbranch_execnz .LBB14_3
5745 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
5746 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
5747 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
5748 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
5749 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5751 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall:
5753 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5754 ; GFX6-NEXT: v_add_i32_e32 v9, vcc, 0x400, v4
5755 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
5756 ; GFX6-NEXT: .LBB14_1: ; =>This Inner Loop Header: Depth=1
5757 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
5758 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
5759 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
5760 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
5761 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5762 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5763 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5764 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5765 ; GFX6-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
5766 ; GFX6-NEXT: ; implicit-def: $vgpr4
5767 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
5768 ; GFX6-NEXT: s_cbranch_execnz .LBB14_1
5769 ; GFX6-NEXT: ; %bb.2:
5770 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
5771 ; GFX6-NEXT: v_cvt_f16_f32_e32 v6, v6
5772 ; GFX6-NEXT: v_cvt_f16_f32_e32 v8, v5
5773 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5774 ; GFX6-NEXT: v_lshrrev_b32_e32 v5, 16, v7
5775 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v7
5776 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v5
5777 ; GFX6-NEXT: v_cvt_f32_f16_e32 v10, v6
5778 ; GFX6-NEXT: v_cvt_f32_f16_e32 v11, v8
5779 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
5780 ; GFX6-NEXT: .LBB14_3: ; %atomicrmw.start
5781 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
5782 ; GFX6-NEXT: ; Child Loop BB14_4 Depth 2
5783 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v5
5784 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v4
5785 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
5786 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v5
5787 ; GFX6-NEXT: s_waitcnt expcnt(0)
5788 ; GFX6-NEXT: v_cvt_f32_f16_e32 v7, v4
5789 ; GFX6-NEXT: v_lshlrev_b32_e32 v5, 16, v5
5790 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v10
5791 ; GFX6-NEXT: v_add_f32_e32 v7, v7, v11
5792 ; GFX6-NEXT: v_cvt_f16_f32_e32 v8, v6
5793 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v7
5794 ; GFX6-NEXT: v_or_b32_e32 v6, v4, v5
5795 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v8
5796 ; GFX6-NEXT: v_or_b32_e32 v5, v7, v4
5797 ; GFX6-NEXT: v_mov_b32_e32 v8, v6
5798 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
5799 ; GFX6-NEXT: .LBB14_4: ; Parent Loop BB14_3 Depth=1
5800 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
5801 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
5802 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
5803 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
5804 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
5805 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5806 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5807 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5808 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5809 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
5810 ; GFX6-NEXT: buffer_atomic_cmpswap v[7:8], v9, s[8:11], 0 offen glc
5811 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
5812 ; GFX6-NEXT: s_cbranch_execnz .LBB14_4
5813 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB14_3 Depth=1
5814 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
5815 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5816 ; GFX6-NEXT: v_lshrrev_b32_e32 v5, 16, v7
5817 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v7
5818 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v5
5819 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
5820 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
5821 ; GFX6-NEXT: buffer_wbinvl1
5822 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
5823 ; GFX6-NEXT: s_cbranch_execnz .LBB14_3
5824 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
5825 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
5826 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
5827 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
5828 ; GFX6-NEXT: s_waitcnt expcnt(0)
5829 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5830 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
5831 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst
5832 ret <2 x half> %result
5835 ; --------------------------------------------------------------------
5837 ; --------------------------------------------------------------------
5839 define <2 x bfloat> @buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) #0 {
5840 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
5842 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
5843 ; GFX12-NEXT: s_wait_expcnt 0x0
5844 ; GFX12-NEXT: s_wait_samplecnt 0x0
5845 ; GFX12-NEXT: s_wait_bvhcnt 0x0
5846 ; GFX12-NEXT: s_wait_kmcnt 0x0
5847 ; GFX12-NEXT: v_mov_b32_e32 v1, s6
5848 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
5849 ; GFX12-NEXT: s_wait_storecnt 0x0
5850 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
5851 ; GFX12-NEXT: s_wait_loadcnt 0x0
5852 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
5853 ; GFX12-NEXT: s_setpc_b64 s[30:31]
5855 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
5857 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5858 ; GFX940-NEXT: v_mov_b32_e32 v1, v0
5859 ; GFX940-NEXT: v_mov_b32_e32 v0, s6
5860 ; GFX940-NEXT: buffer_load_dword v0, v0, s[0:3], 0 offen offset:1024
5861 ; GFX940-NEXT: s_add_i32 s4, s6, 0x400
5862 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
5863 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v1
5864 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
5865 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
5866 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
5867 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
5868 ; GFX940-NEXT: .LBB15_1: ; %atomicrmw.start
5869 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
5870 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5871 ; GFX940-NEXT: v_mov_b32_e32 v7, v0
5872 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v7
5873 ; GFX940-NEXT: v_and_b32_e32 v1, 0xffff0000, v7
5874 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
5875 ; GFX940-NEXT: v_add_f32_e32 v1, v1, v3
5876 ; GFX940-NEXT: v_bfe_u32 v5, v0, 16, 1
5877 ; GFX940-NEXT: v_bfe_u32 v8, v1, 16, 1
5878 ; GFX940-NEXT: v_or_b32_e32 v6, 0x400000, v0
5879 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v1
5880 ; GFX940-NEXT: v_add3_u32 v5, v5, v0, s8
5881 ; GFX940-NEXT: v_add3_u32 v8, v8, v1, s8
5882 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
5883 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
5884 ; GFX940-NEXT: buffer_wbl2 sc1
5885 ; GFX940-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
5886 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v5, v6, s[4:5]
5887 ; GFX940-NEXT: v_perm_b32 v6, v1, v0, s9
5888 ; GFX940-NEXT: v_mov_b64_e32 v[0:1], v[6:7]
5889 ; GFX940-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[0:3], 0 offen sc0
5890 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5891 ; GFX940-NEXT: buffer_inv sc1
5892 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v0, v7
5893 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
5894 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
5895 ; GFX940-NEXT: s_cbranch_execnz .LBB15_1
5896 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
5897 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
5898 ; GFX940-NEXT: s_setpc_b64 s[30:31]
5900 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
5902 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5903 ; GFX11-NEXT: v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v0, s6
5904 ; GFX11-NEXT: s_add_i32 s4, s6, 0x400
5905 ; GFX11-NEXT: s_mov_b32 s5, 0
5906 ; GFX11-NEXT: v_mov_b32_e32 v4, s4
5907 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
5908 ; GFX11-NEXT: v_lshlrev_b32_e32 v2, 16, v1
5909 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
5910 ; GFX11-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
5911 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
5912 ; GFX11-NEXT: .p2align 6
5913 ; GFX11-NEXT: .LBB15_1: ; %atomicrmw.start
5914 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
5915 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5916 ; GFX11-NEXT: v_mov_b32_e32 v6, v0
5917 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
5918 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5919 ; GFX11-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
5920 ; GFX11-NEXT: v_add_f32_e32 v1, v1, v3
5921 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
5922 ; GFX11-NEXT: v_bfe_u32 v7, v1, 16, 1
5923 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v1
5924 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
5925 ; GFX11-NEXT: v_add3_u32 v7, v7, v1, 0x7fff
5926 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5927 ; GFX11-NEXT: v_dual_cndmask_b32 v1, v7, v9 :: v_dual_lshlrev_b32 v0, 16, v6
5928 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
5929 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
5930 ; GFX11-NEXT: v_bfe_u32 v5, v0, 16, 1
5931 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
5932 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
5933 ; GFX11-NEXT: v_add3_u32 v5, v5, v0, 0x7fff
5934 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5935 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v5, v8, s4
5936 ; GFX11-NEXT: v_perm_b32 v5, v1, v0, 0x7060302
5937 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
5938 ; GFX11-NEXT: v_dual_mov_b32 v0, v5 :: v_dual_mov_b32 v1, v6
5939 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v4, s[0:3], 0 offen glc
5940 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5941 ; GFX11-NEXT: buffer_gl1_inv
5942 ; GFX11-NEXT: buffer_gl0_inv
5943 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v6
5944 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
5945 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
5946 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
5947 ; GFX11-NEXT: s_cbranch_execnz .LBB15_1
5948 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
5949 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
5950 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
5951 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5953 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
5955 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5956 ; GFX10-NEXT: v_mov_b32_e32 v1, v0
5957 ; GFX10-NEXT: v_mov_b32_e32 v0, s18
5958 ; GFX10-NEXT: s_mov_b32 s11, s17
5959 ; GFX10-NEXT: s_mov_b32 s10, s16
5960 ; GFX10-NEXT: s_mov_b32 s9, s7
5961 ; GFX10-NEXT: s_mov_b32 s8, s6
5962 ; GFX10-NEXT: s_add_i32 s4, s18, 0x400
5963 ; GFX10-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
5964 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v1
5965 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
5966 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
5967 ; GFX10-NEXT: s_mov_b32 s5, 0
5968 ; GFX10-NEXT: .LBB15_1: ; %atomicrmw.start
5969 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
5970 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5971 ; GFX10-NEXT: v_mov_b32_e32 v6, v0
5972 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
5973 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v6
5974 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
5975 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
5976 ; GFX10-NEXT: v_add_f32_e32 v1, v1, v3
5977 ; GFX10-NEXT: v_bfe_u32 v5, v0, 16, 1
5978 ; GFX10-NEXT: v_bfe_u32 v7, v1, 16, 1
5979 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
5980 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v1
5981 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
5982 ; GFX10-NEXT: v_add3_u32 v5, v5, v0, 0x7fff
5983 ; GFX10-NEXT: v_add3_u32 v7, v7, v1, 0x7fff
5984 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
5985 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v7, v9, vcc_lo
5986 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v5, v8, s4
5987 ; GFX10-NEXT: v_perm_b32 v5, v1, v0, 0x7060302
5988 ; GFX10-NEXT: v_mov_b32_e32 v0, v5
5989 ; GFX10-NEXT: v_mov_b32_e32 v1, v6
5990 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[8:11], 0 offen glc
5991 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5992 ; GFX10-NEXT: buffer_gl1_inv
5993 ; GFX10-NEXT: buffer_gl0_inv
5994 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v6
5995 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
5996 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
5997 ; GFX10-NEXT: s_cbranch_execnz .LBB15_1
5998 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
5999 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
6000 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6002 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
6004 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6005 ; GFX90A-NEXT: v_mov_b32_e32 v1, v0
6006 ; GFX90A-NEXT: s_mov_b32 s11, s17
6007 ; GFX90A-NEXT: s_mov_b32 s10, s16
6008 ; GFX90A-NEXT: s_mov_b32 s9, s7
6009 ; GFX90A-NEXT: s_mov_b32 s8, s6
6010 ; GFX90A-NEXT: v_mov_b32_e32 v0, s18
6011 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
6012 ; GFX90A-NEXT: s_add_i32 s4, s18, 0x400
6013 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
6014 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v1
6015 ; GFX90A-NEXT: s_movk_i32 s12, 0x7fff
6016 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
6017 ; GFX90A-NEXT: s_mov_b32 s13, 0x7060302
6018 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
6019 ; GFX90A-NEXT: .LBB15_1: ; %atomicrmw.start
6020 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
6021 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6022 ; GFX90A-NEXT: v_mov_b32_e32 v7, v0
6023 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v7
6024 ; GFX90A-NEXT: v_and_b32_e32 v1, 0xffff0000, v7
6025 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
6026 ; GFX90A-NEXT: v_add_f32_e32 v1, v1, v3
6027 ; GFX90A-NEXT: v_bfe_u32 v5, v0, 16, 1
6028 ; GFX90A-NEXT: v_bfe_u32 v8, v1, 16, 1
6029 ; GFX90A-NEXT: v_or_b32_e32 v6, 0x400000, v0
6030 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v1
6031 ; GFX90A-NEXT: v_add3_u32 v5, v5, v0, s12
6032 ; GFX90A-NEXT: v_add3_u32 v8, v8, v1, s12
6033 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
6034 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
6035 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v5, v6, s[4:5]
6036 ; GFX90A-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
6037 ; GFX90A-NEXT: v_perm_b32 v6, v1, v0, s13
6038 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[6:7], v[6:7] op_sel:[0,1]
6039 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[8:11], 0 offen glc
6040 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6041 ; GFX90A-NEXT: buffer_wbinvl1
6042 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v7
6043 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6044 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
6045 ; GFX90A-NEXT: s_cbranch_execnz .LBB15_1
6046 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
6047 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
6048 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
6050 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
6052 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6053 ; GFX908-NEXT: v_mov_b32_e32 v1, v0
6054 ; GFX908-NEXT: s_mov_b32 s11, s17
6055 ; GFX908-NEXT: s_mov_b32 s10, s16
6056 ; GFX908-NEXT: s_mov_b32 s9, s7
6057 ; GFX908-NEXT: s_mov_b32 s8, s6
6058 ; GFX908-NEXT: v_mov_b32_e32 v0, s18
6059 ; GFX908-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
6060 ; GFX908-NEXT: s_add_i32 s4, s18, 0x400
6061 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
6062 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v1
6063 ; GFX908-NEXT: s_movk_i32 s12, 0x7fff
6064 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
6065 ; GFX908-NEXT: s_mov_b32 s13, 0x7060302
6066 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
6067 ; GFX908-NEXT: .LBB15_1: ; %atomicrmw.start
6068 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
6069 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6070 ; GFX908-NEXT: v_mov_b32_e32 v6, v0
6071 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v6
6072 ; GFX908-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
6073 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
6074 ; GFX908-NEXT: v_add_f32_e32 v1, v1, v3
6075 ; GFX908-NEXT: v_bfe_u32 v5, v0, 16, 1
6076 ; GFX908-NEXT: v_bfe_u32 v8, v1, 16, 1
6077 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
6078 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v1
6079 ; GFX908-NEXT: v_add3_u32 v5, v5, v0, s12
6080 ; GFX908-NEXT: v_add3_u32 v8, v8, v1, s12
6081 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
6082 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
6083 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v5, v7, s[4:5]
6084 ; GFX908-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
6085 ; GFX908-NEXT: v_perm_b32 v5, v1, v0, s13
6086 ; GFX908-NEXT: v_mov_b32_e32 v0, v5
6087 ; GFX908-NEXT: v_mov_b32_e32 v1, v6
6088 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[8:11], 0 offen glc
6089 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6090 ; GFX908-NEXT: buffer_wbinvl1
6091 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v6
6092 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6093 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
6094 ; GFX908-NEXT: s_cbranch_execnz .LBB15_1
6095 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
6096 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
6097 ; GFX908-NEXT: s_setpc_b64 s[30:31]
6099 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
6101 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6102 ; GFX8-NEXT: v_mov_b32_e32 v1, v0
6103 ; GFX8-NEXT: s_mov_b32 s11, s17
6104 ; GFX8-NEXT: s_mov_b32 s10, s16
6105 ; GFX8-NEXT: s_mov_b32 s9, s7
6106 ; GFX8-NEXT: s_mov_b32 s8, s6
6107 ; GFX8-NEXT: v_mov_b32_e32 v0, s18
6108 ; GFX8-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
6109 ; GFX8-NEXT: s_add_i32 s4, s18, 0x400
6110 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
6111 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v1
6112 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
6113 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
6114 ; GFX8-NEXT: .LBB15_1: ; %atomicrmw.start
6115 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
6116 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6117 ; GFX8-NEXT: v_mov_b32_e32 v6, v0
6118 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v6
6119 ; GFX8-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
6120 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
6121 ; GFX8-NEXT: v_add_f32_e32 v1, v1, v3
6122 ; GFX8-NEXT: v_bfe_u32 v5, v0, 16, 1
6123 ; GFX8-NEXT: v_bfe_u32 v8, v1, 16, 1
6124 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, v5, v0
6125 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v1
6126 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, 0x7fff, v5
6127 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
6128 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v1
6129 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
6130 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
6131 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
6132 ; GFX8-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
6133 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v5, v7, s[4:5]
6134 ; GFX8-NEXT: v_lshrrev_b32_e32 v1, 16, v1
6135 ; GFX8-NEXT: v_alignbit_b32 v5, v1, v0, 16
6136 ; GFX8-NEXT: v_mov_b32_e32 v0, v5
6137 ; GFX8-NEXT: v_mov_b32_e32 v1, v6
6138 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[8:11], 0 offen glc
6139 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6140 ; GFX8-NEXT: buffer_wbinvl1
6141 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v6
6142 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6143 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
6144 ; GFX8-NEXT: s_cbranch_execnz .LBB15_1
6145 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
6146 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
6147 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6149 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
6151 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6152 ; GFX7-NEXT: s_mov_b32 s11, s17
6153 ; GFX7-NEXT: s_mov_b32 s10, s16
6154 ; GFX7-NEXT: s_mov_b32 s9, s7
6155 ; GFX7-NEXT: s_mov_b32 s8, s6
6156 ; GFX7-NEXT: v_mov_b32_e32 v2, s18
6157 ; GFX7-NEXT: buffer_load_dword v4, v2, s[8:11], 0 offen offset:1024
6158 ; GFX7-NEXT: s_add_i32 s6, s18, 0x400
6159 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
6160 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
6161 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
6162 ; GFX7-NEXT: v_and_b32_e32 v2, 0xffff0000, v0
6163 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
6164 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6165 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v4
6166 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v4
6167 ; GFX7-NEXT: v_mov_b32_e32 v4, s6
6168 ; GFX7-NEXT: .LBB15_1: ; %atomicrmw.start
6169 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
6170 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
6171 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
6172 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v1
6173 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
6174 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
6175 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v3
6176 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v2
6177 ; GFX7-NEXT: v_alignbit_b32 v1, v1, v0, 16
6178 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v6
6179 ; GFX7-NEXT: v_alignbit_b32 v0, v0, v5, 16
6180 ; GFX7-NEXT: v_mov_b32_e32 v6, v1
6181 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
6182 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[8:11], 0 offen glc
6183 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6184 ; GFX7-NEXT: buffer_wbinvl1
6185 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
6186 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v5
6187 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6188 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v5
6189 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
6190 ; GFX7-NEXT: s_cbranch_execnz .LBB15_1
6191 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
6192 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
6193 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6195 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
6197 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6198 ; GFX6-NEXT: s_mov_b32 s11, s17
6199 ; GFX6-NEXT: s_mov_b32 s10, s16
6200 ; GFX6-NEXT: s_mov_b32 s9, s7
6201 ; GFX6-NEXT: s_mov_b32 s8, s6
6202 ; GFX6-NEXT: v_mov_b32_e32 v2, s18
6203 ; GFX6-NEXT: buffer_load_dword v4, v2, s[8:11], 0 offen offset:1024
6204 ; GFX6-NEXT: s_add_i32 s6, s18, 0x400
6205 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
6206 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
6207 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
6208 ; GFX6-NEXT: v_and_b32_e32 v2, 0xffff0000, v0
6209 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
6210 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6211 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v4
6212 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v4
6213 ; GFX6-NEXT: v_mov_b32_e32 v4, s6
6214 ; GFX6-NEXT: .LBB15_1: ; %atomicrmw.start
6215 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
6216 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
6217 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
6218 ; GFX6-NEXT: s_waitcnt expcnt(0)
6219 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v1
6220 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
6221 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v1
6222 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v3
6223 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v2
6224 ; GFX6-NEXT: v_alignbit_b32 v1, v1, v0, 16
6225 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, 16, v6
6226 ; GFX6-NEXT: v_alignbit_b32 v0, v0, v5, 16
6227 ; GFX6-NEXT: v_mov_b32_e32 v6, v1
6228 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
6229 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[8:11], 0 offen glc
6230 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6231 ; GFX6-NEXT: buffer_wbinvl1
6232 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
6233 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v5
6234 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6235 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v5
6236 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
6237 ; GFX6-NEXT: s_cbranch_execnz .LBB15_1
6238 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
6239 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
6240 ; GFX6-NEXT: s_waitcnt expcnt(0)
6241 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6242 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
6243 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst
6244 ret <2 x bfloat> %result
6247 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) #0 {
6248 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6250 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
6251 ; GFX12-NEXT: s_wait_expcnt 0x0
6252 ; GFX12-NEXT: s_wait_samplecnt 0x0
6253 ; GFX12-NEXT: s_wait_bvhcnt 0x0
6254 ; GFX12-NEXT: s_wait_kmcnt 0x0
6255 ; GFX12-NEXT: v_mov_b32_e32 v1, s6
6256 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
6257 ; GFX12-NEXT: s_wait_storecnt 0x0
6258 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024
6259 ; GFX12-NEXT: s_wait_storecnt 0x0
6260 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
6261 ; GFX12-NEXT: s_setpc_b64 s[30:31]
6263 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6265 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6266 ; GFX940-NEXT: v_mov_b32_e32 v1, s6
6267 ; GFX940-NEXT: buffer_load_dword v1, v1, s[0:3], 0 offen offset:1024
6268 ; GFX940-NEXT: s_add_i32 s4, s6, 0x400
6269 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
6270 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v0
6271 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
6272 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
6273 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
6274 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
6275 ; GFX940-NEXT: .LBB16_1: ; %atomicrmw.start
6276 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
6277 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6278 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v1
6279 ; GFX940-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
6280 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
6281 ; GFX940-NEXT: v_add_f32_e32 v5, v5, v3
6282 ; GFX940-NEXT: v_bfe_u32 v6, v0, 16, 1
6283 ; GFX940-NEXT: v_bfe_u32 v8, v5, 16, 1
6284 ; GFX940-NEXT: v_or_b32_e32 v7, 0x400000, v0
6285 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v5
6286 ; GFX940-NEXT: v_add3_u32 v6, v6, v0, s8
6287 ; GFX940-NEXT: v_add3_u32 v8, v8, v5, s8
6288 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
6289 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
6290 ; GFX940-NEXT: buffer_wbl2 sc1
6291 ; GFX940-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
6292 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
6293 ; GFX940-NEXT: v_perm_b32 v0, v5, v0, s9
6294 ; GFX940-NEXT: v_mov_b64_e32 v[6:7], v[0:1]
6295 ; GFX940-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[0:3], 0 offen sc0
6296 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6297 ; GFX940-NEXT: buffer_inv sc1
6298 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
6299 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6300 ; GFX940-NEXT: v_mov_b32_e32 v1, v6
6301 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
6302 ; GFX940-NEXT: s_cbranch_execnz .LBB16_1
6303 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
6304 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
6305 ; GFX940-NEXT: s_setpc_b64 s[30:31]
6307 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6309 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6310 ; GFX11-NEXT: v_dual_mov_b32 v1, s6 :: v_dual_lshlrev_b32 v2, 16, v0
6311 ; GFX11-NEXT: s_add_i32 s4, s6, 0x400
6312 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
6313 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_and_b32 v3, 0xffff0000, v0
6314 ; GFX11-NEXT: buffer_load_b32 v1, v1, s[0:3], 0 offen offset:1024
6315 ; GFX11-NEXT: s_mov_b32 s5, 0
6316 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
6317 ; GFX11-NEXT: .p2align 6
6318 ; GFX11-NEXT: .LBB16_1: ; %atomicrmw.start
6319 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
6320 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6321 ; GFX11-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
6322 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v1
6323 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
6324 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
6325 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v3 :: v_dual_add_f32 v0, v0, v2
6326 ; GFX11-NEXT: v_bfe_u32 v7, v5, 16, 1
6327 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
6328 ; GFX11-NEXT: v_bfe_u32 v6, v0, 16, 1
6329 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
6330 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v5
6331 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
6332 ; GFX11-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
6333 ; GFX11-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
6334 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
6335 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
6336 ; GFX11-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
6337 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
6338 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
6339 ; GFX11-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
6340 ; GFX11-NEXT: v_dual_mov_b32 v6, v1 :: v_dual_mov_b32 v5, v0
6341 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[5:6], v4, s[0:3], 0 offen glc
6342 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6343 ; GFX11-NEXT: buffer_gl1_inv
6344 ; GFX11-NEXT: buffer_gl0_inv
6345 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
6346 ; GFX11-NEXT: v_mov_b32_e32 v1, v5
6347 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
6348 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
6349 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
6350 ; GFX11-NEXT: s_cbranch_execnz .LBB16_1
6351 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
6352 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
6353 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
6354 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6356 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6358 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6359 ; GFX10-NEXT: v_mov_b32_e32 v1, s18
6360 ; GFX10-NEXT: s_mov_b32 s11, s17
6361 ; GFX10-NEXT: s_mov_b32 s10, s16
6362 ; GFX10-NEXT: s_mov_b32 s9, s7
6363 ; GFX10-NEXT: s_mov_b32 s8, s6
6364 ; GFX10-NEXT: s_add_i32 s4, s18, 0x400
6365 ; GFX10-NEXT: buffer_load_dword v1, v1, s[8:11], 0 offen offset:1024
6366 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v0
6367 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
6368 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
6369 ; GFX10-NEXT: s_mov_b32 s5, 0
6370 ; GFX10-NEXT: .LBB16_1: ; %atomicrmw.start
6371 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
6372 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6373 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v1
6374 ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
6375 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
6376 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
6377 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v3
6378 ; GFX10-NEXT: v_bfe_u32 v6, v0, 16, 1
6379 ; GFX10-NEXT: v_bfe_u32 v7, v5, 16, 1
6380 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
6381 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v5
6382 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
6383 ; GFX10-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
6384 ; GFX10-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
6385 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
6386 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
6387 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
6388 ; GFX10-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
6389 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
6390 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
6391 ; GFX10-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[8:11], 0 offen glc
6392 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6393 ; GFX10-NEXT: buffer_gl1_inv
6394 ; GFX10-NEXT: buffer_gl0_inv
6395 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
6396 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
6397 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
6398 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
6399 ; GFX10-NEXT: s_cbranch_execnz .LBB16_1
6400 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
6401 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
6402 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6404 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6406 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6407 ; GFX90A-NEXT: s_mov_b32 s11, s17
6408 ; GFX90A-NEXT: s_mov_b32 s10, s16
6409 ; GFX90A-NEXT: s_mov_b32 s9, s7
6410 ; GFX90A-NEXT: s_mov_b32 s8, s6
6411 ; GFX90A-NEXT: v_mov_b32_e32 v1, s18
6412 ; GFX90A-NEXT: buffer_load_dword v1, v1, s[8:11], 0 offen offset:1024
6413 ; GFX90A-NEXT: s_add_i32 s4, s18, 0x400
6414 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
6415 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v0
6416 ; GFX90A-NEXT: s_movk_i32 s12, 0x7fff
6417 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
6418 ; GFX90A-NEXT: s_mov_b32 s13, 0x7060302
6419 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
6420 ; GFX90A-NEXT: .LBB16_1: ; %atomicrmw.start
6421 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
6422 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6423 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v1
6424 ; GFX90A-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
6425 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
6426 ; GFX90A-NEXT: v_add_f32_e32 v5, v5, v3
6427 ; GFX90A-NEXT: v_bfe_u32 v6, v0, 16, 1
6428 ; GFX90A-NEXT: v_bfe_u32 v8, v5, 16, 1
6429 ; GFX90A-NEXT: v_or_b32_e32 v7, 0x400000, v0
6430 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v5
6431 ; GFX90A-NEXT: v_add3_u32 v6, v6, v0, s12
6432 ; GFX90A-NEXT: v_add3_u32 v8, v8, v5, s12
6433 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
6434 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
6435 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
6436 ; GFX90A-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
6437 ; GFX90A-NEXT: v_perm_b32 v0, v5, v0, s13
6438 ; GFX90A-NEXT: v_pk_mov_b32 v[6:7], v[0:1], v[0:1] op_sel:[0,1]
6439 ; GFX90A-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[8:11], 0 offen glc
6440 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6441 ; GFX90A-NEXT: buffer_wbinvl1
6442 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
6443 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6444 ; GFX90A-NEXT: v_mov_b32_e32 v1, v6
6445 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
6446 ; GFX90A-NEXT: s_cbranch_execnz .LBB16_1
6447 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
6448 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
6449 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
6451 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6453 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6454 ; GFX908-NEXT: s_mov_b32 s11, s17
6455 ; GFX908-NEXT: s_mov_b32 s10, s16
6456 ; GFX908-NEXT: s_mov_b32 s9, s7
6457 ; GFX908-NEXT: s_mov_b32 s8, s6
6458 ; GFX908-NEXT: v_mov_b32_e32 v1, s18
6459 ; GFX908-NEXT: buffer_load_dword v1, v1, s[8:11], 0 offen offset:1024
6460 ; GFX908-NEXT: s_add_i32 s4, s18, 0x400
6461 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
6462 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v0
6463 ; GFX908-NEXT: s_movk_i32 s12, 0x7fff
6464 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
6465 ; GFX908-NEXT: s_mov_b32 s13, 0x7060302
6466 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
6467 ; GFX908-NEXT: .LBB16_1: ; %atomicrmw.start
6468 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
6469 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6470 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v1
6471 ; GFX908-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
6472 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
6473 ; GFX908-NEXT: v_add_f32_e32 v5, v5, v3
6474 ; GFX908-NEXT: v_bfe_u32 v6, v0, 16, 1
6475 ; GFX908-NEXT: v_bfe_u32 v8, v5, 16, 1
6476 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
6477 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v5
6478 ; GFX908-NEXT: v_add3_u32 v6, v6, v0, s12
6479 ; GFX908-NEXT: v_add3_u32 v8, v8, v5, s12
6480 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
6481 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
6482 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
6483 ; GFX908-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
6484 ; GFX908-NEXT: v_perm_b32 v0, v5, v0, s13
6485 ; GFX908-NEXT: v_mov_b32_e32 v6, v1
6486 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
6487 ; GFX908-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[8:11], 0 offen glc
6488 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6489 ; GFX908-NEXT: buffer_wbinvl1
6490 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
6491 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6492 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
6493 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
6494 ; GFX908-NEXT: s_cbranch_execnz .LBB16_1
6495 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
6496 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
6497 ; GFX908-NEXT: s_setpc_b64 s[30:31]
6499 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6501 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6502 ; GFX8-NEXT: s_mov_b32 s11, s17
6503 ; GFX8-NEXT: s_mov_b32 s10, s16
6504 ; GFX8-NEXT: s_mov_b32 s9, s7
6505 ; GFX8-NEXT: s_mov_b32 s8, s6
6506 ; GFX8-NEXT: v_mov_b32_e32 v1, s18
6507 ; GFX8-NEXT: buffer_load_dword v1, v1, s[8:11], 0 offen offset:1024
6508 ; GFX8-NEXT: s_add_i32 s4, s18, 0x400
6509 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
6510 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v0
6511 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
6512 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
6513 ; GFX8-NEXT: .LBB16_1: ; %atomicrmw.start
6514 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
6515 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6516 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v1
6517 ; GFX8-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
6518 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
6519 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v3
6520 ; GFX8-NEXT: v_bfe_u32 v6, v0, 16, 1
6521 ; GFX8-NEXT: v_bfe_u32 v8, v5, 16, 1
6522 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v0
6523 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v5
6524 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
6525 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
6526 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v5
6527 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
6528 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
6529 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
6530 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
6531 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
6532 ; GFX8-NEXT: v_lshrrev_b32_e32 v5, 16, v5
6533 ; GFX8-NEXT: v_alignbit_b32 v0, v5, v0, 16
6534 ; GFX8-NEXT: v_mov_b32_e32 v6, v1
6535 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
6536 ; GFX8-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[8:11], 0 offen glc
6537 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6538 ; GFX8-NEXT: buffer_wbinvl1
6539 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
6540 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6541 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
6542 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
6543 ; GFX8-NEXT: s_cbranch_execnz .LBB16_1
6544 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
6545 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
6546 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6548 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6550 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6551 ; GFX7-NEXT: s_mov_b32 s11, s17
6552 ; GFX7-NEXT: s_mov_b32 s10, s16
6553 ; GFX7-NEXT: s_mov_b32 s9, s7
6554 ; GFX7-NEXT: s_mov_b32 s8, s6
6555 ; GFX7-NEXT: v_mov_b32_e32 v2, s18
6556 ; GFX7-NEXT: buffer_load_dword v2, v2, s[8:11], 0 offen offset:1024
6557 ; GFX7-NEXT: s_add_i32 s6, s18, 0x400
6558 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
6559 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
6560 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
6561 ; GFX7-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
6562 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
6563 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6564 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
6565 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v2
6566 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
6567 ; GFX7-NEXT: .LBB16_1: ; %atomicrmw.start
6568 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
6569 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
6570 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v4
6571 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
6572 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
6573 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
6574 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
6575 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
6576 ; GFX7-NEXT: v_alignbit_b32 v4, v3, v4, 16
6577 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v6
6578 ; GFX7-NEXT: v_alignbit_b32 v3, v3, v5, 16
6579 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
6580 ; GFX7-NEXT: v_mov_b32_e32 v5, v3
6581 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[8:11], 0 offen glc
6582 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6583 ; GFX7-NEXT: buffer_wbinvl1
6584 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
6585 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
6586 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6587 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v5
6588 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
6589 ; GFX7-NEXT: s_cbranch_execnz .LBB16_1
6590 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
6591 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
6592 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6594 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
6596 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6597 ; GFX6-NEXT: s_mov_b32 s11, s17
6598 ; GFX6-NEXT: s_mov_b32 s10, s16
6599 ; GFX6-NEXT: s_mov_b32 s9, s7
6600 ; GFX6-NEXT: s_mov_b32 s8, s6
6601 ; GFX6-NEXT: v_mov_b32_e32 v2, s18
6602 ; GFX6-NEXT: buffer_load_dword v2, v2, s[8:11], 0 offen offset:1024
6603 ; GFX6-NEXT: s_add_i32 s6, s18, 0x400
6604 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
6605 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
6606 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
6607 ; GFX6-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
6608 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
6609 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6610 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
6611 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v2
6612 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
6613 ; GFX6-NEXT: .LBB16_1: ; %atomicrmw.start
6614 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
6615 ; GFX6-NEXT: v_mul_f32_e32 v3, 1.0, v3
6616 ; GFX6-NEXT: v_mul_f32_e32 v4, 1.0, v4
6617 ; GFX6-NEXT: s_waitcnt expcnt(0)
6618 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
6619 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
6620 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v3
6621 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
6622 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
6623 ; GFX6-NEXT: v_alignbit_b32 v4, v3, v4, 16
6624 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v6
6625 ; GFX6-NEXT: v_alignbit_b32 v3, v3, v5, 16
6626 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
6627 ; GFX6-NEXT: v_mov_b32_e32 v5, v3
6628 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[8:11], 0 offen glc
6629 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6630 ; GFX6-NEXT: buffer_wbinvl1
6631 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
6632 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
6633 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6634 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v5
6635 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
6636 ; GFX6-NEXT: s_cbranch_execnz .LBB16_1
6637 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
6638 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
6639 ; GFX6-NEXT: s_waitcnt expcnt(0)
6640 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6641 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
6642 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst
6646 define <2 x bfloat> @buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall(ptr addrspace(7) %ptr, <2 x bfloat> %val) #0 {
6647 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
6649 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
6650 ; GFX12-NEXT: s_wait_expcnt 0x0
6651 ; GFX12-NEXT: s_wait_samplecnt 0x0
6652 ; GFX12-NEXT: s_wait_bvhcnt 0x0
6653 ; GFX12-NEXT: s_wait_kmcnt 0x0
6654 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
6655 ; GFX12-NEXT: global_wb scope:SCOPE_DEV
6656 ; GFX12-NEXT: s_wait_storecnt 0x0
6657 ; GFX12-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
6658 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
6659 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
6660 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
6661 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
6662 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
6663 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
6664 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
6665 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
6666 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
6667 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
6668 ; GFX12-NEXT: s_wait_loadcnt 0x0
6669 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v5, v4, s[4:7], null offen offset:1024 th:TH_ATOMIC_RETURN
6670 ; GFX12-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
6671 ; GFX12-NEXT: ; implicit-def: $vgpr4
6672 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
6673 ; GFX12-NEXT: s_cbranch_execnz .LBB17_1
6674 ; GFX12-NEXT: ; %bb.2:
6675 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
6676 ; GFX12-NEXT: s_wait_loadcnt 0x0
6677 ; GFX12-NEXT: v_mov_b32_e32 v0, v5
6678 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
6679 ; GFX12-NEXT: s_setpc_b64 s[30:31]
6681 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
6683 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6684 ; GFX940-NEXT: v_add_u32_e32 v8, 0x400, v4
6685 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
6686 ; GFX940-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
6687 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
6688 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
6689 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
6690 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
6691 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
6692 ; GFX940-NEXT: s_nop 0
6693 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
6694 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
6695 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
6696 ; GFX940-NEXT: buffer_load_dword v7, v4, s[4:7], 0 offen offset:1024
6697 ; GFX940-NEXT: ; implicit-def: $vgpr4
6698 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
6699 ; GFX940-NEXT: s_cbranch_execnz .LBB17_1
6700 ; GFX940-NEXT: ; %bb.2:
6701 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
6702 ; GFX940-NEXT: s_mov_b64 s[2:3], 0
6703 ; GFX940-NEXT: v_lshlrev_b32_e32 v9, 16, v5
6704 ; GFX940-NEXT: s_movk_i32 s10, 0x7fff
6705 ; GFX940-NEXT: v_and_b32_e32 v10, 0xffff0000, v5
6706 ; GFX940-NEXT: s_mov_b32 s11, 0x7060302
6707 ; GFX940-NEXT: .LBB17_3: ; %atomicrmw.start
6708 ; GFX940-NEXT: ; =>This Loop Header: Depth=1
6709 ; GFX940-NEXT: ; Child Loop BB17_4 Depth 2
6710 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6711 ; GFX940-NEXT: v_lshlrev_b32_e32 v4, 16, v7
6712 ; GFX940-NEXT: v_add_f32_e32 v4, v4, v9
6713 ; GFX940-NEXT: v_bfe_u32 v5, v4, 16, 1
6714 ; GFX940-NEXT: v_add3_u32 v5, v5, v4, s10
6715 ; GFX940-NEXT: v_or_b32_e32 v6, 0x400000, v4
6716 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
6717 ; GFX940-NEXT: s_mov_b64 s[8:9], exec
6718 ; GFX940-NEXT: buffer_wbl2 sc1
6719 ; GFX940-NEXT: v_cndmask_b32_e32 v4, v5, v6, vcc
6720 ; GFX940-NEXT: v_and_b32_e32 v5, 0xffff0000, v7
6721 ; GFX940-NEXT: v_add_f32_e32 v5, v5, v10
6722 ; GFX940-NEXT: v_bfe_u32 v6, v5, 16, 1
6723 ; GFX940-NEXT: v_add3_u32 v6, v6, v5, s10
6724 ; GFX940-NEXT: v_or_b32_e32 v11, 0x400000, v5
6725 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
6726 ; GFX940-NEXT: s_nop 1
6727 ; GFX940-NEXT: v_cndmask_b32_e32 v5, v6, v11, vcc
6728 ; GFX940-NEXT: v_perm_b32 v6, v5, v4, s11
6729 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[6:7]
6730 ; GFX940-NEXT: .LBB17_4: ; Parent Loop BB17_3 Depth=1
6731 ; GFX940-NEXT: ; => This Inner Loop Header: Depth=2
6732 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
6733 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
6734 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
6735 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
6736 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
6737 ; GFX940-NEXT: s_nop 0
6738 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
6739 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
6740 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
6741 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6742 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[4:7], 0 offen sc0
6743 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
6744 ; GFX940-NEXT: s_cbranch_execnz .LBB17_4
6745 ; GFX940-NEXT: ; %bb.5: ; in Loop: Header=BB17_3 Depth=1
6746 ; GFX940-NEXT: s_mov_b64 exec, s[8:9]
6747 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6748 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v7
6749 ; GFX940-NEXT: s_or_b64 s[2:3], vcc, s[2:3]
6750 ; GFX940-NEXT: v_mov_b32_e32 v7, v4
6751 ; GFX940-NEXT: buffer_inv sc1
6752 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[2:3]
6753 ; GFX940-NEXT: s_cbranch_execnz .LBB17_3
6754 ; GFX940-NEXT: ; %bb.6: ; %atomicrmw.end
6755 ; GFX940-NEXT: s_or_b64 exec, exec, s[2:3]
6756 ; GFX940-NEXT: v_mov_b32_e32 v0, v4
6757 ; GFX940-NEXT: s_setpc_b64 s[30:31]
6759 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
6761 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6762 ; GFX11-NEXT: v_add_nc_u32_e32 v7, 0x400, v4
6763 ; GFX11-NEXT: s_mov_b32 s1, 0
6764 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
6765 ; GFX11-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
6766 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
6767 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
6768 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
6769 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
6770 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
6771 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
6772 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
6773 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
6774 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
6775 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
6776 ; GFX11-NEXT: buffer_load_b32 v6, v4, s[4:7], 0 offen offset:1024
6777 ; GFX11-NEXT: ; implicit-def: $vgpr4
6778 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
6779 ; GFX11-NEXT: s_cbranch_execnz .LBB17_1
6780 ; GFX11-NEXT: ; %bb.2:
6781 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
6782 ; GFX11-NEXT: v_lshlrev_b32_e32 v8, 16, v5
6783 ; GFX11-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
6784 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
6785 ; GFX11-NEXT: .p2align 6
6786 ; GFX11-NEXT: .LBB17_3: ; %atomicrmw.start
6787 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
6788 ; GFX11-NEXT: ; Child Loop BB17_4 Depth 2
6789 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6790 ; GFX11-NEXT: v_and_b32_e32 v5, 0xffff0000, v6
6791 ; GFX11-NEXT: v_lshlrev_b32_e32 v4, 16, v6
6792 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
6793 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
6794 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
6795 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v9 :: v_dual_add_f32 v4, v4, v8
6796 ; GFX11-NEXT: v_bfe_u32 v11, v5, 16, 1
6797 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
6798 ; GFX11-NEXT: v_bfe_u32 v10, v4, 16, 1
6799 ; GFX11-NEXT: v_or_b32_e32 v12, 0x400000, v4
6800 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
6801 ; GFX11-NEXT: v_or_b32_e32 v13, 0x400000, v5
6802 ; GFX11-NEXT: v_add3_u32 v11, v11, v5, 0x7fff
6803 ; GFX11-NEXT: v_add3_u32 v10, v10, v4, 0x7fff
6804 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_4)
6805 ; GFX11-NEXT: v_cndmask_b32_e32 v4, v10, v12, vcc_lo
6806 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
6807 ; GFX11-NEXT: v_cndmask_b32_e32 v5, v11, v13, vcc_lo
6808 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
6809 ; GFX11-NEXT: v_perm_b32 v5, v5, v4, 0x7060302
6810 ; GFX11-NEXT: v_mov_b32_e32 v4, v5
6811 ; GFX11-NEXT: v_mov_b32_e32 v5, v6
6812 ; GFX11-NEXT: .LBB17_4: ; Parent Loop BB17_3 Depth=1
6813 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
6814 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
6815 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
6816 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
6817 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
6818 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
6819 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
6820 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
6821 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
6822 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
6823 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
6824 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6825 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v7, s[4:7], 0 offen glc
6826 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
6827 ; GFX11-NEXT: s_cbranch_execnz .LBB17_4
6828 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB17_3 Depth=1
6829 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
6830 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6831 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
6832 ; GFX11-NEXT: v_mov_b32_e32 v6, v4
6833 ; GFX11-NEXT: buffer_gl1_inv
6834 ; GFX11-NEXT: buffer_gl0_inv
6835 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
6836 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
6837 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
6838 ; GFX11-NEXT: s_cbranch_execnz .LBB17_3
6839 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
6840 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
6841 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
6842 ; GFX11-NEXT: v_mov_b32_e32 v0, v4
6843 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6845 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
6847 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6848 ; GFX10-NEXT: v_add_nc_u32_e32 v7, 0x400, v4
6849 ; GFX10-NEXT: s_mov_b32 s5, 0
6850 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
6851 ; GFX10-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
6852 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
6853 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
6854 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
6855 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
6856 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
6857 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
6858 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
6859 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
6860 ; GFX10-NEXT: buffer_load_dword v6, v4, s[8:11], 0 offen offset:1024
6861 ; GFX10-NEXT: ; implicit-def: $vgpr4
6862 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
6863 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
6864 ; GFX10-NEXT: s_cbranch_execnz .LBB17_1
6865 ; GFX10-NEXT: ; %bb.2:
6866 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
6867 ; GFX10-NEXT: v_lshlrev_b32_e32 v8, 16, v5
6868 ; GFX10-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
6869 ; GFX10-NEXT: .LBB17_3: ; %atomicrmw.start
6870 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
6871 ; GFX10-NEXT: ; Child Loop BB17_4 Depth 2
6872 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6873 ; GFX10-NEXT: v_lshlrev_b32_e32 v4, 16, v6
6874 ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff0000, v6
6875 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
6876 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
6877 ; GFX10-NEXT: v_add_f32_e32 v4, v4, v8
6878 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v9
6879 ; GFX10-NEXT: v_bfe_u32 v10, v4, 16, 1
6880 ; GFX10-NEXT: v_bfe_u32 v11, v5, 16, 1
6881 ; GFX10-NEXT: v_or_b32_e32 v12, 0x400000, v4
6882 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
6883 ; GFX10-NEXT: v_or_b32_e32 v13, 0x400000, v5
6884 ; GFX10-NEXT: v_add3_u32 v10, v10, v4, 0x7fff
6885 ; GFX10-NEXT: v_add3_u32 v11, v11, v5, 0x7fff
6886 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v10, v12, vcc_lo
6887 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
6888 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v11, v13, vcc_lo
6889 ; GFX10-NEXT: v_perm_b32 v5, v5, v4, 0x7060302
6890 ; GFX10-NEXT: v_mov_b32_e32 v4, v5
6891 ; GFX10-NEXT: v_mov_b32_e32 v5, v6
6892 ; GFX10-NEXT: .LBB17_4: ; Parent Loop BB17_3 Depth=1
6893 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
6894 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
6895 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
6896 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
6897 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
6898 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
6899 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
6900 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
6901 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
6902 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6903 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v7, s[8:11], 0 offen glc
6904 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
6905 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
6906 ; GFX10-NEXT: s_cbranch_execnz .LBB17_4
6907 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB17_3 Depth=1
6908 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
6909 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6910 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
6911 ; GFX10-NEXT: v_mov_b32_e32 v6, v4
6912 ; GFX10-NEXT: buffer_gl1_inv
6913 ; GFX10-NEXT: buffer_gl0_inv
6914 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
6915 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
6916 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
6917 ; GFX10-NEXT: s_cbranch_execnz .LBB17_3
6918 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
6919 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
6920 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
6921 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6923 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
6925 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6926 ; GFX90A-NEXT: v_add_u32_e32 v8, 0x400, v4
6927 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
6928 ; GFX90A-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
6929 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
6930 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
6931 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
6932 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
6933 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6934 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6935 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6936 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6937 ; GFX90A-NEXT: s_nop 0
6938 ; GFX90A-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
6939 ; GFX90A-NEXT: ; implicit-def: $vgpr4
6940 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
6941 ; GFX90A-NEXT: s_cbranch_execnz .LBB17_1
6942 ; GFX90A-NEXT: ; %bb.2:
6943 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
6944 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
6945 ; GFX90A-NEXT: v_lshlrev_b32_e32 v9, 16, v5
6946 ; GFX90A-NEXT: s_movk_i32 s14, 0x7fff
6947 ; GFX90A-NEXT: v_and_b32_e32 v10, 0xffff0000, v5
6948 ; GFX90A-NEXT: s_mov_b32 s15, 0x7060302
6949 ; GFX90A-NEXT: .LBB17_3: ; %atomicrmw.start
6950 ; GFX90A-NEXT: ; =>This Loop Header: Depth=1
6951 ; GFX90A-NEXT: ; Child Loop BB17_4 Depth 2
6952 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6953 ; GFX90A-NEXT: v_lshlrev_b32_e32 v4, 16, v7
6954 ; GFX90A-NEXT: v_add_f32_e32 v4, v4, v9
6955 ; GFX90A-NEXT: v_bfe_u32 v5, v4, 16, 1
6956 ; GFX90A-NEXT: v_add3_u32 v5, v5, v4, s14
6957 ; GFX90A-NEXT: v_or_b32_e32 v6, 0x400000, v4
6958 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
6959 ; GFX90A-NEXT: v_cndmask_b32_e32 v4, v5, v6, vcc
6960 ; GFX90A-NEXT: v_and_b32_e32 v5, 0xffff0000, v7
6961 ; GFX90A-NEXT: v_add_f32_e32 v5, v5, v10
6962 ; GFX90A-NEXT: v_bfe_u32 v6, v5, 16, 1
6963 ; GFX90A-NEXT: v_add3_u32 v6, v6, v5, s14
6964 ; GFX90A-NEXT: v_or_b32_e32 v11, 0x400000, v5
6965 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
6966 ; GFX90A-NEXT: v_cndmask_b32_e32 v5, v6, v11, vcc
6967 ; GFX90A-NEXT: v_perm_b32 v6, v5, v4, s15
6968 ; GFX90A-NEXT: s_mov_b64 s[12:13], exec
6969 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[6:7], v[6:7] op_sel:[0,1]
6970 ; GFX90A-NEXT: .LBB17_4: ; Parent Loop BB17_3 Depth=1
6971 ; GFX90A-NEXT: ; => This Inner Loop Header: Depth=2
6972 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
6973 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
6974 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
6975 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
6976 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6977 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6978 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6979 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6980 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6981 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
6982 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
6983 ; GFX90A-NEXT: s_cbranch_execnz .LBB17_4
6984 ; GFX90A-NEXT: ; %bb.5: ; in Loop: Header=BB17_3 Depth=1
6985 ; GFX90A-NEXT: s_mov_b64 exec, s[12:13]
6986 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6987 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v7
6988 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6989 ; GFX90A-NEXT: v_mov_b32_e32 v7, v4
6990 ; GFX90A-NEXT: buffer_wbinvl1
6991 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
6992 ; GFX90A-NEXT: s_cbranch_execnz .LBB17_3
6993 ; GFX90A-NEXT: ; %bb.6: ; %atomicrmw.end
6994 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
6995 ; GFX90A-NEXT: v_mov_b32_e32 v0, v4
6996 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
6998 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
7000 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7001 ; GFX908-NEXT: v_add_u32_e32 v7, 0x400, v4
7002 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
7003 ; GFX908-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
7004 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
7005 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
7006 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
7007 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
7008 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7009 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7010 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7011 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7012 ; GFX908-NEXT: s_nop 0
7013 ; GFX908-NEXT: buffer_load_dword v6, v4, s[8:11], 0 offen offset:1024
7014 ; GFX908-NEXT: ; implicit-def: $vgpr4
7015 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
7016 ; GFX908-NEXT: s_cbranch_execnz .LBB17_1
7017 ; GFX908-NEXT: ; %bb.2:
7018 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
7019 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
7020 ; GFX908-NEXT: v_lshlrev_b32_e32 v8, 16, v5
7021 ; GFX908-NEXT: s_movk_i32 s14, 0x7fff
7022 ; GFX908-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
7023 ; GFX908-NEXT: s_mov_b32 s15, 0x7060302
7024 ; GFX908-NEXT: .LBB17_3: ; %atomicrmw.start
7025 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
7026 ; GFX908-NEXT: ; Child Loop BB17_4 Depth 2
7027 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7028 ; GFX908-NEXT: v_lshlrev_b32_e32 v4, 16, v6
7029 ; GFX908-NEXT: v_add_f32_e32 v4, v4, v8
7030 ; GFX908-NEXT: v_bfe_u32 v5, v4, 16, 1
7031 ; GFX908-NEXT: v_add3_u32 v5, v5, v4, s14
7032 ; GFX908-NEXT: v_or_b32_e32 v10, 0x400000, v4
7033 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
7034 ; GFX908-NEXT: v_cndmask_b32_e32 v4, v5, v10, vcc
7035 ; GFX908-NEXT: v_and_b32_e32 v5, 0xffff0000, v6
7036 ; GFX908-NEXT: v_add_f32_e32 v5, v5, v9
7037 ; GFX908-NEXT: v_bfe_u32 v10, v5, 16, 1
7038 ; GFX908-NEXT: v_add3_u32 v10, v10, v5, s14
7039 ; GFX908-NEXT: v_or_b32_e32 v11, 0x400000, v5
7040 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
7041 ; GFX908-NEXT: v_cndmask_b32_e32 v5, v10, v11, vcc
7042 ; GFX908-NEXT: v_perm_b32 v5, v5, v4, s15
7043 ; GFX908-NEXT: v_mov_b32_e32 v4, v5
7044 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
7045 ; GFX908-NEXT: v_mov_b32_e32 v5, v6
7046 ; GFX908-NEXT: .LBB17_4: ; Parent Loop BB17_3 Depth=1
7047 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
7048 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
7049 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
7050 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
7051 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
7052 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7053 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7054 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7055 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7056 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7057 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v7, s[8:11], 0 offen glc
7058 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
7059 ; GFX908-NEXT: s_cbranch_execnz .LBB17_4
7060 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB17_3 Depth=1
7061 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
7062 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7063 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
7064 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
7065 ; GFX908-NEXT: v_mov_b32_e32 v6, v4
7066 ; GFX908-NEXT: buffer_wbinvl1
7067 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
7068 ; GFX908-NEXT: s_cbranch_execnz .LBB17_3
7069 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
7070 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
7071 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
7072 ; GFX908-NEXT: s_setpc_b64 s[30:31]
7074 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
7076 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7077 ; GFX8-NEXT: v_add_u32_e32 v7, vcc, 0x400, v4
7078 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
7079 ; GFX8-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
7080 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
7081 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
7082 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
7083 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
7084 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7085 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7086 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7087 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7088 ; GFX8-NEXT: s_nop 0
7089 ; GFX8-NEXT: buffer_load_dword v6, v4, s[8:11], 0 offen offset:1024
7090 ; GFX8-NEXT: ; implicit-def: $vgpr4
7091 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
7092 ; GFX8-NEXT: s_cbranch_execnz .LBB17_1
7093 ; GFX8-NEXT: ; %bb.2:
7094 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
7095 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
7096 ; GFX8-NEXT: v_lshlrev_b32_e32 v8, 16, v5
7097 ; GFX8-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
7098 ; GFX8-NEXT: .LBB17_3: ; %atomicrmw.start
7099 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
7100 ; GFX8-NEXT: ; Child Loop BB17_4 Depth 2
7101 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7102 ; GFX8-NEXT: v_lshlrev_b32_e32 v4, 16, v6
7103 ; GFX8-NEXT: v_add_f32_e32 v4, v4, v8
7104 ; GFX8-NEXT: v_bfe_u32 v5, v4, 16, 1
7105 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, v5, v4
7106 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, 0x7fff, v5
7107 ; GFX8-NEXT: v_or_b32_e32 v10, 0x400000, v4
7108 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
7109 ; GFX8-NEXT: v_cndmask_b32_e32 v4, v5, v10, vcc
7110 ; GFX8-NEXT: v_and_b32_e32 v5, 0xffff0000, v6
7111 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v9
7112 ; GFX8-NEXT: v_bfe_u32 v10, v5, 16, 1
7113 ; GFX8-NEXT: v_add_u32_e32 v10, vcc, v10, v5
7114 ; GFX8-NEXT: v_add_u32_e32 v10, vcc, 0x7fff, v10
7115 ; GFX8-NEXT: v_or_b32_e32 v11, 0x400000, v5
7116 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
7117 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v10, v11, vcc
7118 ; GFX8-NEXT: v_lshrrev_b32_e32 v5, 16, v5
7119 ; GFX8-NEXT: v_alignbit_b32 v5, v5, v4, 16
7120 ; GFX8-NEXT: v_mov_b32_e32 v4, v5
7121 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
7122 ; GFX8-NEXT: v_mov_b32_e32 v5, v6
7123 ; GFX8-NEXT: .LBB17_4: ; Parent Loop BB17_3 Depth=1
7124 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
7125 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
7126 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
7127 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
7128 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
7129 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7130 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7131 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7132 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7133 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7134 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v7, s[8:11], 0 offen glc
7135 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
7136 ; GFX8-NEXT: s_cbranch_execnz .LBB17_4
7137 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB17_3 Depth=1
7138 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
7139 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7140 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
7141 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
7142 ; GFX8-NEXT: v_mov_b32_e32 v6, v4
7143 ; GFX8-NEXT: buffer_wbinvl1
7144 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
7145 ; GFX8-NEXT: s_cbranch_execnz .LBB17_3
7146 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
7147 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
7148 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
7149 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7151 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
7153 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7154 ; GFX7-NEXT: v_add_i32_e32 v8, vcc, 0x400, v4
7155 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
7156 ; GFX7-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
7157 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
7158 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
7159 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
7160 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
7161 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7162 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7163 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7164 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7165 ; GFX7-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
7166 ; GFX7-NEXT: ; implicit-def: $vgpr4
7167 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
7168 ; GFX7-NEXT: s_cbranch_execnz .LBB17_1
7169 ; GFX7-NEXT: ; %bb.2:
7170 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
7171 ; GFX7-NEXT: v_mul_f32_e32 v5, 1.0, v5
7172 ; GFX7-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
7173 ; GFX7-NEXT: v_mul_f32_e32 v5, 1.0, v6
7174 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7175 ; GFX7-NEXT: v_and_b32_e32 v4, 0xffff0000, v7
7176 ; GFX7-NEXT: v_lshlrev_b32_e32 v7, 16, v7
7177 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
7178 ; GFX7-NEXT: v_and_b32_e32 v10, 0xffff0000, v5
7179 ; GFX7-NEXT: .LBB17_3: ; %atomicrmw.start
7180 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
7181 ; GFX7-NEXT: ; Child Loop BB17_4 Depth 2
7182 ; GFX7-NEXT: v_mul_f32_e32 v5, 1.0, v7
7183 ; GFX7-NEXT: v_mul_f32_e32 v7, 1.0, v4
7184 ; GFX7-NEXT: v_and_b32_e32 v4, 0xffff0000, v7
7185 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v5
7186 ; GFX7-NEXT: v_add_f32_e32 v4, v4, v10
7187 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v9
7188 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, 16, v4
7189 ; GFX7-NEXT: v_alignbit_b32 v4, v4, v6, 16
7190 ; GFX7-NEXT: v_lshrrev_b32_e32 v6, 16, v7
7191 ; GFX7-NEXT: v_alignbit_b32 v5, v6, v5, 16
7192 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
7193 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
7194 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
7195 ; GFX7-NEXT: .LBB17_4: ; Parent Loop BB17_3 Depth=1
7196 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
7197 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
7198 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
7199 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
7200 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
7201 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7202 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7203 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7204 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7205 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7206 ; GFX7-NEXT: buffer_atomic_cmpswap v[6:7], v8, s[8:11], 0 offen glc
7207 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
7208 ; GFX7-NEXT: s_cbranch_execnz .LBB17_4
7209 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB17_3 Depth=1
7210 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
7211 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7212 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
7213 ; GFX7-NEXT: v_and_b32_e32 v4, 0xffff0000, v6
7214 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
7215 ; GFX7-NEXT: v_lshlrev_b32_e32 v7, 16, v6
7216 ; GFX7-NEXT: buffer_wbinvl1
7217 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
7218 ; GFX7-NEXT: s_cbranch_execnz .LBB17_3
7219 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
7220 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
7221 ; GFX7-NEXT: v_mov_b32_e32 v0, v7
7222 ; GFX7-NEXT: v_mov_b32_e32 v1, v4
7223 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7225 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall:
7227 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7228 ; GFX6-NEXT: v_add_i32_e32 v8, vcc, 0x400, v4
7229 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
7230 ; GFX6-NEXT: .LBB17_1: ; =>This Inner Loop Header: Depth=1
7231 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
7232 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
7233 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
7234 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
7235 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7236 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7237 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7238 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7239 ; GFX6-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
7240 ; GFX6-NEXT: ; implicit-def: $vgpr4
7241 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
7242 ; GFX6-NEXT: s_cbranch_execnz .LBB17_1
7243 ; GFX6-NEXT: ; %bb.2:
7244 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
7245 ; GFX6-NEXT: v_mul_f32_e32 v5, 1.0, v5
7246 ; GFX6-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
7247 ; GFX6-NEXT: v_mul_f32_e32 v5, 1.0, v6
7248 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7249 ; GFX6-NEXT: v_and_b32_e32 v4, 0xffff0000, v7
7250 ; GFX6-NEXT: v_lshlrev_b32_e32 v7, 16, v7
7251 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
7252 ; GFX6-NEXT: v_and_b32_e32 v10, 0xffff0000, v5
7253 ; GFX6-NEXT: .LBB17_3: ; %atomicrmw.start
7254 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
7255 ; GFX6-NEXT: ; Child Loop BB17_4 Depth 2
7256 ; GFX6-NEXT: v_mul_f32_e32 v5, 1.0, v7
7257 ; GFX6-NEXT: v_mul_f32_e32 v7, 1.0, v4
7258 ; GFX6-NEXT: v_and_b32_e32 v4, 0xffff0000, v7
7259 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v5
7260 ; GFX6-NEXT: v_add_f32_e32 v4, v4, v10
7261 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v9
7262 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, 16, v4
7263 ; GFX6-NEXT: v_alignbit_b32 v4, v4, v6, 16
7264 ; GFX6-NEXT: v_lshrrev_b32_e32 v6, 16, v7
7265 ; GFX6-NEXT: v_alignbit_b32 v5, v6, v5, 16
7266 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
7267 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
7268 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
7269 ; GFX6-NEXT: .LBB17_4: ; Parent Loop BB17_3 Depth=1
7270 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
7271 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
7272 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
7273 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
7274 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
7275 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7276 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7277 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7278 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7279 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
7280 ; GFX6-NEXT: buffer_atomic_cmpswap v[6:7], v8, s[8:11], 0 offen glc
7281 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
7282 ; GFX6-NEXT: s_cbranch_execnz .LBB17_4
7283 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB17_3 Depth=1
7284 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
7285 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7286 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
7287 ; GFX6-NEXT: v_and_b32_e32 v4, 0xffff0000, v6
7288 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
7289 ; GFX6-NEXT: s_waitcnt expcnt(0)
7290 ; GFX6-NEXT: v_lshlrev_b32_e32 v7, 16, v6
7291 ; GFX6-NEXT: buffer_wbinvl1
7292 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
7293 ; GFX6-NEXT: s_cbranch_execnz .LBB17_3
7294 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
7295 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
7296 ; GFX6-NEXT: v_mov_b32_e32 v0, v7
7297 ; GFX6-NEXT: v_mov_b32_e32 v1, v4
7298 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7299 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
7300 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst
7301 ret <2 x bfloat> %result
7304 ; --------------------------------------------------------------------
7306 ; --------------------------------------------------------------------
7308 define float @buffer_fat_ptr_system_atomic_fadd_ret_f32__offset(ptr addrspace(7) inreg %ptr, float %val) #0 {
7309 ; GFX12-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7311 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
7312 ; GFX12-NEXT: s_wait_expcnt 0x0
7313 ; GFX12-NEXT: s_wait_samplecnt 0x0
7314 ; GFX12-NEXT: s_wait_bvhcnt 0x0
7315 ; GFX12-NEXT: s_wait_kmcnt 0x0
7316 ; GFX12-NEXT: s_add_co_i32 s4, s6, 0x400
7317 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7318 ; GFX12-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
7319 ; GFX12-NEXT: v_mov_b32_e32 v0, s6
7320 ; GFX12-NEXT: s_mov_b32 s4, 0
7321 ; GFX12-NEXT: buffer_load_b32 v0, v0, s[0:3], null offen offset:1024
7322 ; GFX12-NEXT: .LBB18_1: ; %atomicrmw.start
7323 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
7324 ; GFX12-NEXT: s_wait_loadcnt 0x0
7325 ; GFX12-NEXT: v_mov_b32_e32 v5, v0
7326 ; GFX12-NEXT: global_wb scope:SCOPE_SYS
7327 ; GFX12-NEXT: s_wait_storecnt 0x0
7328 ; GFX12-NEXT: v_add_f32_e32 v4, v5, v2
7329 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
7330 ; GFX12-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
7331 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], null offen th:TH_ATOMIC_RETURN
7332 ; GFX12-NEXT: s_wait_loadcnt 0x0
7333 ; GFX12-NEXT: global_inv scope:SCOPE_SYS
7334 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
7335 ; GFX12-NEXT: s_or_b32 s4, vcc_lo, s4
7336 ; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7337 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
7338 ; GFX12-NEXT: s_cbranch_execnz .LBB18_1
7339 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
7340 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s4
7341 ; GFX12-NEXT: s_setpc_b64 s[30:31]
7343 ; GFX940-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7345 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7346 ; GFX940-NEXT: v_mov_b32_e32 v1, s6
7347 ; GFX940-NEXT: buffer_wbl2 sc0 sc1
7348 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 sc0
7349 ; GFX940-NEXT: s_waitcnt vmcnt(0)
7350 ; GFX940-NEXT: buffer_inv sc0 sc1
7351 ; GFX940-NEXT: s_setpc_b64 s[30:31]
7353 ; GFX11-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7355 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7356 ; GFX11-NEXT: s_add_i32 s4, s6, 0x400
7357 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7358 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
7359 ; GFX11-NEXT: v_mov_b32_e32 v0, s6
7360 ; GFX11-NEXT: s_mov_b32 s4, 0
7361 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
7362 ; GFX11-NEXT: .LBB18_1: ; %atomicrmw.start
7363 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
7364 ; GFX11-NEXT: s_waitcnt vmcnt(0)
7365 ; GFX11-NEXT: v_mov_b32_e32 v5, v0
7366 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
7367 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
7368 ; GFX11-NEXT: v_add_f32_e32 v4, v5, v2
7369 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
7370 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], 0 offen glc
7371 ; GFX11-NEXT: s_waitcnt vmcnt(0)
7372 ; GFX11-NEXT: buffer_gl1_inv
7373 ; GFX11-NEXT: buffer_gl0_inv
7374 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
7375 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
7376 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7377 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
7378 ; GFX11-NEXT: s_cbranch_execnz .LBB18_1
7379 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
7380 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
7381 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7383 ; GFX10-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7385 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7386 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
7387 ; GFX10-NEXT: v_mov_b32_e32 v0, s18
7388 ; GFX10-NEXT: s_mov_b32 s11, s17
7389 ; GFX10-NEXT: s_mov_b32 s10, s16
7390 ; GFX10-NEXT: s_mov_b32 s9, s7
7391 ; GFX10-NEXT: s_mov_b32 s8, s6
7392 ; GFX10-NEXT: s_add_i32 s4, s18, 0x400
7393 ; GFX10-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
7394 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
7395 ; GFX10-NEXT: s_mov_b32 s4, 0
7396 ; GFX10-NEXT: .LBB18_1: ; %atomicrmw.start
7397 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
7398 ; GFX10-NEXT: s_waitcnt vmcnt(0)
7399 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
7400 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
7401 ; GFX10-NEXT: v_add_f32_e32 v4, v5, v2
7402 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
7403 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
7404 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
7405 ; GFX10-NEXT: s_waitcnt vmcnt(0)
7406 ; GFX10-NEXT: buffer_gl1_inv
7407 ; GFX10-NEXT: buffer_gl0_inv
7408 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
7409 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
7410 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
7411 ; GFX10-NEXT: s_cbranch_execnz .LBB18_1
7412 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
7413 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
7414 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7416 ; GFX90A-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7418 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7419 ; GFX90A-NEXT: v_mov_b32_e32 v2, v0
7420 ; GFX90A-NEXT: s_mov_b32 s11, s17
7421 ; GFX90A-NEXT: s_mov_b32 s10, s16
7422 ; GFX90A-NEXT: s_mov_b32 s9, s7
7423 ; GFX90A-NEXT: s_mov_b32 s8, s6
7424 ; GFX90A-NEXT: v_mov_b32_e32 v0, s18
7425 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
7426 ; GFX90A-NEXT: s_add_i32 s6, s18, 0x400
7427 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
7428 ; GFX90A-NEXT: v_mov_b32_e32 v3, s6
7429 ; GFX90A-NEXT: .LBB18_1: ; %atomicrmw.start
7430 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
7431 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
7432 ; GFX90A-NEXT: v_mov_b32_e32 v5, v0
7433 ; GFX90A-NEXT: v_add_f32_e32 v4, v5, v2
7434 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[4:5], v[4:5] op_sel:[0,1]
7435 ; GFX90A-NEXT: buffer_wbl2
7436 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
7437 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
7438 ; GFX90A-NEXT: buffer_invl2
7439 ; GFX90A-NEXT: buffer_wbinvl1
7440 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7441 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7442 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
7443 ; GFX90A-NEXT: s_cbranch_execnz .LBB18_1
7444 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
7445 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
7446 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
7448 ; GFX908-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7450 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7451 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
7452 ; GFX908-NEXT: s_mov_b32 s11, s17
7453 ; GFX908-NEXT: s_mov_b32 s10, s16
7454 ; GFX908-NEXT: s_mov_b32 s9, s7
7455 ; GFX908-NEXT: s_mov_b32 s8, s6
7456 ; GFX908-NEXT: v_mov_b32_e32 v0, s18
7457 ; GFX908-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
7458 ; GFX908-NEXT: s_add_i32 s6, s18, 0x400
7459 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
7460 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
7461 ; GFX908-NEXT: .LBB18_1: ; %atomicrmw.start
7462 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
7463 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7464 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
7465 ; GFX908-NEXT: v_add_f32_e32 v4, v5, v2
7466 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
7467 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
7468 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
7469 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7470 ; GFX908-NEXT: buffer_wbinvl1
7471 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7472 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7473 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
7474 ; GFX908-NEXT: s_cbranch_execnz .LBB18_1
7475 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
7476 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
7477 ; GFX908-NEXT: s_setpc_b64 s[30:31]
7479 ; GFX8-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7481 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7482 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
7483 ; GFX8-NEXT: s_mov_b32 s11, s17
7484 ; GFX8-NEXT: s_mov_b32 s10, s16
7485 ; GFX8-NEXT: s_mov_b32 s9, s7
7486 ; GFX8-NEXT: s_mov_b32 s8, s6
7487 ; GFX8-NEXT: v_mov_b32_e32 v0, s18
7488 ; GFX8-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
7489 ; GFX8-NEXT: s_add_i32 s6, s18, 0x400
7490 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
7491 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
7492 ; GFX8-NEXT: .LBB18_1: ; %atomicrmw.start
7493 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
7494 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7495 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
7496 ; GFX8-NEXT: v_add_f32_e32 v4, v5, v2
7497 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
7498 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
7499 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
7500 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7501 ; GFX8-NEXT: buffer_wbinvl1
7502 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7503 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7504 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
7505 ; GFX8-NEXT: s_cbranch_execnz .LBB18_1
7506 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
7507 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
7508 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7510 ; GFX7-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7512 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7513 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
7514 ; GFX7-NEXT: s_mov_b32 s11, s17
7515 ; GFX7-NEXT: s_mov_b32 s10, s16
7516 ; GFX7-NEXT: s_mov_b32 s9, s7
7517 ; GFX7-NEXT: s_mov_b32 s8, s6
7518 ; GFX7-NEXT: v_mov_b32_e32 v0, s18
7519 ; GFX7-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
7520 ; GFX7-NEXT: s_add_i32 s6, s18, 0x400
7521 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
7522 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
7523 ; GFX7-NEXT: .LBB18_1: ; %atomicrmw.start
7524 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
7525 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7526 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
7527 ; GFX7-NEXT: v_add_f32_e32 v4, v5, v2
7528 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
7529 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
7530 ; GFX7-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
7531 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7532 ; GFX7-NEXT: buffer_wbinvl1
7533 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7534 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7535 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
7536 ; GFX7-NEXT: s_cbranch_execnz .LBB18_1
7537 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
7538 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
7539 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7541 ; GFX6-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset:
7543 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7544 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
7545 ; GFX6-NEXT: s_mov_b32 s11, s17
7546 ; GFX6-NEXT: s_mov_b32 s10, s16
7547 ; GFX6-NEXT: s_mov_b32 s9, s7
7548 ; GFX6-NEXT: s_mov_b32 s8, s6
7549 ; GFX6-NEXT: v_mov_b32_e32 v0, s18
7550 ; GFX6-NEXT: buffer_load_dword v0, v0, s[8:11], 0 offen offset:1024
7551 ; GFX6-NEXT: s_add_i32 s6, s18, 0x400
7552 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
7553 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
7554 ; GFX6-NEXT: .LBB18_1: ; %atomicrmw.start
7555 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
7556 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7557 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
7558 ; GFX6-NEXT: v_add_f32_e32 v4, v5, v2
7559 ; GFX6-NEXT: s_waitcnt expcnt(0)
7560 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
7561 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
7562 ; GFX6-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[8:11], 0 offen glc
7563 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7564 ; GFX6-NEXT: buffer_wbinvl1
7565 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7566 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7567 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
7568 ; GFX6-NEXT: s_cbranch_execnz .LBB18_1
7569 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
7570 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
7571 ; GFX6-NEXT: s_waitcnt expcnt(0)
7572 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7573 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
7574 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val seq_cst
7578 attributes #0 = { nounwind "amdgpu-unsafe-fp-atomics"="true" }