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__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode(ptr addrspace(7) inreg %ptr, float %val) #0 {
17 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
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, s16
25 ; GFX12-NEXT: s_wait_storecnt 0x0
26 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
27 ; GFX12-NEXT: s_wait_loadcnt 0x0
28 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
29 ; GFX12-NEXT: s_setpc_b64 s[30:31]
31 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
33 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
34 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
35 ; GFX940-NEXT: buffer_wbl2 sc1
36 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 sc0
37 ; GFX940-NEXT: s_waitcnt vmcnt(0)
38 ; GFX940-NEXT: buffer_inv sc1
39 ; GFX940-NEXT: s_setpc_b64 s[30:31]
41 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
43 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
44 ; GFX11-NEXT: v_mov_b32_e32 v1, s16
45 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
46 ; GFX11-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 glc
47 ; GFX11-NEXT: s_waitcnt vmcnt(0)
48 ; GFX11-NEXT: buffer_gl1_inv
49 ; GFX11-NEXT: buffer_gl0_inv
50 ; GFX11-NEXT: s_setpc_b64 s[30:31]
52 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
54 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
55 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
56 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
57 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
58 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
59 ; GFX10-NEXT: s_mov_b32 s4, 0
60 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
61 ; GFX10-NEXT: .LBB0_1: ; %atomicrmw.start
62 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
63 ; GFX10-NEXT: s_waitcnt vmcnt(0)
64 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
65 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
66 ; GFX10-NEXT: v_add_f32_e32 v4, v5, v2
67 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
68 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
69 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
70 ; GFX10-NEXT: s_waitcnt vmcnt(0)
71 ; GFX10-NEXT: buffer_gl1_inv
72 ; GFX10-NEXT: buffer_gl0_inv
73 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
74 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
75 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
76 ; GFX10-NEXT: s_cbranch_execnz .LBB0_1
77 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
78 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
79 ; GFX10-NEXT: s_setpc_b64 s[30:31]
81 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
83 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
84 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
85 ; GFX90A-NEXT: buffer_atomic_add_f32 v0, v1, s[16:19], 0 offen offset:1024 glc
86 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
87 ; GFX90A-NEXT: buffer_wbinvl1
88 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
90 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
92 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
93 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
94 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
95 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
96 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
97 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
98 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
99 ; GFX908-NEXT: .LBB0_1: ; %atomicrmw.start
100 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
101 ; GFX908-NEXT: s_waitcnt vmcnt(0)
102 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
103 ; GFX908-NEXT: v_add_f32_e32 v4, v5, v2
104 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
105 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
106 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
107 ; GFX908-NEXT: s_waitcnt vmcnt(0)
108 ; GFX908-NEXT: buffer_wbinvl1
109 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
110 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
111 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
112 ; GFX908-NEXT: s_cbranch_execnz .LBB0_1
113 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
114 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
115 ; GFX908-NEXT: s_setpc_b64 s[30:31]
117 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
119 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
120 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
121 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
122 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
123 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
124 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
125 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
126 ; GFX8-NEXT: .LBB0_1: ; %atomicrmw.start
127 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
128 ; GFX8-NEXT: s_waitcnt vmcnt(0)
129 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
130 ; GFX8-NEXT: v_add_f32_e32 v4, v5, v2
131 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
132 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
133 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
134 ; GFX8-NEXT: s_waitcnt vmcnt(0)
135 ; GFX8-NEXT: buffer_wbinvl1
136 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
137 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
138 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
139 ; GFX8-NEXT: s_cbranch_execnz .LBB0_1
140 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
141 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
142 ; GFX8-NEXT: s_setpc_b64 s[30:31]
144 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
146 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
147 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
148 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
149 ; GFX7-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
150 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
151 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
152 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
153 ; GFX7-NEXT: .LBB0_1: ; %atomicrmw.start
154 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
155 ; GFX7-NEXT: s_waitcnt vmcnt(0)
156 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
157 ; GFX7-NEXT: v_add_f32_e32 v4, v5, v2
158 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
159 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
160 ; GFX7-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
161 ; GFX7-NEXT: s_waitcnt vmcnt(0)
162 ; GFX7-NEXT: buffer_wbinvl1
163 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
164 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
165 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
166 ; GFX7-NEXT: s_cbranch_execnz .LBB0_1
167 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
168 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
169 ; GFX7-NEXT: s_setpc_b64 s[30:31]
171 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
173 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
174 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
175 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
176 ; GFX6-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
177 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
178 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
179 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
180 ; GFX6-NEXT: .LBB0_1: ; %atomicrmw.start
181 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
182 ; GFX6-NEXT: s_waitcnt vmcnt(0)
183 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
184 ; GFX6-NEXT: v_add_f32_e32 v4, v5, v2
185 ; GFX6-NEXT: s_waitcnt expcnt(0)
186 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
187 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
188 ; GFX6-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
189 ; GFX6-NEXT: s_waitcnt vmcnt(0)
190 ; GFX6-NEXT: buffer_wbinvl1
191 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
192 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
193 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
194 ; GFX6-NEXT: s_cbranch_execnz .LBB0_1
195 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
196 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
197 ; GFX6-NEXT: s_waitcnt expcnt(0)
198 ; GFX6-NEXT: s_setpc_b64 s[30:31]
199 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
200 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0, !amdgpu.ignore.denormal.mode !0
204 define void @buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode(ptr addrspace(7) inreg %ptr, float %val) #0 {
205 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
207 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
208 ; GFX12-NEXT: s_wait_expcnt 0x0
209 ; GFX12-NEXT: s_wait_samplecnt 0x0
210 ; GFX12-NEXT: s_wait_bvhcnt 0x0
211 ; GFX12-NEXT: s_wait_kmcnt 0x0
212 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
213 ; GFX12-NEXT: s_wait_storecnt 0x0
214 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024
215 ; GFX12-NEXT: s_wait_storecnt 0x0
216 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
217 ; GFX12-NEXT: s_setpc_b64 s[30:31]
219 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
221 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
222 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
223 ; GFX940-NEXT: buffer_wbl2 sc1
224 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024
225 ; GFX940-NEXT: s_waitcnt vmcnt(0)
226 ; GFX940-NEXT: buffer_inv sc1
227 ; GFX940-NEXT: s_setpc_b64 s[30:31]
229 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
231 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
232 ; GFX11-NEXT: v_mov_b32_e32 v1, s16
233 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
234 ; GFX11-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024
235 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
236 ; GFX11-NEXT: buffer_gl1_inv
237 ; GFX11-NEXT: buffer_gl0_inv
238 ; GFX11-NEXT: s_setpc_b64 s[30:31]
240 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
242 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
243 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
244 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
245 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
246 ; GFX10-NEXT: s_mov_b32 s4, 0
247 ; GFX10-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
248 ; GFX10-NEXT: .LBB1_1: ; %atomicrmw.start
249 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
250 ; GFX10-NEXT: s_waitcnt vmcnt(0)
251 ; GFX10-NEXT: v_add_f32_e32 v1, v2, v0
252 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
253 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
254 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
255 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
256 ; GFX10-NEXT: s_waitcnt vmcnt(0)
257 ; GFX10-NEXT: buffer_gl1_inv
258 ; GFX10-NEXT: buffer_gl0_inv
259 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
260 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
261 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
262 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
263 ; GFX10-NEXT: s_cbranch_execnz .LBB1_1
264 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
265 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
266 ; GFX10-NEXT: s_setpc_b64 s[30:31]
268 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
270 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
271 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
272 ; GFX90A-NEXT: buffer_atomic_add_f32 v0, v1, s[16:19], 0 offen offset:1024
273 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
274 ; GFX90A-NEXT: buffer_wbinvl1
275 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
277 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
279 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
280 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
281 ; GFX908-NEXT: buffer_atomic_add_f32 v0, v1, s[16:19], 0 offen offset:1024
282 ; GFX908-NEXT: s_waitcnt vmcnt(0)
283 ; GFX908-NEXT: buffer_wbinvl1
284 ; GFX908-NEXT: s_setpc_b64 s[30:31]
286 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
288 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
289 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
290 ; GFX8-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
291 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
292 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
293 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
294 ; GFX8-NEXT: .LBB1_1: ; %atomicrmw.start
295 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
296 ; GFX8-NEXT: s_waitcnt vmcnt(0)
297 ; GFX8-NEXT: v_add_f32_e32 v1, v2, v0
298 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
299 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
300 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
301 ; GFX8-NEXT: s_waitcnt vmcnt(0)
302 ; GFX8-NEXT: buffer_wbinvl1
303 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
304 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
305 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
306 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
307 ; GFX8-NEXT: s_cbranch_execnz .LBB1_1
308 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
309 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
310 ; GFX8-NEXT: s_setpc_b64 s[30:31]
312 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
314 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
315 ; GFX7-NEXT: v_mov_b32_e32 v1, s20
316 ; GFX7-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
317 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
318 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
319 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
320 ; GFX7-NEXT: .LBB1_1: ; %atomicrmw.start
321 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
322 ; GFX7-NEXT: s_waitcnt vmcnt(0)
323 ; GFX7-NEXT: v_add_f32_e32 v1, v2, v0
324 ; GFX7-NEXT: v_mov_b32_e32 v5, v2
325 ; GFX7-NEXT: v_mov_b32_e32 v4, v1
326 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
327 ; GFX7-NEXT: s_waitcnt vmcnt(0)
328 ; GFX7-NEXT: buffer_wbinvl1
329 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
330 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
331 ; GFX7-NEXT: v_mov_b32_e32 v2, v4
332 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
333 ; GFX7-NEXT: s_cbranch_execnz .LBB1_1
334 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
335 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
336 ; GFX7-NEXT: s_setpc_b64 s[30:31]
338 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
340 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
341 ; GFX6-NEXT: v_mov_b32_e32 v1, s20
342 ; GFX6-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
343 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
344 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
345 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
346 ; GFX6-NEXT: .LBB1_1: ; %atomicrmw.start
347 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
348 ; GFX6-NEXT: s_waitcnt vmcnt(0)
349 ; GFX6-NEXT: v_add_f32_e32 v1, v2, v0
350 ; GFX6-NEXT: s_waitcnt expcnt(0)
351 ; GFX6-NEXT: v_mov_b32_e32 v5, v2
352 ; GFX6-NEXT: v_mov_b32_e32 v4, v1
353 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
354 ; GFX6-NEXT: s_waitcnt vmcnt(0)
355 ; GFX6-NEXT: buffer_wbinvl1
356 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
357 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
358 ; GFX6-NEXT: v_mov_b32_e32 v2, v4
359 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
360 ; GFX6-NEXT: s_cbranch_execnz .LBB1_1
361 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
362 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
363 ; GFX6-NEXT: s_waitcnt expcnt(0)
364 ; GFX6-NEXT: s_setpc_b64 s[30:31]
365 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
366 %unused = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0, !amdgpu.ignore.denormal.mode !0
370 define float @buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode(ptr addrspace(7) %ptr, float %val) #0 {
371 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
373 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
374 ; GFX12-NEXT: s_wait_expcnt 0x0
375 ; GFX12-NEXT: s_wait_samplecnt 0x0
376 ; GFX12-NEXT: s_wait_bvhcnt 0x0
377 ; GFX12-NEXT: s_wait_kmcnt 0x0
378 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
379 ; GFX12-NEXT: s_wait_storecnt 0x0
380 ; GFX12-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
381 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
382 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
383 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
384 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
385 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
386 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
387 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
388 ; GFX12-NEXT: s_wait_alu 0xfffe
389 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
390 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
391 ; GFX12-NEXT: s_wait_alu 0xfffe
392 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
393 ; GFX12-NEXT: s_wait_loadcnt 0x0
394 ; GFX12-NEXT: buffer_atomic_add_f32 v5, v4, s[4:7], null offen offset:1024 th:TH_ATOMIC_RETURN
395 ; GFX12-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
396 ; GFX12-NEXT: ; implicit-def: $vgpr4
397 ; GFX12-NEXT: s_wait_alu 0xfffe
398 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
399 ; GFX12-NEXT: s_cbranch_execnz .LBB2_1
400 ; GFX12-NEXT: ; %bb.2:
401 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
402 ; GFX12-NEXT: s_wait_loadcnt 0x0
403 ; GFX12-NEXT: v_mov_b32_e32 v0, v5
404 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
405 ; GFX12-NEXT: s_wait_alu 0xfffe
406 ; GFX12-NEXT: s_setpc_b64 s[30:31]
408 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
410 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
411 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
412 ; GFX940-NEXT: buffer_wbl2 sc1
413 ; GFX940-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
414 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
415 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
416 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
417 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
418 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
419 ; GFX940-NEXT: s_nop 0
420 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
421 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
422 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
423 ; GFX940-NEXT: s_waitcnt vmcnt(0)
424 ; GFX940-NEXT: buffer_atomic_add_f32 v5, v4, s[4:7], 0 offen offset:1024 sc0
425 ; GFX940-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
426 ; GFX940-NEXT: ; implicit-def: $vgpr4
427 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
428 ; GFX940-NEXT: s_cbranch_execnz .LBB2_1
429 ; GFX940-NEXT: ; %bb.2:
430 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
431 ; GFX940-NEXT: s_waitcnt vmcnt(0)
432 ; GFX940-NEXT: v_mov_b32_e32 v0, v5
433 ; GFX940-NEXT: buffer_inv sc1
434 ; GFX940-NEXT: s_setpc_b64 s[30:31]
436 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
438 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
439 ; GFX11-NEXT: s_mov_b32 s1, exec_lo
440 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
441 ; GFX11-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
442 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
443 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
444 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
445 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
446 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
447 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
448 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
449 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
450 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
451 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
452 ; GFX11-NEXT: s_waitcnt vmcnt(0)
453 ; GFX11-NEXT: buffer_atomic_add_f32 v5, v4, s[4:7], 0 offen offset:1024 glc
454 ; GFX11-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
455 ; GFX11-NEXT: ; implicit-def: $vgpr4
456 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
457 ; GFX11-NEXT: s_cbranch_execnz .LBB2_1
458 ; GFX11-NEXT: ; %bb.2:
459 ; GFX11-NEXT: s_mov_b32 exec_lo, s1
460 ; GFX11-NEXT: s_waitcnt vmcnt(0)
461 ; GFX11-NEXT: v_mov_b32_e32 v0, v5
462 ; GFX11-NEXT: buffer_gl1_inv
463 ; GFX11-NEXT: buffer_gl0_inv
464 ; GFX11-NEXT: s_setpc_b64 s[30:31]
466 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
468 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
469 ; GFX10-NEXT: v_add_nc_u32_e32 v9, 0x400, v4
470 ; GFX10-NEXT: s_mov_b32 s5, 0
471 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
472 ; GFX10-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
473 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
474 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
475 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
476 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
477 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
478 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
479 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
480 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
481 ; GFX10-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
482 ; GFX10-NEXT: ; implicit-def: $vgpr4
483 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
484 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
485 ; GFX10-NEXT: s_cbranch_execnz .LBB2_1
486 ; GFX10-NEXT: ; %bb.2:
487 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
488 ; GFX10-NEXT: .LBB2_3: ; %atomicrmw.start
489 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
490 ; GFX10-NEXT: ; Child Loop BB2_4 Depth 2
491 ; GFX10-NEXT: s_waitcnt vmcnt(0)
492 ; GFX10-NEXT: v_add_f32_e32 v7, v8, v5
493 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
494 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
495 ; GFX10-NEXT: v_mov_b32_e32 v6, v7
496 ; GFX10-NEXT: v_mov_b32_e32 v7, v8
497 ; GFX10-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
498 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
499 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
500 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
501 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
502 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
503 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
504 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
505 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
506 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
507 ; GFX10-NEXT: s_waitcnt vmcnt(0)
508 ; GFX10-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
509 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
510 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
511 ; GFX10-NEXT: s_cbranch_execnz .LBB2_4
512 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
513 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
514 ; GFX10-NEXT: s_waitcnt vmcnt(0)
515 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v6, v8
516 ; GFX10-NEXT: v_mov_b32_e32 v8, v6
517 ; GFX10-NEXT: buffer_gl1_inv
518 ; GFX10-NEXT: buffer_gl0_inv
519 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
520 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
521 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
522 ; GFX10-NEXT: s_cbranch_execnz .LBB2_3
523 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
524 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
525 ; GFX10-NEXT: v_mov_b32_e32 v0, v6
526 ; GFX10-NEXT: s_setpc_b64 s[30:31]
528 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
530 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
531 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
532 ; GFX90A-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
533 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
534 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
535 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
536 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
537 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
538 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
539 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
540 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
541 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
542 ; GFX90A-NEXT: buffer_atomic_add_f32 v5, v4, s[8:11], 0 offen offset:1024 glc
543 ; GFX90A-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
544 ; GFX90A-NEXT: ; implicit-def: $vgpr4
545 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
546 ; GFX90A-NEXT: s_cbranch_execnz .LBB2_1
547 ; GFX90A-NEXT: ; %bb.2:
548 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
549 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
550 ; GFX90A-NEXT: v_mov_b32_e32 v0, v5
551 ; GFX90A-NEXT: buffer_wbinvl1
552 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
554 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
556 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
557 ; GFX908-NEXT: v_add_u32_e32 v9, 0x400, v4
558 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
559 ; GFX908-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
560 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
561 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
562 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
563 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
564 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
565 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
566 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
567 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
568 ; GFX908-NEXT: s_nop 0
569 ; GFX908-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
570 ; GFX908-NEXT: ; implicit-def: $vgpr4
571 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
572 ; GFX908-NEXT: s_cbranch_execnz .LBB2_1
573 ; GFX908-NEXT: ; %bb.2:
574 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
575 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
576 ; GFX908-NEXT: .LBB2_3: ; %atomicrmw.start
577 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
578 ; GFX908-NEXT: ; Child Loop BB2_4 Depth 2
579 ; GFX908-NEXT: s_waitcnt vmcnt(0)
580 ; GFX908-NEXT: v_add_f32_e32 v7, v8, v5
581 ; GFX908-NEXT: v_mov_b32_e32 v6, v7
582 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
583 ; GFX908-NEXT: v_mov_b32_e32 v7, v8
584 ; GFX908-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
585 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
586 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
587 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
588 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
589 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
590 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
591 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
592 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
593 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
594 ; GFX908-NEXT: s_waitcnt vmcnt(0)
595 ; GFX908-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
596 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
597 ; GFX908-NEXT: s_cbranch_execnz .LBB2_4
598 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
599 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
600 ; GFX908-NEXT: s_waitcnt vmcnt(0)
601 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
602 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
603 ; GFX908-NEXT: v_mov_b32_e32 v8, v6
604 ; GFX908-NEXT: buffer_wbinvl1
605 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
606 ; GFX908-NEXT: s_cbranch_execnz .LBB2_3
607 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
608 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
609 ; GFX908-NEXT: v_mov_b32_e32 v0, v6
610 ; GFX908-NEXT: s_setpc_b64 s[30:31]
612 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
614 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
615 ; GFX8-NEXT: v_add_u32_e32 v9, vcc, 0x400, v4
616 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
617 ; GFX8-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
618 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
619 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
620 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
621 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
622 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
623 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
624 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
625 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
627 ; GFX8-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
628 ; GFX8-NEXT: ; implicit-def: $vgpr4
629 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
630 ; GFX8-NEXT: s_cbranch_execnz .LBB2_1
631 ; GFX8-NEXT: ; %bb.2:
632 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
633 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
634 ; GFX8-NEXT: .LBB2_3: ; %atomicrmw.start
635 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
636 ; GFX8-NEXT: ; Child Loop BB2_4 Depth 2
637 ; GFX8-NEXT: s_waitcnt vmcnt(0)
638 ; GFX8-NEXT: v_add_f32_e32 v7, v8, v5
639 ; GFX8-NEXT: v_mov_b32_e32 v6, v7
640 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
641 ; GFX8-NEXT: v_mov_b32_e32 v7, v8
642 ; GFX8-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
643 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
644 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
645 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
646 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
647 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
648 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
649 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
650 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
651 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
652 ; GFX8-NEXT: s_waitcnt vmcnt(0)
653 ; GFX8-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
654 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
655 ; GFX8-NEXT: s_cbranch_execnz .LBB2_4
656 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
657 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
658 ; GFX8-NEXT: s_waitcnt vmcnt(0)
659 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
660 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
661 ; GFX8-NEXT: v_mov_b32_e32 v8, v6
662 ; GFX8-NEXT: buffer_wbinvl1
663 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
664 ; GFX8-NEXT: s_cbranch_execnz .LBB2_3
665 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
666 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
667 ; GFX8-NEXT: v_mov_b32_e32 v0, v6
668 ; GFX8-NEXT: s_setpc_b64 s[30:31]
670 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
672 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
673 ; GFX7-NEXT: v_add_i32_e32 v9, vcc, 0x400, v4
674 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
675 ; GFX7-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
676 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
677 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
678 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
679 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
680 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
681 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
682 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
683 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
684 ; GFX7-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
685 ; GFX7-NEXT: ; implicit-def: $vgpr4
686 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
687 ; GFX7-NEXT: s_cbranch_execnz .LBB2_1
688 ; GFX7-NEXT: ; %bb.2:
689 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
690 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
691 ; GFX7-NEXT: .LBB2_3: ; %atomicrmw.start
692 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
693 ; GFX7-NEXT: ; Child Loop BB2_4 Depth 2
694 ; GFX7-NEXT: s_waitcnt vmcnt(0)
695 ; GFX7-NEXT: v_add_f32_e32 v7, v8, v5
696 ; GFX7-NEXT: v_mov_b32_e32 v6, v7
697 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
698 ; GFX7-NEXT: v_mov_b32_e32 v7, v8
699 ; GFX7-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
700 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
701 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
702 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
703 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
704 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
705 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
706 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
707 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
708 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
709 ; GFX7-NEXT: s_waitcnt vmcnt(0)
710 ; GFX7-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
711 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
712 ; GFX7-NEXT: s_cbranch_execnz .LBB2_4
713 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
714 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
715 ; GFX7-NEXT: s_waitcnt vmcnt(0)
716 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
717 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
718 ; GFX7-NEXT: v_mov_b32_e32 v8, v6
719 ; GFX7-NEXT: buffer_wbinvl1
720 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
721 ; GFX7-NEXT: s_cbranch_execnz .LBB2_3
722 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
723 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
724 ; GFX7-NEXT: v_mov_b32_e32 v0, v6
725 ; GFX7-NEXT: s_setpc_b64 s[30:31]
727 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__waterfall__amdgpu_no_fine_grained_memory__amdgpu_ignore_denormal_mode:
729 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
730 ; GFX6-NEXT: v_add_i32_e32 v9, vcc, 0x400, v4
731 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
732 ; GFX6-NEXT: .LBB2_1: ; =>This Inner Loop Header: Depth=1
733 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
734 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
735 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
736 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
737 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
738 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
739 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
740 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
741 ; GFX6-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
742 ; GFX6-NEXT: ; implicit-def: $vgpr4
743 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
744 ; GFX6-NEXT: s_cbranch_execnz .LBB2_1
745 ; GFX6-NEXT: ; %bb.2:
746 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
747 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
748 ; GFX6-NEXT: .LBB2_3: ; %atomicrmw.start
749 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
750 ; GFX6-NEXT: ; Child Loop BB2_4 Depth 2
751 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
752 ; GFX6-NEXT: v_add_f32_e32 v7, v8, v5
753 ; GFX6-NEXT: v_mov_b32_e32 v6, v7
754 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
755 ; GFX6-NEXT: v_mov_b32_e32 v7, v8
756 ; GFX6-NEXT: .LBB2_4: ; Parent Loop BB2_3 Depth=1
757 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
758 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
759 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
760 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
761 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
762 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
763 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
764 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
765 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
766 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
767 ; GFX6-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
768 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
769 ; GFX6-NEXT: s_cbranch_execnz .LBB2_4
770 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB2_3 Depth=1
771 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
772 ; GFX6-NEXT: s_waitcnt vmcnt(0)
773 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
774 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
775 ; GFX6-NEXT: v_mov_b32_e32 v8, v6
776 ; GFX6-NEXT: buffer_wbinvl1
777 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
778 ; GFX6-NEXT: s_cbranch_execnz .LBB2_3
779 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
780 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
781 ; GFX6-NEXT: v_mov_b32_e32 v0, v6
782 ; GFX6-NEXT: s_waitcnt expcnt(0)
783 ; GFX6-NEXT: s_setpc_b64 s[30:31]
784 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
785 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0, !amdgpu.ignore.denormal.mode !0
789 define float @buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, float %val) #0 {
790 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
792 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
793 ; GFX12-NEXT: s_wait_expcnt 0x0
794 ; GFX12-NEXT: s_wait_samplecnt 0x0
795 ; GFX12-NEXT: s_wait_bvhcnt 0x0
796 ; GFX12-NEXT: s_wait_kmcnt 0x0
797 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
798 ; GFX12-NEXT: s_wait_storecnt 0x0
799 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
800 ; GFX12-NEXT: s_wait_loadcnt 0x0
801 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
802 ; GFX12-NEXT: s_setpc_b64 s[30:31]
804 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
806 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
807 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
808 ; GFX940-NEXT: buffer_wbl2 sc1
809 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 sc0
810 ; GFX940-NEXT: s_waitcnt vmcnt(0)
811 ; GFX940-NEXT: buffer_inv sc1
812 ; GFX940-NEXT: s_setpc_b64 s[30:31]
814 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
816 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
817 ; GFX11-NEXT: v_mov_b32_e32 v1, s16
818 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
819 ; GFX11-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 glc
820 ; GFX11-NEXT: s_waitcnt vmcnt(0)
821 ; GFX11-NEXT: buffer_gl1_inv
822 ; GFX11-NEXT: buffer_gl0_inv
823 ; GFX11-NEXT: s_setpc_b64 s[30:31]
825 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
827 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
828 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
829 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
830 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
831 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
832 ; GFX10-NEXT: s_mov_b32 s4, 0
833 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
834 ; GFX10-NEXT: .LBB3_1: ; %atomicrmw.start
835 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
836 ; GFX10-NEXT: s_waitcnt vmcnt(0)
837 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
838 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
839 ; GFX10-NEXT: v_add_f32_e32 v4, v5, v2
840 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
841 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
842 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
843 ; GFX10-NEXT: s_waitcnt vmcnt(0)
844 ; GFX10-NEXT: buffer_gl1_inv
845 ; GFX10-NEXT: buffer_gl0_inv
846 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
847 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
848 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
849 ; GFX10-NEXT: s_cbranch_execnz .LBB3_1
850 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
851 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
852 ; GFX10-NEXT: s_setpc_b64 s[30:31]
854 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
856 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
857 ; GFX90A-NEXT: v_mov_b32_e32 v2, v0
858 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
859 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
860 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
861 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
862 ; GFX90A-NEXT: v_mov_b32_e32 v3, s6
863 ; GFX90A-NEXT: .LBB3_1: ; %atomicrmw.start
864 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
865 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
866 ; GFX90A-NEXT: v_mov_b32_e32 v5, v0
867 ; GFX90A-NEXT: v_add_f32_e32 v4, v5, v2
868 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[4:5], v[4:5] op_sel:[0,1]
869 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
870 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
871 ; GFX90A-NEXT: buffer_wbinvl1
872 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
873 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
874 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
875 ; GFX90A-NEXT: s_cbranch_execnz .LBB3_1
876 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
877 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
878 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
880 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
882 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
883 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
884 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
885 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
886 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
887 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
888 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
889 ; GFX908-NEXT: .LBB3_1: ; %atomicrmw.start
890 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
891 ; GFX908-NEXT: s_waitcnt vmcnt(0)
892 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
893 ; GFX908-NEXT: v_add_f32_e32 v4, v5, v2
894 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
895 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
896 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
897 ; GFX908-NEXT: s_waitcnt vmcnt(0)
898 ; GFX908-NEXT: buffer_wbinvl1
899 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
900 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
901 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
902 ; GFX908-NEXT: s_cbranch_execnz .LBB3_1
903 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
904 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
905 ; GFX908-NEXT: s_setpc_b64 s[30:31]
907 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
909 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
910 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
911 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
912 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
913 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
914 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
915 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
916 ; GFX8-NEXT: .LBB3_1: ; %atomicrmw.start
917 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
918 ; GFX8-NEXT: s_waitcnt vmcnt(0)
919 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
920 ; GFX8-NEXT: v_add_f32_e32 v4, v5, v2
921 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
922 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
923 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
924 ; GFX8-NEXT: s_waitcnt vmcnt(0)
925 ; GFX8-NEXT: buffer_wbinvl1
926 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
927 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
928 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
929 ; GFX8-NEXT: s_cbranch_execnz .LBB3_1
930 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
931 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
932 ; GFX8-NEXT: s_setpc_b64 s[30:31]
934 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
936 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
937 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
938 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
939 ; GFX7-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
940 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
941 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
942 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
943 ; GFX7-NEXT: .LBB3_1: ; %atomicrmw.start
944 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
945 ; GFX7-NEXT: s_waitcnt vmcnt(0)
946 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
947 ; GFX7-NEXT: v_add_f32_e32 v4, v5, v2
948 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
949 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
950 ; GFX7-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
951 ; GFX7-NEXT: s_waitcnt vmcnt(0)
952 ; GFX7-NEXT: buffer_wbinvl1
953 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
954 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
955 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
956 ; GFX7-NEXT: s_cbranch_execnz .LBB3_1
957 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
958 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
959 ; GFX7-NEXT: s_setpc_b64 s[30:31]
961 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
963 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
964 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
965 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
966 ; GFX6-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
967 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
968 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
969 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
970 ; GFX6-NEXT: .LBB3_1: ; %atomicrmw.start
971 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
972 ; GFX6-NEXT: s_waitcnt vmcnt(0)
973 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
974 ; GFX6-NEXT: v_add_f32_e32 v4, v5, v2
975 ; GFX6-NEXT: s_waitcnt expcnt(0)
976 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
977 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
978 ; GFX6-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
979 ; GFX6-NEXT: s_waitcnt vmcnt(0)
980 ; GFX6-NEXT: buffer_wbinvl1
981 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
982 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
983 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
984 ; GFX6-NEXT: s_cbranch_execnz .LBB3_1
985 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
986 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
987 ; GFX6-NEXT: s_waitcnt expcnt(0)
988 ; GFX6-NEXT: s_setpc_b64 s[30:31]
989 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
990 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
994 define void @buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, float %val) #0 {
995 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
997 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
998 ; GFX12-NEXT: s_wait_expcnt 0x0
999 ; GFX12-NEXT: s_wait_samplecnt 0x0
1000 ; GFX12-NEXT: s_wait_bvhcnt 0x0
1001 ; GFX12-NEXT: s_wait_kmcnt 0x0
1002 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
1003 ; GFX12-NEXT: s_wait_storecnt 0x0
1004 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024
1005 ; GFX12-NEXT: s_wait_storecnt 0x0
1006 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
1007 ; GFX12-NEXT: s_setpc_b64 s[30:31]
1009 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
1011 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1012 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
1013 ; GFX940-NEXT: buffer_wbl2 sc1
1014 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024
1015 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1016 ; GFX940-NEXT: buffer_inv sc1
1017 ; GFX940-NEXT: s_setpc_b64 s[30:31]
1019 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
1021 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1022 ; GFX11-NEXT: v_mov_b32_e32 v1, s16
1023 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1024 ; GFX11-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024
1025 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1026 ; GFX11-NEXT: buffer_gl1_inv
1027 ; GFX11-NEXT: buffer_gl0_inv
1028 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1030 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
1032 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1033 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
1034 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
1035 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
1036 ; GFX10-NEXT: s_mov_b32 s4, 0
1037 ; GFX10-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
1038 ; GFX10-NEXT: .LBB4_1: ; %atomicrmw.start
1039 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
1040 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1041 ; GFX10-NEXT: v_add_f32_e32 v1, v2, v0
1042 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
1043 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1044 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
1045 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
1046 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1047 ; GFX10-NEXT: buffer_gl1_inv
1048 ; GFX10-NEXT: buffer_gl0_inv
1049 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
1050 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
1051 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
1052 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
1053 ; GFX10-NEXT: s_cbranch_execnz .LBB4_1
1054 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
1055 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
1056 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1058 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
1060 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1061 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
1062 ; GFX90A-NEXT: buffer_load_dword v3, v1, s[16:19], 0 offen offset:1024
1063 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
1064 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
1065 ; GFX90A-NEXT: v_mov_b32_e32 v1, s6
1066 ; GFX90A-NEXT: .LBB4_1: ; %atomicrmw.start
1067 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
1068 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1069 ; GFX90A-NEXT: v_add_f32_e32 v2, v3, v0
1070 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[2:3], v[2:3] op_sel:[0,1]
1071 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[16:19], 0 offen glc
1072 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1073 ; GFX90A-NEXT: buffer_wbinvl1
1074 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
1075 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1076 ; GFX90A-NEXT: v_mov_b32_e32 v3, v4
1077 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
1078 ; GFX90A-NEXT: s_cbranch_execnz .LBB4_1
1079 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
1080 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
1081 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
1083 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
1085 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1086 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
1087 ; GFX908-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
1088 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
1089 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
1090 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
1091 ; GFX908-NEXT: .LBB4_1: ; %atomicrmw.start
1092 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
1093 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1094 ; GFX908-NEXT: v_add_f32_e32 v1, v2, v0
1095 ; GFX908-NEXT: v_mov_b32_e32 v5, v2
1096 ; GFX908-NEXT: v_mov_b32_e32 v4, v1
1097 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
1098 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1099 ; GFX908-NEXT: buffer_wbinvl1
1100 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
1101 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1102 ; GFX908-NEXT: v_mov_b32_e32 v2, v4
1103 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
1104 ; GFX908-NEXT: s_cbranch_execnz .LBB4_1
1105 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
1106 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
1107 ; GFX908-NEXT: s_setpc_b64 s[30:31]
1109 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
1111 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1112 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
1113 ; GFX8-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
1114 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
1115 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
1116 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
1117 ; GFX8-NEXT: .LBB4_1: ; %atomicrmw.start
1118 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
1119 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1120 ; GFX8-NEXT: v_add_f32_e32 v1, v2, v0
1121 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
1122 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
1123 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
1124 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1125 ; GFX8-NEXT: buffer_wbinvl1
1126 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
1127 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1128 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
1129 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
1130 ; GFX8-NEXT: s_cbranch_execnz .LBB4_1
1131 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
1132 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
1133 ; GFX8-NEXT: s_setpc_b64 s[30:31]
1135 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
1137 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1138 ; GFX7-NEXT: v_mov_b32_e32 v1, s20
1139 ; GFX7-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
1140 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
1141 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
1142 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
1143 ; GFX7-NEXT: .LBB4_1: ; %atomicrmw.start
1144 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
1145 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1146 ; GFX7-NEXT: v_add_f32_e32 v1, v2, v0
1147 ; GFX7-NEXT: v_mov_b32_e32 v5, v2
1148 ; GFX7-NEXT: v_mov_b32_e32 v4, v1
1149 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
1150 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1151 ; GFX7-NEXT: buffer_wbinvl1
1152 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
1153 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1154 ; GFX7-NEXT: v_mov_b32_e32 v2, v4
1155 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
1156 ; GFX7-NEXT: s_cbranch_execnz .LBB4_1
1157 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
1158 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
1159 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1161 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f32__offset__amdgpu_no_fine_grained_memory:
1163 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1164 ; GFX6-NEXT: v_mov_b32_e32 v1, s20
1165 ; GFX6-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
1166 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
1167 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
1168 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
1169 ; GFX6-NEXT: .LBB4_1: ; %atomicrmw.start
1170 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
1171 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1172 ; GFX6-NEXT: v_add_f32_e32 v1, v2, v0
1173 ; GFX6-NEXT: s_waitcnt expcnt(0)
1174 ; GFX6-NEXT: v_mov_b32_e32 v5, v2
1175 ; GFX6-NEXT: v_mov_b32_e32 v4, v1
1176 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
1177 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1178 ; GFX6-NEXT: buffer_wbinvl1
1179 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
1180 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1181 ; GFX6-NEXT: v_mov_b32_e32 v2, v4
1182 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
1183 ; GFX6-NEXT: s_cbranch_execnz .LBB4_1
1184 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
1185 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
1186 ; GFX6-NEXT: s_waitcnt expcnt(0)
1187 ; GFX6-NEXT: s_setpc_b64 s[30:31]
1188 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
1189 %unused = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
1193 define float @buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset(ptr addrspace(7) inreg %ptr, float %val) {
1194 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1196 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
1197 ; GFX12-NEXT: s_wait_expcnt 0x0
1198 ; GFX12-NEXT: s_wait_samplecnt 0x0
1199 ; GFX12-NEXT: s_wait_bvhcnt 0x0
1200 ; GFX12-NEXT: s_wait_kmcnt 0x0
1201 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
1202 ; GFX12-NEXT: s_wait_storecnt 0x0
1203 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
1204 ; GFX12-NEXT: s_wait_loadcnt 0x0
1205 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
1206 ; GFX12-NEXT: s_setpc_b64 s[30:31]
1208 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1210 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1211 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
1212 ; GFX940-NEXT: buffer_wbl2 sc1
1213 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 sc0
1214 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1215 ; GFX940-NEXT: buffer_inv sc1
1216 ; GFX940-NEXT: s_setpc_b64 s[30:31]
1218 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1220 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1221 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
1222 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1223 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
1224 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
1225 ; GFX11-NEXT: s_mov_b32 s4, 0
1226 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
1227 ; GFX11-NEXT: .LBB5_1: ; %atomicrmw.start
1228 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
1229 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1230 ; GFX11-NEXT: v_mov_b32_e32 v5, v0
1231 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1232 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1233 ; GFX11-NEXT: v_add_f32_e32 v4, v5, v2
1234 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
1235 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], 0 offen glc
1236 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1237 ; GFX11-NEXT: buffer_gl1_inv
1238 ; GFX11-NEXT: buffer_gl0_inv
1239 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
1240 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
1241 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1242 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
1243 ; GFX11-NEXT: s_cbranch_execnz .LBB5_1
1244 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
1245 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
1246 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1248 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1250 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1251 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
1252 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
1253 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
1254 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
1255 ; GFX10-NEXT: s_mov_b32 s4, 0
1256 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1257 ; GFX10-NEXT: .LBB5_1: ; %atomicrmw.start
1258 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
1259 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1260 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
1261 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1262 ; GFX10-NEXT: v_add_f32_e32 v4, v5, v2
1263 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
1264 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
1265 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1266 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1267 ; GFX10-NEXT: buffer_gl1_inv
1268 ; GFX10-NEXT: buffer_gl0_inv
1269 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
1270 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
1271 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
1272 ; GFX10-NEXT: s_cbranch_execnz .LBB5_1
1273 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
1274 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
1275 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1277 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1279 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1280 ; GFX90A-NEXT: v_mov_b32_e32 v2, v0
1281 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
1282 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1283 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
1284 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
1285 ; GFX90A-NEXT: v_mov_b32_e32 v3, s6
1286 ; GFX90A-NEXT: .LBB5_1: ; %atomicrmw.start
1287 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
1288 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1289 ; GFX90A-NEXT: v_mov_b32_e32 v5, v0
1290 ; GFX90A-NEXT: v_add_f32_e32 v4, v5, v2
1291 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[4:5], v[4:5] op_sel:[0,1]
1292 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1293 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1294 ; GFX90A-NEXT: buffer_wbinvl1
1295 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1296 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1297 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
1298 ; GFX90A-NEXT: s_cbranch_execnz .LBB5_1
1299 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
1300 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
1301 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
1303 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1305 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1306 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
1307 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
1308 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1309 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
1310 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
1311 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
1312 ; GFX908-NEXT: .LBB5_1: ; %atomicrmw.start
1313 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
1314 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1315 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
1316 ; GFX908-NEXT: v_add_f32_e32 v4, v5, v2
1317 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
1318 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
1319 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1320 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1321 ; GFX908-NEXT: buffer_wbinvl1
1322 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1323 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1324 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
1325 ; GFX908-NEXT: s_cbranch_execnz .LBB5_1
1326 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
1327 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
1328 ; GFX908-NEXT: s_setpc_b64 s[30:31]
1330 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1332 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1333 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
1334 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
1335 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1336 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
1337 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
1338 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
1339 ; GFX8-NEXT: .LBB5_1: ; %atomicrmw.start
1340 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
1341 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1342 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
1343 ; GFX8-NEXT: v_add_f32_e32 v4, v5, v2
1344 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
1345 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
1346 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1347 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1348 ; GFX8-NEXT: buffer_wbinvl1
1349 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1350 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1351 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
1352 ; GFX8-NEXT: s_cbranch_execnz .LBB5_1
1353 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
1354 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
1355 ; GFX8-NEXT: s_setpc_b64 s[30:31]
1357 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1359 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1360 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
1361 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
1362 ; GFX7-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1363 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
1364 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
1365 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
1366 ; GFX7-NEXT: .LBB5_1: ; %atomicrmw.start
1367 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
1368 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1369 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
1370 ; GFX7-NEXT: v_add_f32_e32 v4, v5, v2
1371 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
1372 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
1373 ; GFX7-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1374 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1375 ; GFX7-NEXT: buffer_wbinvl1
1376 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1377 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1378 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
1379 ; GFX7-NEXT: s_cbranch_execnz .LBB5_1
1380 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
1381 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
1382 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1384 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset:
1386 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1387 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
1388 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
1389 ; GFX6-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1390 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
1391 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
1392 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
1393 ; GFX6-NEXT: .LBB5_1: ; %atomicrmw.start
1394 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
1395 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1396 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
1397 ; GFX6-NEXT: v_add_f32_e32 v4, v5, v2
1398 ; GFX6-NEXT: s_waitcnt expcnt(0)
1399 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
1400 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
1401 ; GFX6-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1402 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1403 ; GFX6-NEXT: buffer_wbinvl1
1404 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1405 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1406 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
1407 ; GFX6-NEXT: s_cbranch_execnz .LBB5_1
1408 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
1409 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
1410 ; GFX6-NEXT: s_waitcnt expcnt(0)
1411 ; GFX6-NEXT: s_setpc_b64 s[30:31]
1412 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
1413 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst
1417 define float @buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory(ptr addrspace(7) inreg %ptr, float %val) #0 {
1418 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1420 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
1421 ; GFX12-NEXT: s_wait_expcnt 0x0
1422 ; GFX12-NEXT: s_wait_samplecnt 0x0
1423 ; GFX12-NEXT: s_wait_bvhcnt 0x0
1424 ; GFX12-NEXT: s_wait_kmcnt 0x0
1425 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
1426 ; GFX12-NEXT: s_wait_storecnt 0x0
1427 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
1428 ; GFX12-NEXT: s_wait_loadcnt 0x0
1429 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
1430 ; GFX12-NEXT: s_setpc_b64 s[30:31]
1432 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1434 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1435 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
1436 ; GFX940-NEXT: buffer_wbl2 sc1
1437 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 sc0
1438 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1439 ; GFX940-NEXT: buffer_inv sc1
1440 ; GFX940-NEXT: s_setpc_b64 s[30:31]
1442 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1444 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1445 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
1446 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1447 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
1448 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
1449 ; GFX11-NEXT: s_mov_b32 s4, 0
1450 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
1451 ; GFX11-NEXT: .LBB6_1: ; %atomicrmw.start
1452 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
1453 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1454 ; GFX11-NEXT: v_mov_b32_e32 v5, v0
1455 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1456 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1457 ; GFX11-NEXT: v_add_f32_e32 v4, v5, v2
1458 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
1459 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], 0 offen glc
1460 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1461 ; GFX11-NEXT: buffer_gl1_inv
1462 ; GFX11-NEXT: buffer_gl0_inv
1463 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
1464 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
1465 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1466 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
1467 ; GFX11-NEXT: s_cbranch_execnz .LBB6_1
1468 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
1469 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
1470 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1472 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1474 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1475 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
1476 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
1477 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
1478 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
1479 ; GFX10-NEXT: s_mov_b32 s4, 0
1480 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1481 ; GFX10-NEXT: .LBB6_1: ; %atomicrmw.start
1482 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
1483 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1484 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
1485 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1486 ; GFX10-NEXT: v_add_f32_e32 v4, v5, v2
1487 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
1488 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
1489 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1490 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1491 ; GFX10-NEXT: buffer_gl1_inv
1492 ; GFX10-NEXT: buffer_gl0_inv
1493 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
1494 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
1495 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
1496 ; GFX10-NEXT: s_cbranch_execnz .LBB6_1
1497 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
1498 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
1499 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1501 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1503 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1504 ; GFX90A-NEXT: v_mov_b32_e32 v2, v0
1505 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
1506 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1507 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
1508 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
1509 ; GFX90A-NEXT: v_mov_b32_e32 v3, s6
1510 ; GFX90A-NEXT: .LBB6_1: ; %atomicrmw.start
1511 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
1512 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1513 ; GFX90A-NEXT: v_mov_b32_e32 v5, v0
1514 ; GFX90A-NEXT: v_add_f32_e32 v4, v5, v2
1515 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[4:5], v[4:5] op_sel:[0,1]
1516 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1517 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1518 ; GFX90A-NEXT: buffer_wbinvl1
1519 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1520 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1521 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
1522 ; GFX90A-NEXT: s_cbranch_execnz .LBB6_1
1523 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
1524 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
1525 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
1527 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1529 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1530 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
1531 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
1532 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1533 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
1534 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
1535 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
1536 ; GFX908-NEXT: .LBB6_1: ; %atomicrmw.start
1537 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
1538 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1539 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
1540 ; GFX908-NEXT: v_add_f32_e32 v4, v5, v2
1541 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
1542 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
1543 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1544 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1545 ; GFX908-NEXT: buffer_wbinvl1
1546 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1547 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1548 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
1549 ; GFX908-NEXT: s_cbranch_execnz .LBB6_1
1550 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
1551 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
1552 ; GFX908-NEXT: s_setpc_b64 s[30:31]
1554 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1556 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1557 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
1558 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
1559 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1560 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
1561 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
1562 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
1563 ; GFX8-NEXT: .LBB6_1: ; %atomicrmw.start
1564 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
1565 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1566 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
1567 ; GFX8-NEXT: v_add_f32_e32 v4, v5, v2
1568 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
1569 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
1570 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1571 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1572 ; GFX8-NEXT: buffer_wbinvl1
1573 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1574 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1575 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
1576 ; GFX8-NEXT: s_cbranch_execnz .LBB6_1
1577 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
1578 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
1579 ; GFX8-NEXT: s_setpc_b64 s[30:31]
1581 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1583 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1584 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
1585 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
1586 ; GFX7-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1587 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
1588 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
1589 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
1590 ; GFX7-NEXT: .LBB6_1: ; %atomicrmw.start
1591 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
1592 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1593 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
1594 ; GFX7-NEXT: v_add_f32_e32 v4, v5, v2
1595 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
1596 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
1597 ; GFX7-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1598 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1599 ; GFX7-NEXT: buffer_wbinvl1
1600 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1601 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1602 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
1603 ; GFX7-NEXT: s_cbranch_execnz .LBB6_1
1604 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
1605 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
1606 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1608 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory:
1610 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1611 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
1612 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
1613 ; GFX6-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1614 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
1615 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
1616 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
1617 ; GFX6-NEXT: .LBB6_1: ; %atomicrmw.start
1618 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
1619 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1620 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
1621 ; GFX6-NEXT: v_add_f32_e32 v4, v5, v2
1622 ; GFX6-NEXT: s_waitcnt expcnt(0)
1623 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
1624 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
1625 ; GFX6-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1626 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1627 ; GFX6-NEXT: buffer_wbinvl1
1628 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1629 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1630 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
1631 ; GFX6-NEXT: s_cbranch_execnz .LBB6_1
1632 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
1633 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
1634 ; GFX6-NEXT: s_waitcnt expcnt(0)
1635 ; GFX6-NEXT: s_setpc_b64 s[30:31]
1636 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
1637 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst, !amdgpu.no.remote.memory !0
1641 define float @buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode(ptr addrspace(7) inreg %ptr, float %val) #0 {
1642 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1644 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
1645 ; GFX12-NEXT: s_wait_expcnt 0x0
1646 ; GFX12-NEXT: s_wait_samplecnt 0x0
1647 ; GFX12-NEXT: s_wait_bvhcnt 0x0
1648 ; GFX12-NEXT: s_wait_kmcnt 0x0
1649 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
1650 ; GFX12-NEXT: s_wait_storecnt 0x0
1651 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
1652 ; GFX12-NEXT: s_wait_loadcnt 0x0
1653 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
1654 ; GFX12-NEXT: s_setpc_b64 s[30:31]
1656 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1658 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1659 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
1660 ; GFX940-NEXT: buffer_wbl2 sc1
1661 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 sc0
1662 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1663 ; GFX940-NEXT: buffer_inv sc1
1664 ; GFX940-NEXT: s_setpc_b64 s[30:31]
1666 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1668 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1669 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
1670 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1671 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
1672 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
1673 ; GFX11-NEXT: s_mov_b32 s4, 0
1674 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
1675 ; GFX11-NEXT: .LBB7_1: ; %atomicrmw.start
1676 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
1677 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1678 ; GFX11-NEXT: v_mov_b32_e32 v5, v0
1679 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1680 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1681 ; GFX11-NEXT: v_add_f32_e32 v4, v5, v2
1682 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
1683 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], 0 offen glc
1684 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1685 ; GFX11-NEXT: buffer_gl1_inv
1686 ; GFX11-NEXT: buffer_gl0_inv
1687 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
1688 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
1689 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1690 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
1691 ; GFX11-NEXT: s_cbranch_execnz .LBB7_1
1692 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
1693 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
1694 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1696 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1698 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1699 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
1700 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
1701 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
1702 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
1703 ; GFX10-NEXT: s_mov_b32 s4, 0
1704 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1705 ; GFX10-NEXT: .LBB7_1: ; %atomicrmw.start
1706 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
1707 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1708 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
1709 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1710 ; GFX10-NEXT: v_add_f32_e32 v4, v5, v2
1711 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
1712 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
1713 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1714 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1715 ; GFX10-NEXT: buffer_gl1_inv
1716 ; GFX10-NEXT: buffer_gl0_inv
1717 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
1718 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
1719 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
1720 ; GFX10-NEXT: s_cbranch_execnz .LBB7_1
1721 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
1722 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
1723 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1725 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1727 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1728 ; GFX90A-NEXT: v_mov_b32_e32 v2, v0
1729 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
1730 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1731 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
1732 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
1733 ; GFX90A-NEXT: v_mov_b32_e32 v3, s6
1734 ; GFX90A-NEXT: .LBB7_1: ; %atomicrmw.start
1735 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
1736 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1737 ; GFX90A-NEXT: v_mov_b32_e32 v5, v0
1738 ; GFX90A-NEXT: v_add_f32_e32 v4, v5, v2
1739 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[4:5], v[4:5] op_sel:[0,1]
1740 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1741 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1742 ; GFX90A-NEXT: buffer_wbinvl1
1743 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1744 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1745 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
1746 ; GFX90A-NEXT: s_cbranch_execnz .LBB7_1
1747 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
1748 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
1749 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
1751 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1753 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1754 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
1755 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
1756 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1757 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
1758 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
1759 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
1760 ; GFX908-NEXT: .LBB7_1: ; %atomicrmw.start
1761 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
1762 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1763 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
1764 ; GFX908-NEXT: v_add_f32_e32 v4, v5, v2
1765 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
1766 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
1767 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1768 ; GFX908-NEXT: s_waitcnt vmcnt(0)
1769 ; GFX908-NEXT: buffer_wbinvl1
1770 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1771 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1772 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
1773 ; GFX908-NEXT: s_cbranch_execnz .LBB7_1
1774 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
1775 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
1776 ; GFX908-NEXT: s_setpc_b64 s[30:31]
1778 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1780 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1781 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
1782 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
1783 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1784 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
1785 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
1786 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
1787 ; GFX8-NEXT: .LBB7_1: ; %atomicrmw.start
1788 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
1789 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1790 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
1791 ; GFX8-NEXT: v_add_f32_e32 v4, v5, v2
1792 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
1793 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
1794 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1795 ; GFX8-NEXT: s_waitcnt vmcnt(0)
1796 ; GFX8-NEXT: buffer_wbinvl1
1797 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1798 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1799 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
1800 ; GFX8-NEXT: s_cbranch_execnz .LBB7_1
1801 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
1802 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
1803 ; GFX8-NEXT: s_setpc_b64 s[30:31]
1805 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1807 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1808 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
1809 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
1810 ; GFX7-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1811 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
1812 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
1813 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
1814 ; GFX7-NEXT: .LBB7_1: ; %atomicrmw.start
1815 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
1816 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1817 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
1818 ; GFX7-NEXT: v_add_f32_e32 v4, v5, v2
1819 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
1820 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
1821 ; GFX7-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1822 ; GFX7-NEXT: s_waitcnt vmcnt(0)
1823 ; GFX7-NEXT: buffer_wbinvl1
1824 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1825 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1826 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
1827 ; GFX7-NEXT: s_cbranch_execnz .LBB7_1
1828 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
1829 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
1830 ; GFX7-NEXT: s_setpc_b64 s[30:31]
1832 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f32__offset__amdgpu_no_remote_memory__amdgpu_ignore_denormal_mode:
1834 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1835 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
1836 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
1837 ; GFX6-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
1838 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
1839 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
1840 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
1841 ; GFX6-NEXT: .LBB7_1: ; %atomicrmw.start
1842 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
1843 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1844 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
1845 ; GFX6-NEXT: v_add_f32_e32 v4, v5, v2
1846 ; GFX6-NEXT: s_waitcnt expcnt(0)
1847 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
1848 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
1849 ; GFX6-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
1850 ; GFX6-NEXT: s_waitcnt vmcnt(0)
1851 ; GFX6-NEXT: buffer_wbinvl1
1852 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
1853 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
1854 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
1855 ; GFX6-NEXT: s_cbranch_execnz .LBB7_1
1856 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
1857 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
1858 ; GFX6-NEXT: s_waitcnt expcnt(0)
1859 ; GFX6-NEXT: s_setpc_b64 s[30:31]
1860 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
1861 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val syncscope("agent") seq_cst, !amdgpu.no.remote.memory !0, !amdgpu.ignore.denormal.mode !0
1865 ; --------------------------------------------------------------------
1867 ; --------------------------------------------------------------------
1869 define double @buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, double %val) #0 {
1870 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
1872 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
1873 ; GFX12-NEXT: s_wait_expcnt 0x0
1874 ; GFX12-NEXT: s_wait_samplecnt 0x0
1875 ; GFX12-NEXT: s_wait_bvhcnt 0x0
1876 ; GFX12-NEXT: s_wait_kmcnt 0x0
1877 ; GFX12-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
1878 ; GFX12-NEXT: v_mov_b32_e32 v0, s16
1879 ; GFX12-NEXT: s_add_co_i32 s4, s16, 0x800
1880 ; GFX12-NEXT: s_wait_alu 0xfffe
1881 ; GFX12-NEXT: v_mov_b32_e32 v6, s4
1882 ; GFX12-NEXT: s_mov_b32 s4, 0
1883 ; GFX12-NEXT: buffer_load_b64 v[0:1], v0, s[0:3], null offen offset:2048
1884 ; GFX12-NEXT: .LBB8_1: ; %atomicrmw.start
1885 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
1886 ; GFX12-NEXT: s_wait_loadcnt 0x0
1887 ; GFX12-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
1888 ; GFX12-NEXT: s_wait_storecnt 0x0
1889 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1890 ; GFX12-NEXT: v_add_f64_e32 v[7:8], v[9:10], v[4:5]
1891 ; GFX12-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
1892 ; GFX12-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
1893 ; GFX12-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v6, s[0:3], null offen th:TH_ATOMIC_RETURN
1894 ; GFX12-NEXT: s_wait_loadcnt 0x0
1895 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
1896 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
1897 ; GFX12-NEXT: s_wait_alu 0xfffe
1898 ; GFX12-NEXT: s_or_b32 s4, vcc_lo, s4
1899 ; GFX12-NEXT: s_wait_alu 0xfffe
1900 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
1901 ; GFX12-NEXT: s_cbranch_execnz .LBB8_1
1902 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
1903 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s4
1904 ; GFX12-NEXT: s_wait_alu 0xfffe
1905 ; GFX12-NEXT: s_setpc_b64 s[30:31]
1907 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
1909 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1910 ; GFX940-NEXT: v_mov_b32_e32 v2, s16
1911 ; GFX940-NEXT: buffer_wbl2 sc1
1912 ; GFX940-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[0:3], 0 offen offset:2048 sc0
1913 ; GFX940-NEXT: s_waitcnt vmcnt(0)
1914 ; GFX940-NEXT: buffer_inv sc1
1915 ; GFX940-NEXT: s_setpc_b64 s[30:31]
1917 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
1919 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1920 ; GFX11-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
1921 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
1922 ; GFX11-NEXT: s_add_i32 s4, s16, 0x800
1923 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1924 ; GFX11-NEXT: v_mov_b32_e32 v6, s4
1925 ; GFX11-NEXT: s_mov_b32 s4, 0
1926 ; GFX11-NEXT: buffer_load_b64 v[0:1], v0, s[0:3], 0 offen offset:2048
1927 ; GFX11-NEXT: .LBB8_1: ; %atomicrmw.start
1928 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
1929 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1930 ; GFX11-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
1931 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1932 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1933 ; GFX11-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
1934 ; GFX11-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
1935 ; GFX11-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
1936 ; GFX11-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v6, s[0:3], 0 offen glc
1937 ; GFX11-NEXT: s_waitcnt vmcnt(0)
1938 ; GFX11-NEXT: buffer_gl1_inv
1939 ; GFX11-NEXT: buffer_gl0_inv
1940 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
1941 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
1942 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1943 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
1944 ; GFX11-NEXT: s_cbranch_execnz .LBB8_1
1945 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
1946 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
1947 ; GFX11-NEXT: s_setpc_b64 s[30:31]
1949 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
1951 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1952 ; GFX10-NEXT: v_mov_b32_e32 v4, v0
1953 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
1954 ; GFX10-NEXT: v_mov_b32_e32 v5, v1
1955 ; GFX10-NEXT: s_add_i32 s4, s20, 0x800
1956 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
1957 ; GFX10-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
1958 ; GFX10-NEXT: s_mov_b32 s4, 0
1959 ; GFX10-NEXT: .LBB8_1: ; %atomicrmw.start
1960 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
1961 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1962 ; GFX10-NEXT: v_mov_b32_e32 v10, v1
1963 ; GFX10-NEXT: v_mov_b32_e32 v9, v0
1964 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1965 ; GFX10-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
1966 ; GFX10-NEXT: v_mov_b32_e32 v0, v7
1967 ; GFX10-NEXT: v_mov_b32_e32 v1, v8
1968 ; GFX10-NEXT: v_mov_b32_e32 v2, v9
1969 ; GFX10-NEXT: v_mov_b32_e32 v3, v10
1970 ; GFX10-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
1971 ; GFX10-NEXT: s_waitcnt vmcnt(0)
1972 ; GFX10-NEXT: buffer_gl1_inv
1973 ; GFX10-NEXT: buffer_gl0_inv
1974 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
1975 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
1976 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
1977 ; GFX10-NEXT: s_cbranch_execnz .LBB8_1
1978 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
1979 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
1980 ; GFX10-NEXT: s_setpc_b64 s[30:31]
1982 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
1984 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1985 ; GFX90A-NEXT: v_mov_b32_e32 v2, s20
1986 ; GFX90A-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[16:19], 0 offen offset:2048 glc
1987 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
1988 ; GFX90A-NEXT: buffer_wbinvl1
1989 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
1991 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
1993 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1994 ; GFX908-NEXT: v_mov_b32_e32 v4, v0
1995 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
1996 ; GFX908-NEXT: v_mov_b32_e32 v5, v1
1997 ; GFX908-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
1998 ; GFX908-NEXT: s_add_i32 s6, s20, 0x800
1999 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
2000 ; GFX908-NEXT: v_mov_b32_e32 v6, s6
2001 ; GFX908-NEXT: .LBB8_1: ; %atomicrmw.start
2002 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
2003 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2004 ; GFX908-NEXT: v_mov_b32_e32 v10, v1
2005 ; GFX908-NEXT: v_mov_b32_e32 v9, v0
2006 ; GFX908-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
2007 ; GFX908-NEXT: v_mov_b32_e32 v0, v7
2008 ; GFX908-NEXT: v_mov_b32_e32 v1, v8
2009 ; GFX908-NEXT: v_mov_b32_e32 v2, v9
2010 ; GFX908-NEXT: v_mov_b32_e32 v3, v10
2011 ; GFX908-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
2012 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2013 ; GFX908-NEXT: buffer_wbinvl1
2014 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
2015 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2016 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
2017 ; GFX908-NEXT: s_cbranch_execnz .LBB8_1
2018 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
2019 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
2020 ; GFX908-NEXT: s_setpc_b64 s[30:31]
2022 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
2024 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2025 ; GFX8-NEXT: v_mov_b32_e32 v4, v0
2026 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
2027 ; GFX8-NEXT: v_mov_b32_e32 v5, v1
2028 ; GFX8-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
2029 ; GFX8-NEXT: s_add_i32 s6, s20, 0x800
2030 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
2031 ; GFX8-NEXT: v_mov_b32_e32 v6, s6
2032 ; GFX8-NEXT: .LBB8_1: ; %atomicrmw.start
2033 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
2034 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2035 ; GFX8-NEXT: v_mov_b32_e32 v10, v1
2036 ; GFX8-NEXT: v_mov_b32_e32 v9, v0
2037 ; GFX8-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
2038 ; GFX8-NEXT: v_mov_b32_e32 v0, v7
2039 ; GFX8-NEXT: v_mov_b32_e32 v1, v8
2040 ; GFX8-NEXT: v_mov_b32_e32 v2, v9
2041 ; GFX8-NEXT: v_mov_b32_e32 v3, v10
2042 ; GFX8-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
2043 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2044 ; GFX8-NEXT: buffer_wbinvl1
2045 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
2046 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2047 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
2048 ; GFX8-NEXT: s_cbranch_execnz .LBB8_1
2049 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
2050 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
2051 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2053 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
2055 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2056 ; GFX7-NEXT: v_mov_b32_e32 v4, v0
2057 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
2058 ; GFX7-NEXT: v_mov_b32_e32 v5, v1
2059 ; GFX7-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
2060 ; GFX7-NEXT: s_add_i32 s6, s20, 0x800
2061 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
2062 ; GFX7-NEXT: v_mov_b32_e32 v6, s6
2063 ; GFX7-NEXT: .LBB8_1: ; %atomicrmw.start
2064 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
2065 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2066 ; GFX7-NEXT: v_mov_b32_e32 v10, v1
2067 ; GFX7-NEXT: v_mov_b32_e32 v9, v0
2068 ; GFX7-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
2069 ; GFX7-NEXT: v_mov_b32_e32 v0, v7
2070 ; GFX7-NEXT: v_mov_b32_e32 v1, v8
2071 ; GFX7-NEXT: v_mov_b32_e32 v2, v9
2072 ; GFX7-NEXT: v_mov_b32_e32 v3, v10
2073 ; GFX7-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
2074 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2075 ; GFX7-NEXT: buffer_wbinvl1
2076 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
2077 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2078 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
2079 ; GFX7-NEXT: s_cbranch_execnz .LBB8_1
2080 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
2081 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
2082 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2084 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory:
2086 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2087 ; GFX6-NEXT: v_mov_b32_e32 v4, v0
2088 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
2089 ; GFX6-NEXT: v_mov_b32_e32 v5, v1
2090 ; GFX6-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
2091 ; GFX6-NEXT: s_add_i32 s6, s20, 0x800
2092 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
2093 ; GFX6-NEXT: v_mov_b32_e32 v6, s6
2094 ; GFX6-NEXT: .LBB8_1: ; %atomicrmw.start
2095 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
2096 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2097 ; GFX6-NEXT: v_mov_b32_e32 v10, v1
2098 ; GFX6-NEXT: v_mov_b32_e32 v9, v0
2099 ; GFX6-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
2100 ; GFX6-NEXT: s_waitcnt expcnt(0)
2101 ; GFX6-NEXT: v_mov_b32_e32 v0, v7
2102 ; GFX6-NEXT: v_mov_b32_e32 v1, v8
2103 ; GFX6-NEXT: v_mov_b32_e32 v2, v9
2104 ; GFX6-NEXT: v_mov_b32_e32 v3, v10
2105 ; GFX6-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
2106 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2107 ; GFX6-NEXT: buffer_wbinvl1
2108 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
2109 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2110 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
2111 ; GFX6-NEXT: s_cbranch_execnz .LBB8_1
2112 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
2113 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
2114 ; GFX6-NEXT: s_waitcnt expcnt(0)
2115 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2116 %gep = getelementptr double, ptr addrspace(7) %ptr, i32 256
2117 %result = atomicrmw fadd ptr addrspace(7) %gep, double %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
2121 define void @buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, double %val) #0 {
2122 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2124 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2125 ; GFX12-NEXT: s_wait_expcnt 0x0
2126 ; GFX12-NEXT: s_wait_samplecnt 0x0
2127 ; GFX12-NEXT: s_wait_bvhcnt 0x0
2128 ; GFX12-NEXT: s_wait_kmcnt 0x0
2129 ; GFX12-NEXT: v_mov_b32_e32 v2, s16
2130 ; GFX12-NEXT: s_add_co_i32 s4, s16, 0x800
2131 ; GFX12-NEXT: s_wait_alu 0xfffe
2132 ; GFX12-NEXT: v_mov_b32_e32 v6, s4
2133 ; GFX12-NEXT: s_mov_b32 s4, 0
2134 ; GFX12-NEXT: buffer_load_b64 v[4:5], v2, s[0:3], null offen offset:2048
2135 ; GFX12-NEXT: .LBB9_1: ; %atomicrmw.start
2136 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
2137 ; GFX12-NEXT: s_wait_loadcnt 0x0
2138 ; GFX12-NEXT: v_add_f64_e32 v[2:3], v[4:5], v[0:1]
2139 ; GFX12-NEXT: v_dual_mov_b32 v10, v5 :: v_dual_mov_b32 v9, v4
2140 ; GFX12-NEXT: s_wait_storecnt 0x0
2141 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_2)
2142 ; GFX12-NEXT: v_dual_mov_b32 v8, v3 :: v_dual_mov_b32 v7, v2
2143 ; GFX12-NEXT: buffer_atomic_cmpswap_b64 v[7:10], v6, s[0:3], null offen th:TH_ATOMIC_RETURN
2144 ; GFX12-NEXT: s_wait_loadcnt 0x0
2145 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
2146 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[7:8], v[4:5]
2147 ; GFX12-NEXT: v_dual_mov_b32 v4, v7 :: v_dual_mov_b32 v5, v8
2148 ; GFX12-NEXT: s_wait_alu 0xfffe
2149 ; GFX12-NEXT: s_or_b32 s4, vcc_lo, s4
2150 ; GFX12-NEXT: s_wait_alu 0xfffe
2151 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
2152 ; GFX12-NEXT: s_cbranch_execnz .LBB9_1
2153 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
2154 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s4
2155 ; GFX12-NEXT: s_wait_alu 0xfffe
2156 ; GFX12-NEXT: s_setpc_b64 s[30:31]
2158 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2160 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2161 ; GFX940-NEXT: v_mov_b32_e32 v2, s16
2162 ; GFX940-NEXT: buffer_wbl2 sc1
2163 ; GFX940-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[0:3], 0 offen offset:2048
2164 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2165 ; GFX940-NEXT: buffer_inv sc1
2166 ; GFX940-NEXT: s_setpc_b64 s[30:31]
2168 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2170 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2171 ; GFX11-NEXT: v_mov_b32_e32 v2, s16
2172 ; GFX11-NEXT: s_add_i32 s4, s16, 0x800
2173 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2174 ; GFX11-NEXT: v_mov_b32_e32 v6, s4
2175 ; GFX11-NEXT: s_mov_b32 s4, 0
2176 ; GFX11-NEXT: buffer_load_b64 v[4:5], v2, s[0:3], 0 offen offset:2048
2177 ; GFX11-NEXT: .LBB9_1: ; %atomicrmw.start
2178 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
2179 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2180 ; GFX11-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
2181 ; GFX11-NEXT: v_dual_mov_b32 v10, v5 :: v_dual_mov_b32 v9, v4
2182 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2183 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
2184 ; GFX11-NEXT: v_dual_mov_b32 v8, v3 :: v_dual_mov_b32 v7, v2
2185 ; GFX11-NEXT: buffer_atomic_cmpswap_b64 v[7:10], v6, s[0:3], 0 offen glc
2186 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2187 ; GFX11-NEXT: buffer_gl1_inv
2188 ; GFX11-NEXT: buffer_gl0_inv
2189 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[7:8], v[4:5]
2190 ; GFX11-NEXT: v_dual_mov_b32 v4, v7 :: v_dual_mov_b32 v5, v8
2191 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
2192 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2193 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
2194 ; GFX11-NEXT: s_cbranch_execnz .LBB9_1
2195 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
2196 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
2197 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2199 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2201 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2202 ; GFX10-NEXT: v_mov_b32_e32 v2, s20
2203 ; GFX10-NEXT: s_add_i32 s4, s20, 0x800
2204 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
2205 ; GFX10-NEXT: s_mov_b32 s4, 0
2206 ; GFX10-NEXT: buffer_load_dwordx2 v[4:5], v2, s[16:19], 0 offen offset:2048
2207 ; GFX10-NEXT: .LBB9_1: ; %atomicrmw.start
2208 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
2209 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2210 ; GFX10-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
2211 ; GFX10-NEXT: v_mov_b32_e32 v10, v5
2212 ; GFX10-NEXT: v_mov_b32_e32 v9, v4
2213 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2214 ; GFX10-NEXT: v_mov_b32_e32 v8, v3
2215 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
2216 ; GFX10-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[16:19], 0 offen glc
2217 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2218 ; GFX10-NEXT: buffer_gl1_inv
2219 ; GFX10-NEXT: buffer_gl0_inv
2220 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[7:8], v[4:5]
2221 ; GFX10-NEXT: v_mov_b32_e32 v4, v7
2222 ; GFX10-NEXT: v_mov_b32_e32 v5, v8
2223 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
2224 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
2225 ; GFX10-NEXT: s_cbranch_execnz .LBB9_1
2226 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
2227 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
2228 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2230 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2232 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2233 ; GFX90A-NEXT: v_mov_b32_e32 v2, s20
2234 ; GFX90A-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[16:19], 0 offen offset:2048
2235 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2236 ; GFX90A-NEXT: buffer_wbinvl1
2237 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
2239 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2241 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2242 ; GFX908-NEXT: v_mov_b32_e32 v2, s20
2243 ; GFX908-NEXT: buffer_load_dwordx2 v[4:5], v2, s[16:19], 0 offen offset:2048
2244 ; GFX908-NEXT: s_add_i32 s6, s20, 0x800
2245 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
2246 ; GFX908-NEXT: v_mov_b32_e32 v6, s6
2247 ; GFX908-NEXT: .LBB9_1: ; %atomicrmw.start
2248 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
2249 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2250 ; GFX908-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
2251 ; GFX908-NEXT: v_mov_b32_e32 v10, v5
2252 ; GFX908-NEXT: v_mov_b32_e32 v9, v4
2253 ; GFX908-NEXT: v_mov_b32_e32 v8, v3
2254 ; GFX908-NEXT: v_mov_b32_e32 v7, v2
2255 ; GFX908-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[16:19], 0 offen glc
2256 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2257 ; GFX908-NEXT: buffer_wbinvl1
2258 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, v[7:8], v[4:5]
2259 ; GFX908-NEXT: v_mov_b32_e32 v4, v7
2260 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2261 ; GFX908-NEXT: v_mov_b32_e32 v5, v8
2262 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
2263 ; GFX908-NEXT: s_cbranch_execnz .LBB9_1
2264 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
2265 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
2266 ; GFX908-NEXT: s_setpc_b64 s[30:31]
2268 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2270 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2271 ; GFX8-NEXT: v_mov_b32_e32 v2, s20
2272 ; GFX8-NEXT: buffer_load_dwordx2 v[4:5], v2, s[16:19], 0 offen offset:2048
2273 ; GFX8-NEXT: s_add_i32 s6, s20, 0x800
2274 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
2275 ; GFX8-NEXT: v_mov_b32_e32 v6, s6
2276 ; GFX8-NEXT: .LBB9_1: ; %atomicrmw.start
2277 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
2278 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2279 ; GFX8-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
2280 ; GFX8-NEXT: v_mov_b32_e32 v10, v5
2281 ; GFX8-NEXT: v_mov_b32_e32 v9, v4
2282 ; GFX8-NEXT: v_mov_b32_e32 v8, v3
2283 ; GFX8-NEXT: v_mov_b32_e32 v7, v2
2284 ; GFX8-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[16:19], 0 offen glc
2285 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2286 ; GFX8-NEXT: buffer_wbinvl1
2287 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, v[7:8], v[4:5]
2288 ; GFX8-NEXT: v_mov_b32_e32 v4, v7
2289 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2290 ; GFX8-NEXT: v_mov_b32_e32 v5, v8
2291 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
2292 ; GFX8-NEXT: s_cbranch_execnz .LBB9_1
2293 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
2294 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
2295 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2297 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2299 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2300 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
2301 ; GFX7-NEXT: buffer_load_dwordx2 v[4:5], v2, s[16:19], 0 offen offset:2048
2302 ; GFX7-NEXT: s_add_i32 s6, s20, 0x800
2303 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
2304 ; GFX7-NEXT: v_mov_b32_e32 v6, s6
2305 ; GFX7-NEXT: .LBB9_1: ; %atomicrmw.start
2306 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
2307 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2308 ; GFX7-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
2309 ; GFX7-NEXT: v_mov_b32_e32 v10, v5
2310 ; GFX7-NEXT: v_mov_b32_e32 v9, v4
2311 ; GFX7-NEXT: v_mov_b32_e32 v8, v3
2312 ; GFX7-NEXT: v_mov_b32_e32 v7, v2
2313 ; GFX7-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[16:19], 0 offen glc
2314 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2315 ; GFX7-NEXT: buffer_wbinvl1
2316 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, v[7:8], v[4:5]
2317 ; GFX7-NEXT: v_mov_b32_e32 v4, v7
2318 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2319 ; GFX7-NEXT: v_mov_b32_e32 v5, v8
2320 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
2321 ; GFX7-NEXT: s_cbranch_execnz .LBB9_1
2322 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
2323 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
2324 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2326 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f64__offset__amdgpu_no_fine_grained_memory:
2328 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2329 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
2330 ; GFX6-NEXT: buffer_load_dwordx2 v[4:5], v2, s[16:19], 0 offen offset:2048
2331 ; GFX6-NEXT: s_add_i32 s6, s20, 0x800
2332 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
2333 ; GFX6-NEXT: v_mov_b32_e32 v6, s6
2334 ; GFX6-NEXT: .LBB9_1: ; %atomicrmw.start
2335 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
2336 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2337 ; GFX6-NEXT: v_add_f64 v[2:3], v[4:5], v[0:1]
2338 ; GFX6-NEXT: s_waitcnt expcnt(0)
2339 ; GFX6-NEXT: v_mov_b32_e32 v10, v5
2340 ; GFX6-NEXT: v_mov_b32_e32 v9, v4
2341 ; GFX6-NEXT: v_mov_b32_e32 v8, v3
2342 ; GFX6-NEXT: v_mov_b32_e32 v7, v2
2343 ; GFX6-NEXT: buffer_atomic_cmpswap_x2 v[7:10], v6, s[16:19], 0 offen glc
2344 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2345 ; GFX6-NEXT: buffer_wbinvl1
2346 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, v[7:8], v[4:5]
2347 ; GFX6-NEXT: v_mov_b32_e32 v4, v7
2348 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
2349 ; GFX6-NEXT: v_mov_b32_e32 v5, v8
2350 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
2351 ; GFX6-NEXT: s_cbranch_execnz .LBB9_1
2352 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
2353 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
2354 ; GFX6-NEXT: s_waitcnt expcnt(0)
2355 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2356 %gep = getelementptr double, ptr addrspace(7) %ptr, i32 256
2357 %unused = atomicrmw fadd ptr addrspace(7) %gep, double %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
2361 define double @buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory(ptr addrspace(7) %ptr, double %val) #0 {
2362 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2364 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2365 ; GFX12-NEXT: s_wait_expcnt 0x0
2366 ; GFX12-NEXT: s_wait_samplecnt 0x0
2367 ; GFX12-NEXT: s_wait_bvhcnt 0x0
2368 ; GFX12-NEXT: s_wait_kmcnt 0x0
2369 ; GFX12-NEXT: v_dual_mov_b32 v8, v3 :: v_dual_mov_b32 v7, v2
2370 ; GFX12-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
2371 ; GFX12-NEXT: v_add_nc_u32_e32 v15, 0x800, v4
2372 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
2373 ; GFX12-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2374 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
2375 ; GFX12-NEXT: v_readfirstlane_b32 s4, v9
2376 ; GFX12-NEXT: v_readfirstlane_b32 s5, v10
2377 ; GFX12-NEXT: v_readfirstlane_b32 s6, v7
2378 ; GFX12-NEXT: v_readfirstlane_b32 s7, v8
2379 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
2380 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[9:10]
2381 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[7:8]
2382 ; GFX12-NEXT: s_wait_alu 0xfffe
2383 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
2384 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
2385 ; GFX12-NEXT: s_wait_alu 0xfffe
2386 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
2387 ; GFX12-NEXT: s_wait_loadcnt 0x0
2388 ; GFX12-NEXT: buffer_load_b64 v[13:14], v4, s[4:7], null offen offset:2048
2389 ; GFX12-NEXT: ; implicit-def: $vgpr4
2390 ; GFX12-NEXT: s_wait_alu 0xfffe
2391 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
2392 ; GFX12-NEXT: s_cbranch_execnz .LBB10_1
2393 ; GFX12-NEXT: ; %bb.2:
2394 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
2395 ; GFX12-NEXT: s_mov_b32 s1, 0
2396 ; GFX12-NEXT: .LBB10_3: ; %atomicrmw.start
2397 ; GFX12-NEXT: ; =>This Loop Header: Depth=1
2398 ; GFX12-NEXT: ; Child Loop BB10_4 Depth 2
2399 ; GFX12-NEXT: s_wait_loadcnt 0x0
2400 ; GFX12-NEXT: v_add_f64_e32 v[11:12], v[13:14], v[5:6]
2401 ; GFX12-NEXT: s_mov_b32 s2, exec_lo
2402 ; GFX12-NEXT: s_wait_storecnt 0x0
2403 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
2404 ; GFX12-NEXT: v_dual_mov_b32 v0, v11 :: v_dual_mov_b32 v1, v12
2405 ; GFX12-NEXT: v_dual_mov_b32 v2, v13 :: v_dual_mov_b32 v3, v14
2406 ; GFX12-NEXT: .LBB10_4: ; Parent Loop BB10_3 Depth=1
2407 ; GFX12-NEXT: ; => This Inner Loop Header: Depth=2
2408 ; GFX12-NEXT: v_readfirstlane_b32 s4, v9
2409 ; GFX12-NEXT: v_readfirstlane_b32 s5, v10
2410 ; GFX12-NEXT: v_readfirstlane_b32 s6, v7
2411 ; GFX12-NEXT: v_readfirstlane_b32 s7, v8
2412 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
2413 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[9:10]
2414 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[7:8]
2415 ; GFX12-NEXT: s_wait_alu 0xfffe
2416 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
2417 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
2418 ; GFX12-NEXT: s_wait_alu 0xfffe
2419 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
2420 ; GFX12-NEXT: s_wait_loadcnt 0x0
2421 ; GFX12-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v15, s[4:7], null offen th:TH_ATOMIC_RETURN
2422 ; GFX12-NEXT: s_wait_alu 0xfffe
2423 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
2424 ; GFX12-NEXT: s_cbranch_execnz .LBB10_4
2425 ; GFX12-NEXT: ; %bb.5: ; in Loop: Header=BB10_3 Depth=1
2426 ; GFX12-NEXT: s_mov_b32 exec_lo, s2
2427 ; GFX12-NEXT: s_wait_loadcnt 0x0
2428 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[13:14]
2429 ; GFX12-NEXT: v_dual_mov_b32 v14, v1 :: v_dual_mov_b32 v13, v0
2430 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
2431 ; GFX12-NEXT: s_or_b32 s1, vcc_lo, s1
2432 ; GFX12-NEXT: s_wait_alu 0xfffe
2433 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
2434 ; GFX12-NEXT: s_cbranch_execnz .LBB10_3
2435 ; GFX12-NEXT: ; %bb.6: ; %atomicrmw.end
2436 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s1
2437 ; GFX12-NEXT: s_wait_alu 0xfffe
2438 ; GFX12-NEXT: s_setpc_b64 s[30:31]
2440 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2442 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2443 ; GFX940-NEXT: v_mov_b32_e32 v7, v6
2444 ; GFX940-NEXT: v_mov_b32_e32 v6, v5
2445 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
2446 ; GFX940-NEXT: buffer_wbl2 sc1
2447 ; GFX940-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2448 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
2449 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
2450 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
2451 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
2452 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
2453 ; GFX940-NEXT: s_nop 0
2454 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
2455 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
2456 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
2457 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2458 ; GFX940-NEXT: buffer_atomic_add_f64 v[6:7], v4, s[4:7], 0 offen offset:2048 sc0
2459 ; GFX940-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
2460 ; GFX940-NEXT: ; implicit-def: $vgpr4
2461 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
2462 ; GFX940-NEXT: s_cbranch_execnz .LBB10_1
2463 ; GFX940-NEXT: ; %bb.2:
2464 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
2465 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2466 ; GFX940-NEXT: v_mov_b32_e32 v0, v6
2467 ; GFX940-NEXT: v_mov_b32_e32 v1, v7
2468 ; GFX940-NEXT: buffer_inv sc1
2469 ; GFX940-NEXT: s_setpc_b64 s[30:31]
2471 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2473 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2474 ; GFX11-NEXT: v_dual_mov_b32 v8, v3 :: v_dual_mov_b32 v7, v2
2475 ; GFX11-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
2476 ; GFX11-NEXT: v_add_nc_u32_e32 v15, 0x800, v4
2477 ; GFX11-NEXT: s_mov_b32 s1, 0
2478 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
2479 ; GFX11-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2480 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_3)
2481 ; GFX11-NEXT: v_readfirstlane_b32 s4, v9
2482 ; GFX11-NEXT: v_readfirstlane_b32 s5, v10
2483 ; GFX11-NEXT: v_readfirstlane_b32 s6, v7
2484 ; GFX11-NEXT: v_readfirstlane_b32 s7, v8
2485 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[9:10]
2486 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
2487 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[7:8]
2488 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
2489 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2490 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
2491 ; GFX11-NEXT: buffer_load_b64 v[13:14], v4, s[4:7], 0 offen offset:2048
2492 ; GFX11-NEXT: ; implicit-def: $vgpr4
2493 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
2494 ; GFX11-NEXT: s_cbranch_execnz .LBB10_1
2495 ; GFX11-NEXT: ; %bb.2:
2496 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
2497 ; GFX11-NEXT: .p2align 6
2498 ; GFX11-NEXT: .LBB10_3: ; %atomicrmw.start
2499 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
2500 ; GFX11-NEXT: ; Child Loop BB10_4 Depth 2
2501 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2502 ; GFX11-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
2503 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
2504 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2505 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
2506 ; GFX11-NEXT: v_dual_mov_b32 v0, v11 :: v_dual_mov_b32 v1, v12
2507 ; GFX11-NEXT: v_dual_mov_b32 v2, v13 :: v_dual_mov_b32 v3, v14
2508 ; GFX11-NEXT: .LBB10_4: ; Parent Loop BB10_3 Depth=1
2509 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
2510 ; GFX11-NEXT: v_readfirstlane_b32 s4, v9
2511 ; GFX11-NEXT: v_readfirstlane_b32 s5, v10
2512 ; GFX11-NEXT: v_readfirstlane_b32 s6, v7
2513 ; GFX11-NEXT: v_readfirstlane_b32 s7, v8
2514 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
2515 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[9:10]
2516 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[7:8]
2517 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
2518 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
2519 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
2520 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2521 ; GFX11-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v15, s[4:7], 0 offen glc
2522 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
2523 ; GFX11-NEXT: s_cbranch_execnz .LBB10_4
2524 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB10_3 Depth=1
2525 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
2526 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2527 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[13:14]
2528 ; GFX11-NEXT: v_dual_mov_b32 v14, v1 :: v_dual_mov_b32 v13, v0
2529 ; GFX11-NEXT: buffer_gl1_inv
2530 ; GFX11-NEXT: buffer_gl0_inv
2531 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
2532 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2533 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
2534 ; GFX11-NEXT: s_cbranch_execnz .LBB10_3
2535 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
2536 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
2537 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2539 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2541 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2542 ; GFX10-NEXT: v_mov_b32_e32 v8, v3
2543 ; GFX10-NEXT: v_mov_b32_e32 v7, v2
2544 ; GFX10-NEXT: v_mov_b32_e32 v10, v1
2545 ; GFX10-NEXT: v_mov_b32_e32 v9, v0
2546 ; GFX10-NEXT: v_add_nc_u32_e32 v15, 0x800, v4
2547 ; GFX10-NEXT: s_mov_b32 s5, 0
2548 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
2549 ; GFX10-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2550 ; GFX10-NEXT: v_readfirstlane_b32 s8, v9
2551 ; GFX10-NEXT: v_readfirstlane_b32 s9, v10
2552 ; GFX10-NEXT: v_readfirstlane_b32 s10, v7
2553 ; GFX10-NEXT: v_readfirstlane_b32 s11, v8
2554 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[9:10]
2555 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[7:8]
2556 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
2557 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
2558 ; GFX10-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
2559 ; GFX10-NEXT: ; implicit-def: $vgpr4
2560 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
2561 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
2562 ; GFX10-NEXT: s_cbranch_execnz .LBB10_1
2563 ; GFX10-NEXT: ; %bb.2:
2564 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
2565 ; GFX10-NEXT: .LBB10_3: ; %atomicrmw.start
2566 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
2567 ; GFX10-NEXT: ; Child Loop BB10_4 Depth 2
2568 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2569 ; GFX10-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
2570 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
2571 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2572 ; GFX10-NEXT: v_mov_b32_e32 v0, v11
2573 ; GFX10-NEXT: v_mov_b32_e32 v1, v12
2574 ; GFX10-NEXT: v_mov_b32_e32 v2, v13
2575 ; GFX10-NEXT: v_mov_b32_e32 v3, v14
2576 ; GFX10-NEXT: .LBB10_4: ; Parent Loop BB10_3 Depth=1
2577 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
2578 ; GFX10-NEXT: v_readfirstlane_b32 s8, v9
2579 ; GFX10-NEXT: v_readfirstlane_b32 s9, v10
2580 ; GFX10-NEXT: v_readfirstlane_b32 s10, v7
2581 ; GFX10-NEXT: v_readfirstlane_b32 s11, v8
2582 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[9:10]
2583 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[7:8]
2584 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
2585 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
2586 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2587 ; GFX10-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
2588 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
2589 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
2590 ; GFX10-NEXT: s_cbranch_execnz .LBB10_4
2591 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB10_3 Depth=1
2592 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
2593 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2594 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[13:14]
2595 ; GFX10-NEXT: v_mov_b32_e32 v14, v1
2596 ; GFX10-NEXT: v_mov_b32_e32 v13, v0
2597 ; GFX10-NEXT: buffer_gl1_inv
2598 ; GFX10-NEXT: buffer_gl0_inv
2599 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
2600 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
2601 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
2602 ; GFX10-NEXT: s_cbranch_execnz .LBB10_3
2603 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
2604 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
2605 ; GFX10-NEXT: s_setpc_b64 s[30:31]
2607 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2609 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2610 ; GFX90A-NEXT: v_mov_b32_e32 v7, v6
2611 ; GFX90A-NEXT: v_mov_b32_e32 v6, v5
2612 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
2613 ; GFX90A-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2614 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
2615 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
2616 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
2617 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
2618 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
2619 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
2620 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2621 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2622 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2623 ; GFX90A-NEXT: buffer_atomic_add_f64 v[6:7], v4, s[8:11], 0 offen offset:2048 glc
2624 ; GFX90A-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
2625 ; GFX90A-NEXT: ; implicit-def: $vgpr4
2626 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
2627 ; GFX90A-NEXT: s_cbranch_execnz .LBB10_1
2628 ; GFX90A-NEXT: ; %bb.2:
2629 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
2630 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
2631 ; GFX90A-NEXT: v_mov_b32_e32 v0, v6
2632 ; GFX90A-NEXT: v_mov_b32_e32 v1, v7
2633 ; GFX90A-NEXT: buffer_wbinvl1
2634 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
2636 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2638 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2639 ; GFX908-NEXT: v_mov_b32_e32 v8, v3
2640 ; GFX908-NEXT: v_mov_b32_e32 v7, v2
2641 ; GFX908-NEXT: v_mov_b32_e32 v10, v1
2642 ; GFX908-NEXT: v_mov_b32_e32 v9, v0
2643 ; GFX908-NEXT: v_add_u32_e32 v15, 0x800, v4
2644 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
2645 ; GFX908-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2646 ; GFX908-NEXT: v_readfirstlane_b32 s8, v9
2647 ; GFX908-NEXT: v_readfirstlane_b32 s9, v10
2648 ; GFX908-NEXT: v_readfirstlane_b32 s10, v7
2649 ; GFX908-NEXT: v_readfirstlane_b32 s11, v8
2650 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
2651 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
2652 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2653 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2654 ; GFX908-NEXT: s_nop 0
2655 ; GFX908-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
2656 ; GFX908-NEXT: ; implicit-def: $vgpr4
2657 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
2658 ; GFX908-NEXT: s_cbranch_execnz .LBB10_1
2659 ; GFX908-NEXT: ; %bb.2:
2660 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
2661 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
2662 ; GFX908-NEXT: .LBB10_3: ; %atomicrmw.start
2663 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
2664 ; GFX908-NEXT: ; Child Loop BB10_4 Depth 2
2665 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2666 ; GFX908-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
2667 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
2668 ; GFX908-NEXT: v_mov_b32_e32 v0, v11
2669 ; GFX908-NEXT: v_mov_b32_e32 v1, v12
2670 ; GFX908-NEXT: v_mov_b32_e32 v2, v13
2671 ; GFX908-NEXT: v_mov_b32_e32 v3, v14
2672 ; GFX908-NEXT: .LBB10_4: ; Parent Loop BB10_3 Depth=1
2673 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
2674 ; GFX908-NEXT: v_readfirstlane_b32 s8, v9
2675 ; GFX908-NEXT: v_readfirstlane_b32 s9, v10
2676 ; GFX908-NEXT: v_readfirstlane_b32 s10, v7
2677 ; GFX908-NEXT: v_readfirstlane_b32 s11, v8
2678 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
2679 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
2680 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2681 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2682 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2683 ; GFX908-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
2684 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
2685 ; GFX908-NEXT: s_cbranch_execnz .LBB10_4
2686 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB10_3 Depth=1
2687 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
2688 ; GFX908-NEXT: s_waitcnt vmcnt(0)
2689 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[13:14]
2690 ; GFX908-NEXT: v_mov_b32_e32 v14, v1
2691 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
2692 ; GFX908-NEXT: v_mov_b32_e32 v13, v0
2693 ; GFX908-NEXT: buffer_wbinvl1
2694 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
2695 ; GFX908-NEXT: s_cbranch_execnz .LBB10_3
2696 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
2697 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
2698 ; GFX908-NEXT: s_setpc_b64 s[30:31]
2700 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2702 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2703 ; GFX8-NEXT: v_mov_b32_e32 v8, v3
2704 ; GFX8-NEXT: v_mov_b32_e32 v7, v2
2705 ; GFX8-NEXT: v_mov_b32_e32 v10, v1
2706 ; GFX8-NEXT: v_mov_b32_e32 v9, v0
2707 ; GFX8-NEXT: v_add_u32_e32 v15, vcc, 0x800, v4
2708 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
2709 ; GFX8-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2710 ; GFX8-NEXT: v_readfirstlane_b32 s8, v9
2711 ; GFX8-NEXT: v_readfirstlane_b32 s9, v10
2712 ; GFX8-NEXT: v_readfirstlane_b32 s10, v7
2713 ; GFX8-NEXT: v_readfirstlane_b32 s11, v8
2714 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
2715 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
2716 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2717 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2718 ; GFX8-NEXT: s_nop 0
2719 ; GFX8-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
2720 ; GFX8-NEXT: ; implicit-def: $vgpr4
2721 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
2722 ; GFX8-NEXT: s_cbranch_execnz .LBB10_1
2723 ; GFX8-NEXT: ; %bb.2:
2724 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
2725 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
2726 ; GFX8-NEXT: .LBB10_3: ; %atomicrmw.start
2727 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
2728 ; GFX8-NEXT: ; Child Loop BB10_4 Depth 2
2729 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2730 ; GFX8-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
2731 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
2732 ; GFX8-NEXT: v_mov_b32_e32 v0, v11
2733 ; GFX8-NEXT: v_mov_b32_e32 v1, v12
2734 ; GFX8-NEXT: v_mov_b32_e32 v2, v13
2735 ; GFX8-NEXT: v_mov_b32_e32 v3, v14
2736 ; GFX8-NEXT: .LBB10_4: ; Parent Loop BB10_3 Depth=1
2737 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
2738 ; GFX8-NEXT: v_readfirstlane_b32 s8, v9
2739 ; GFX8-NEXT: v_readfirstlane_b32 s9, v10
2740 ; GFX8-NEXT: v_readfirstlane_b32 s10, v7
2741 ; GFX8-NEXT: v_readfirstlane_b32 s11, v8
2742 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
2743 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
2744 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2745 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2746 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2747 ; GFX8-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
2748 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
2749 ; GFX8-NEXT: s_cbranch_execnz .LBB10_4
2750 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB10_3 Depth=1
2751 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
2752 ; GFX8-NEXT: s_waitcnt vmcnt(0)
2753 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[13:14]
2754 ; GFX8-NEXT: v_mov_b32_e32 v14, v1
2755 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
2756 ; GFX8-NEXT: v_mov_b32_e32 v13, v0
2757 ; GFX8-NEXT: buffer_wbinvl1
2758 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
2759 ; GFX8-NEXT: s_cbranch_execnz .LBB10_3
2760 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
2761 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
2762 ; GFX8-NEXT: s_setpc_b64 s[30:31]
2764 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2766 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2767 ; GFX7-NEXT: v_mov_b32_e32 v8, v3
2768 ; GFX7-NEXT: v_mov_b32_e32 v7, v2
2769 ; GFX7-NEXT: v_mov_b32_e32 v10, v1
2770 ; GFX7-NEXT: v_mov_b32_e32 v9, v0
2771 ; GFX7-NEXT: v_add_i32_e32 v15, vcc, 0x800, v4
2772 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
2773 ; GFX7-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2774 ; GFX7-NEXT: v_readfirstlane_b32 s8, v9
2775 ; GFX7-NEXT: v_readfirstlane_b32 s9, v10
2776 ; GFX7-NEXT: v_readfirstlane_b32 s10, v7
2777 ; GFX7-NEXT: v_readfirstlane_b32 s11, v8
2778 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
2779 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
2780 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2781 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2782 ; GFX7-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
2783 ; GFX7-NEXT: ; implicit-def: $vgpr4
2784 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
2785 ; GFX7-NEXT: s_cbranch_execnz .LBB10_1
2786 ; GFX7-NEXT: ; %bb.2:
2787 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
2788 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
2789 ; GFX7-NEXT: .LBB10_3: ; %atomicrmw.start
2790 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
2791 ; GFX7-NEXT: ; Child Loop BB10_4 Depth 2
2792 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2793 ; GFX7-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
2794 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
2795 ; GFX7-NEXT: v_mov_b32_e32 v0, v11
2796 ; GFX7-NEXT: v_mov_b32_e32 v1, v12
2797 ; GFX7-NEXT: v_mov_b32_e32 v2, v13
2798 ; GFX7-NEXT: v_mov_b32_e32 v3, v14
2799 ; GFX7-NEXT: .LBB10_4: ; Parent Loop BB10_3 Depth=1
2800 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
2801 ; GFX7-NEXT: v_readfirstlane_b32 s8, v9
2802 ; GFX7-NEXT: v_readfirstlane_b32 s9, v10
2803 ; GFX7-NEXT: v_readfirstlane_b32 s10, v7
2804 ; GFX7-NEXT: v_readfirstlane_b32 s11, v8
2805 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
2806 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
2807 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2808 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2809 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2810 ; GFX7-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
2811 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
2812 ; GFX7-NEXT: s_cbranch_execnz .LBB10_4
2813 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB10_3 Depth=1
2814 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
2815 ; GFX7-NEXT: s_waitcnt vmcnt(0)
2816 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[13:14]
2817 ; GFX7-NEXT: v_mov_b32_e32 v14, v1
2818 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
2819 ; GFX7-NEXT: v_mov_b32_e32 v13, v0
2820 ; GFX7-NEXT: buffer_wbinvl1
2821 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
2822 ; GFX7-NEXT: s_cbranch_execnz .LBB10_3
2823 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
2824 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
2825 ; GFX7-NEXT: s_setpc_b64 s[30:31]
2827 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__waterfall__amdgpu_no_fine_grained_memory:
2829 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2830 ; GFX6-NEXT: v_mov_b32_e32 v8, v3
2831 ; GFX6-NEXT: v_mov_b32_e32 v7, v2
2832 ; GFX6-NEXT: v_mov_b32_e32 v10, v1
2833 ; GFX6-NEXT: v_mov_b32_e32 v9, v0
2834 ; GFX6-NEXT: v_add_i32_e32 v15, vcc, 0x800, v4
2835 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
2836 ; GFX6-NEXT: .LBB10_1: ; =>This Inner Loop Header: Depth=1
2837 ; GFX6-NEXT: v_readfirstlane_b32 s8, v9
2838 ; GFX6-NEXT: v_readfirstlane_b32 s9, v10
2839 ; GFX6-NEXT: v_readfirstlane_b32 s10, v7
2840 ; GFX6-NEXT: v_readfirstlane_b32 s11, v8
2841 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
2842 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
2843 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2844 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2845 ; GFX6-NEXT: buffer_load_dwordx2 v[13:14], v4, s[8:11], 0 offen offset:2048
2846 ; GFX6-NEXT: ; implicit-def: $vgpr4
2847 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
2848 ; GFX6-NEXT: s_cbranch_execnz .LBB10_1
2849 ; GFX6-NEXT: ; %bb.2:
2850 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
2851 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
2852 ; GFX6-NEXT: .LBB10_3: ; %atomicrmw.start
2853 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
2854 ; GFX6-NEXT: ; Child Loop BB10_4 Depth 2
2855 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2856 ; GFX6-NEXT: v_add_f64 v[11:12], v[13:14], v[5:6]
2857 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
2858 ; GFX6-NEXT: s_waitcnt expcnt(0)
2859 ; GFX6-NEXT: v_mov_b32_e32 v0, v11
2860 ; GFX6-NEXT: v_mov_b32_e32 v1, v12
2861 ; GFX6-NEXT: v_mov_b32_e32 v2, v13
2862 ; GFX6-NEXT: v_mov_b32_e32 v3, v14
2863 ; GFX6-NEXT: .LBB10_4: ; Parent Loop BB10_3 Depth=1
2864 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
2865 ; GFX6-NEXT: v_readfirstlane_b32 s8, v9
2866 ; GFX6-NEXT: v_readfirstlane_b32 s9, v10
2867 ; GFX6-NEXT: v_readfirstlane_b32 s10, v7
2868 ; GFX6-NEXT: v_readfirstlane_b32 s11, v8
2869 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[9:10]
2870 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[7:8]
2871 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
2872 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
2873 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
2874 ; GFX6-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v15, s[8:11], 0 offen glc
2875 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
2876 ; GFX6-NEXT: s_cbranch_execnz .LBB10_4
2877 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB10_3 Depth=1
2878 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
2879 ; GFX6-NEXT: s_waitcnt vmcnt(0)
2880 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[13:14]
2881 ; GFX6-NEXT: v_mov_b32_e32 v14, v1
2882 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
2883 ; GFX6-NEXT: v_mov_b32_e32 v13, v0
2884 ; GFX6-NEXT: buffer_wbinvl1
2885 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
2886 ; GFX6-NEXT: s_cbranch_execnz .LBB10_3
2887 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
2888 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
2889 ; GFX6-NEXT: s_waitcnt expcnt(0)
2890 ; GFX6-NEXT: s_setpc_b64 s[30:31]
2891 %gep = getelementptr double, ptr addrspace(7) %ptr, i32 256
2892 %result = atomicrmw fadd ptr addrspace(7) %gep, double %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
2896 define double @buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory(ptr addrspace(7) inreg %ptr, double %val) #0 {
2897 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
2899 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2900 ; GFX12-NEXT: s_wait_expcnt 0x0
2901 ; GFX12-NEXT: s_wait_samplecnt 0x0
2902 ; GFX12-NEXT: s_wait_bvhcnt 0x0
2903 ; GFX12-NEXT: s_wait_kmcnt 0x0
2904 ; GFX12-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
2905 ; GFX12-NEXT: v_mov_b32_e32 v0, s16
2906 ; GFX12-NEXT: s_add_co_i32 s4, s16, 0x800
2907 ; GFX12-NEXT: s_wait_alu 0xfffe
2908 ; GFX12-NEXT: v_mov_b32_e32 v6, s4
2909 ; GFX12-NEXT: s_mov_b32 s4, 0
2910 ; GFX12-NEXT: buffer_load_b64 v[0:1], v0, s[0:3], null offen offset:2048
2911 ; GFX12-NEXT: .LBB11_1: ; %atomicrmw.start
2912 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
2913 ; GFX12-NEXT: s_wait_loadcnt 0x0
2914 ; GFX12-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
2915 ; GFX12-NEXT: s_wait_storecnt 0x0
2916 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2917 ; GFX12-NEXT: v_add_f64_e32 v[7:8], v[9:10], v[4:5]
2918 ; GFX12-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
2919 ; GFX12-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
2920 ; GFX12-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v6, s[0:3], null offen th:TH_ATOMIC_RETURN
2921 ; GFX12-NEXT: s_wait_loadcnt 0x0
2922 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
2923 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
2924 ; GFX12-NEXT: s_wait_alu 0xfffe
2925 ; GFX12-NEXT: s_or_b32 s4, vcc_lo, s4
2926 ; GFX12-NEXT: s_wait_alu 0xfffe
2927 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
2928 ; GFX12-NEXT: s_cbranch_execnz .LBB11_1
2929 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
2930 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s4
2931 ; GFX12-NEXT: s_wait_alu 0xfffe
2932 ; GFX12-NEXT: s_setpc_b64 s[30:31]
2934 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
2936 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2937 ; GFX940-NEXT: v_mov_b32_e32 v2, s16
2938 ; GFX940-NEXT: buffer_wbl2 sc1
2939 ; GFX940-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[0:3], 0 offen offset:2048 sc0
2940 ; GFX940-NEXT: s_waitcnt vmcnt(0)
2941 ; GFX940-NEXT: buffer_inv sc1
2942 ; GFX940-NEXT: s_setpc_b64 s[30:31]
2944 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
2946 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2947 ; GFX11-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
2948 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
2949 ; GFX11-NEXT: s_add_i32 s4, s16, 0x800
2950 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2951 ; GFX11-NEXT: v_mov_b32_e32 v6, s4
2952 ; GFX11-NEXT: s_mov_b32 s4, 0
2953 ; GFX11-NEXT: buffer_load_b64 v[0:1], v0, s[0:3], 0 offen offset:2048
2954 ; GFX11-NEXT: .LBB11_1: ; %atomicrmw.start
2955 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
2956 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2957 ; GFX11-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
2958 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2959 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2960 ; GFX11-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
2961 ; GFX11-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
2962 ; GFX11-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
2963 ; GFX11-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v6, s[0:3], 0 offen glc
2964 ; GFX11-NEXT: s_waitcnt vmcnt(0)
2965 ; GFX11-NEXT: buffer_gl1_inv
2966 ; GFX11-NEXT: buffer_gl0_inv
2967 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
2968 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
2969 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2970 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
2971 ; GFX11-NEXT: s_cbranch_execnz .LBB11_1
2972 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
2973 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
2974 ; GFX11-NEXT: s_setpc_b64 s[30:31]
2976 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
2978 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2979 ; GFX10-NEXT: v_mov_b32_e32 v4, v0
2980 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
2981 ; GFX10-NEXT: v_mov_b32_e32 v5, v1
2982 ; GFX10-NEXT: s_add_i32 s4, s20, 0x800
2983 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
2984 ; GFX10-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
2985 ; GFX10-NEXT: s_mov_b32 s4, 0
2986 ; GFX10-NEXT: .LBB11_1: ; %atomicrmw.start
2987 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
2988 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2989 ; GFX10-NEXT: v_mov_b32_e32 v10, v1
2990 ; GFX10-NEXT: v_mov_b32_e32 v9, v0
2991 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2992 ; GFX10-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
2993 ; GFX10-NEXT: v_mov_b32_e32 v0, v7
2994 ; GFX10-NEXT: v_mov_b32_e32 v1, v8
2995 ; GFX10-NEXT: v_mov_b32_e32 v2, v9
2996 ; GFX10-NEXT: v_mov_b32_e32 v3, v10
2997 ; GFX10-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
2998 ; GFX10-NEXT: s_waitcnt vmcnt(0)
2999 ; GFX10-NEXT: buffer_gl1_inv
3000 ; GFX10-NEXT: buffer_gl0_inv
3001 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
3002 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
3003 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
3004 ; GFX10-NEXT: s_cbranch_execnz .LBB11_1
3005 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
3006 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
3007 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3009 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
3011 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3012 ; GFX90A-NEXT: v_mov_b32_e32 v4, v0
3013 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
3014 ; GFX90A-NEXT: v_mov_b32_e32 v5, v1
3015 ; GFX90A-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3016 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x800
3017 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
3018 ; GFX90A-NEXT: v_mov_b32_e32 v6, s6
3019 ; GFX90A-NEXT: .LBB11_1: ; %atomicrmw.start
3020 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
3021 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3022 ; GFX90A-NEXT: v_pk_mov_b32 v[10:11], v[0:1], v[0:1] op_sel:[0,1]
3023 ; GFX90A-NEXT: v_add_f64 v[8:9], v[10:11], v[4:5]
3024 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[8:9], v[8:9] op_sel:[0,1]
3025 ; GFX90A-NEXT: v_pk_mov_b32 v[2:3], v[10:11], v[10:11] op_sel:[0,1]
3026 ; GFX90A-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3027 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3028 ; GFX90A-NEXT: buffer_wbinvl1
3029 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[10:11]
3030 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3031 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
3032 ; GFX90A-NEXT: s_cbranch_execnz .LBB11_1
3033 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
3034 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
3035 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
3037 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
3039 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3040 ; GFX908-NEXT: v_mov_b32_e32 v4, v0
3041 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
3042 ; GFX908-NEXT: v_mov_b32_e32 v5, v1
3043 ; GFX908-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3044 ; GFX908-NEXT: s_add_i32 s6, s20, 0x800
3045 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
3046 ; GFX908-NEXT: v_mov_b32_e32 v6, s6
3047 ; GFX908-NEXT: .LBB11_1: ; %atomicrmw.start
3048 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
3049 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3050 ; GFX908-NEXT: v_mov_b32_e32 v10, v1
3051 ; GFX908-NEXT: v_mov_b32_e32 v9, v0
3052 ; GFX908-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3053 ; GFX908-NEXT: v_mov_b32_e32 v0, v7
3054 ; GFX908-NEXT: v_mov_b32_e32 v1, v8
3055 ; GFX908-NEXT: v_mov_b32_e32 v2, v9
3056 ; GFX908-NEXT: v_mov_b32_e32 v3, v10
3057 ; GFX908-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3058 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3059 ; GFX908-NEXT: buffer_wbinvl1
3060 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
3061 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3062 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
3063 ; GFX908-NEXT: s_cbranch_execnz .LBB11_1
3064 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
3065 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
3066 ; GFX908-NEXT: s_setpc_b64 s[30:31]
3068 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
3070 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3071 ; GFX8-NEXT: v_mov_b32_e32 v4, v0
3072 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
3073 ; GFX8-NEXT: v_mov_b32_e32 v5, v1
3074 ; GFX8-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3075 ; GFX8-NEXT: s_add_i32 s6, s20, 0x800
3076 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
3077 ; GFX8-NEXT: v_mov_b32_e32 v6, s6
3078 ; GFX8-NEXT: .LBB11_1: ; %atomicrmw.start
3079 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
3080 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3081 ; GFX8-NEXT: v_mov_b32_e32 v10, v1
3082 ; GFX8-NEXT: v_mov_b32_e32 v9, v0
3083 ; GFX8-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3084 ; GFX8-NEXT: v_mov_b32_e32 v0, v7
3085 ; GFX8-NEXT: v_mov_b32_e32 v1, v8
3086 ; GFX8-NEXT: v_mov_b32_e32 v2, v9
3087 ; GFX8-NEXT: v_mov_b32_e32 v3, v10
3088 ; GFX8-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3089 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3090 ; GFX8-NEXT: buffer_wbinvl1
3091 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
3092 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3093 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
3094 ; GFX8-NEXT: s_cbranch_execnz .LBB11_1
3095 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
3096 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
3097 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3099 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
3101 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3102 ; GFX7-NEXT: v_mov_b32_e32 v4, v0
3103 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
3104 ; GFX7-NEXT: v_mov_b32_e32 v5, v1
3105 ; GFX7-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3106 ; GFX7-NEXT: s_add_i32 s6, s20, 0x800
3107 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
3108 ; GFX7-NEXT: v_mov_b32_e32 v6, s6
3109 ; GFX7-NEXT: .LBB11_1: ; %atomicrmw.start
3110 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
3111 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3112 ; GFX7-NEXT: v_mov_b32_e32 v10, v1
3113 ; GFX7-NEXT: v_mov_b32_e32 v9, v0
3114 ; GFX7-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3115 ; GFX7-NEXT: v_mov_b32_e32 v0, v7
3116 ; GFX7-NEXT: v_mov_b32_e32 v1, v8
3117 ; GFX7-NEXT: v_mov_b32_e32 v2, v9
3118 ; GFX7-NEXT: v_mov_b32_e32 v3, v10
3119 ; GFX7-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3120 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3121 ; GFX7-NEXT: buffer_wbinvl1
3122 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
3123 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3124 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
3125 ; GFX7-NEXT: s_cbranch_execnz .LBB11_1
3126 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
3127 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
3128 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3130 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_remote_memory:
3132 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3133 ; GFX6-NEXT: v_mov_b32_e32 v4, v0
3134 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
3135 ; GFX6-NEXT: v_mov_b32_e32 v5, v1
3136 ; GFX6-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3137 ; GFX6-NEXT: s_add_i32 s6, s20, 0x800
3138 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
3139 ; GFX6-NEXT: v_mov_b32_e32 v6, s6
3140 ; GFX6-NEXT: .LBB11_1: ; %atomicrmw.start
3141 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
3142 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3143 ; GFX6-NEXT: v_mov_b32_e32 v10, v1
3144 ; GFX6-NEXT: v_mov_b32_e32 v9, v0
3145 ; GFX6-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3146 ; GFX6-NEXT: s_waitcnt expcnt(0)
3147 ; GFX6-NEXT: v_mov_b32_e32 v0, v7
3148 ; GFX6-NEXT: v_mov_b32_e32 v1, v8
3149 ; GFX6-NEXT: v_mov_b32_e32 v2, v9
3150 ; GFX6-NEXT: v_mov_b32_e32 v3, v10
3151 ; GFX6-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3152 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3153 ; GFX6-NEXT: buffer_wbinvl1
3154 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
3155 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3156 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
3157 ; GFX6-NEXT: s_cbranch_execnz .LBB11_1
3158 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
3159 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
3160 ; GFX6-NEXT: s_waitcnt expcnt(0)
3161 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3162 %gep = getelementptr double, ptr addrspace(7) %ptr, i32 256
3163 %result = atomicrmw fadd ptr addrspace(7) %gep, double %val syncscope("agent") seq_cst, !amdgpu.no.remote.memory !0
3167 define double @buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory(ptr addrspace(7) inreg %ptr, double %val) #0 {
3168 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3170 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
3171 ; GFX12-NEXT: s_wait_expcnt 0x0
3172 ; GFX12-NEXT: s_wait_samplecnt 0x0
3173 ; GFX12-NEXT: s_wait_bvhcnt 0x0
3174 ; GFX12-NEXT: s_wait_kmcnt 0x0
3175 ; GFX12-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
3176 ; GFX12-NEXT: v_mov_b32_e32 v0, s16
3177 ; GFX12-NEXT: s_add_co_i32 s4, s16, 0x800
3178 ; GFX12-NEXT: s_wait_alu 0xfffe
3179 ; GFX12-NEXT: v_mov_b32_e32 v6, s4
3180 ; GFX12-NEXT: s_mov_b32 s4, 0
3181 ; GFX12-NEXT: buffer_load_b64 v[0:1], v0, s[0:3], null offen offset:2048
3182 ; GFX12-NEXT: .LBB12_1: ; %atomicrmw.start
3183 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
3184 ; GFX12-NEXT: s_wait_loadcnt 0x0
3185 ; GFX12-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
3186 ; GFX12-NEXT: s_wait_storecnt 0x0
3187 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3188 ; GFX12-NEXT: v_add_f64_e32 v[7:8], v[9:10], v[4:5]
3189 ; GFX12-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
3190 ; GFX12-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
3191 ; GFX12-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v6, s[0:3], null offen th:TH_ATOMIC_RETURN
3192 ; GFX12-NEXT: s_wait_loadcnt 0x0
3193 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
3194 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
3195 ; GFX12-NEXT: s_wait_alu 0xfffe
3196 ; GFX12-NEXT: s_or_b32 s4, vcc_lo, s4
3197 ; GFX12-NEXT: s_wait_alu 0xfffe
3198 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
3199 ; GFX12-NEXT: s_cbranch_execnz .LBB12_1
3200 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
3201 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s4
3202 ; GFX12-NEXT: s_wait_alu 0xfffe
3203 ; GFX12-NEXT: s_setpc_b64 s[30:31]
3205 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3207 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3208 ; GFX940-NEXT: v_mov_b32_e32 v2, s16
3209 ; GFX940-NEXT: buffer_wbl2 sc1
3210 ; GFX940-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[0:3], 0 offen offset:2048 sc0
3211 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3212 ; GFX940-NEXT: buffer_inv sc1
3213 ; GFX940-NEXT: s_setpc_b64 s[30:31]
3215 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3217 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3218 ; GFX11-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
3219 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
3220 ; GFX11-NEXT: s_add_i32 s4, s16, 0x800
3221 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3222 ; GFX11-NEXT: v_mov_b32_e32 v6, s4
3223 ; GFX11-NEXT: s_mov_b32 s4, 0
3224 ; GFX11-NEXT: buffer_load_b64 v[0:1], v0, s[0:3], 0 offen offset:2048
3225 ; GFX11-NEXT: .LBB12_1: ; %atomicrmw.start
3226 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
3227 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3228 ; GFX11-NEXT: v_dual_mov_b32 v10, v1 :: v_dual_mov_b32 v9, v0
3229 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
3230 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3231 ; GFX11-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3232 ; GFX11-NEXT: v_dual_mov_b32 v0, v7 :: v_dual_mov_b32 v1, v8
3233 ; GFX11-NEXT: v_dual_mov_b32 v2, v9 :: v_dual_mov_b32 v3, v10
3234 ; GFX11-NEXT: buffer_atomic_cmpswap_b64 v[0:3], v6, s[0:3], 0 offen glc
3235 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3236 ; GFX11-NEXT: buffer_gl1_inv
3237 ; GFX11-NEXT: buffer_gl0_inv
3238 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
3239 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
3240 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3241 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
3242 ; GFX11-NEXT: s_cbranch_execnz .LBB12_1
3243 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
3244 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
3245 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3247 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3249 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3250 ; GFX10-NEXT: v_mov_b32_e32 v4, v0
3251 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
3252 ; GFX10-NEXT: v_mov_b32_e32 v5, v1
3253 ; GFX10-NEXT: s_add_i32 s4, s20, 0x800
3254 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
3255 ; GFX10-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3256 ; GFX10-NEXT: s_mov_b32 s4, 0
3257 ; GFX10-NEXT: .LBB12_1: ; %atomicrmw.start
3258 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
3259 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3260 ; GFX10-NEXT: v_mov_b32_e32 v10, v1
3261 ; GFX10-NEXT: v_mov_b32_e32 v9, v0
3262 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
3263 ; GFX10-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3264 ; GFX10-NEXT: v_mov_b32_e32 v0, v7
3265 ; GFX10-NEXT: v_mov_b32_e32 v1, v8
3266 ; GFX10-NEXT: v_mov_b32_e32 v2, v9
3267 ; GFX10-NEXT: v_mov_b32_e32 v3, v10
3268 ; GFX10-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3269 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3270 ; GFX10-NEXT: buffer_gl1_inv
3271 ; GFX10-NEXT: buffer_gl0_inv
3272 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, v[0:1], v[9:10]
3273 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
3274 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
3275 ; GFX10-NEXT: s_cbranch_execnz .LBB12_1
3276 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
3277 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
3278 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3280 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3282 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3283 ; GFX90A-NEXT: v_mov_b32_e32 v2, s20
3284 ; GFX90A-NEXT: buffer_atomic_add_f64 v[0:1], v2, s[16:19], 0 offen offset:2048 glc
3285 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3286 ; GFX90A-NEXT: buffer_wbinvl1
3287 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
3289 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3291 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3292 ; GFX908-NEXT: v_mov_b32_e32 v4, v0
3293 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
3294 ; GFX908-NEXT: v_mov_b32_e32 v5, v1
3295 ; GFX908-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3296 ; GFX908-NEXT: s_add_i32 s6, s20, 0x800
3297 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
3298 ; GFX908-NEXT: v_mov_b32_e32 v6, s6
3299 ; GFX908-NEXT: .LBB12_1: ; %atomicrmw.start
3300 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
3301 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3302 ; GFX908-NEXT: v_mov_b32_e32 v10, v1
3303 ; GFX908-NEXT: v_mov_b32_e32 v9, v0
3304 ; GFX908-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3305 ; GFX908-NEXT: v_mov_b32_e32 v0, v7
3306 ; GFX908-NEXT: v_mov_b32_e32 v1, v8
3307 ; GFX908-NEXT: v_mov_b32_e32 v2, v9
3308 ; GFX908-NEXT: v_mov_b32_e32 v3, v10
3309 ; GFX908-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3310 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3311 ; GFX908-NEXT: buffer_wbinvl1
3312 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
3313 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3314 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
3315 ; GFX908-NEXT: s_cbranch_execnz .LBB12_1
3316 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
3317 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
3318 ; GFX908-NEXT: s_setpc_b64 s[30:31]
3320 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3322 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3323 ; GFX8-NEXT: v_mov_b32_e32 v4, v0
3324 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
3325 ; GFX8-NEXT: v_mov_b32_e32 v5, v1
3326 ; GFX8-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3327 ; GFX8-NEXT: s_add_i32 s6, s20, 0x800
3328 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
3329 ; GFX8-NEXT: v_mov_b32_e32 v6, s6
3330 ; GFX8-NEXT: .LBB12_1: ; %atomicrmw.start
3331 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
3332 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3333 ; GFX8-NEXT: v_mov_b32_e32 v10, v1
3334 ; GFX8-NEXT: v_mov_b32_e32 v9, v0
3335 ; GFX8-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3336 ; GFX8-NEXT: v_mov_b32_e32 v0, v7
3337 ; GFX8-NEXT: v_mov_b32_e32 v1, v8
3338 ; GFX8-NEXT: v_mov_b32_e32 v2, v9
3339 ; GFX8-NEXT: v_mov_b32_e32 v3, v10
3340 ; GFX8-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3341 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3342 ; GFX8-NEXT: buffer_wbinvl1
3343 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
3344 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3345 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
3346 ; GFX8-NEXT: s_cbranch_execnz .LBB12_1
3347 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
3348 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
3349 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3351 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3353 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3354 ; GFX7-NEXT: v_mov_b32_e32 v4, v0
3355 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
3356 ; GFX7-NEXT: v_mov_b32_e32 v5, v1
3357 ; GFX7-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3358 ; GFX7-NEXT: s_add_i32 s6, s20, 0x800
3359 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
3360 ; GFX7-NEXT: v_mov_b32_e32 v6, s6
3361 ; GFX7-NEXT: .LBB12_1: ; %atomicrmw.start
3362 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
3363 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3364 ; GFX7-NEXT: v_mov_b32_e32 v10, v1
3365 ; GFX7-NEXT: v_mov_b32_e32 v9, v0
3366 ; GFX7-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3367 ; GFX7-NEXT: v_mov_b32_e32 v0, v7
3368 ; GFX7-NEXT: v_mov_b32_e32 v1, v8
3369 ; GFX7-NEXT: v_mov_b32_e32 v2, v9
3370 ; GFX7-NEXT: v_mov_b32_e32 v3, v10
3371 ; GFX7-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3372 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3373 ; GFX7-NEXT: buffer_wbinvl1
3374 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
3375 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3376 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
3377 ; GFX7-NEXT: s_cbranch_execnz .LBB12_1
3378 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
3379 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
3380 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3382 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f64__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
3384 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3385 ; GFX6-NEXT: v_mov_b32_e32 v4, v0
3386 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
3387 ; GFX6-NEXT: v_mov_b32_e32 v5, v1
3388 ; GFX6-NEXT: buffer_load_dwordx2 v[0:1], v0, s[16:19], 0 offen offset:2048
3389 ; GFX6-NEXT: s_add_i32 s6, s20, 0x800
3390 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
3391 ; GFX6-NEXT: v_mov_b32_e32 v6, s6
3392 ; GFX6-NEXT: .LBB12_1: ; %atomicrmw.start
3393 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
3394 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3395 ; GFX6-NEXT: v_mov_b32_e32 v10, v1
3396 ; GFX6-NEXT: v_mov_b32_e32 v9, v0
3397 ; GFX6-NEXT: v_add_f64 v[7:8], v[9:10], v[4:5]
3398 ; GFX6-NEXT: s_waitcnt expcnt(0)
3399 ; GFX6-NEXT: v_mov_b32_e32 v0, v7
3400 ; GFX6-NEXT: v_mov_b32_e32 v1, v8
3401 ; GFX6-NEXT: v_mov_b32_e32 v2, v9
3402 ; GFX6-NEXT: v_mov_b32_e32 v3, v10
3403 ; GFX6-NEXT: buffer_atomic_cmpswap_x2 v[0:3], v6, s[16:19], 0 offen glc
3404 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3405 ; GFX6-NEXT: buffer_wbinvl1
3406 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, v[0:1], v[9:10]
3407 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3408 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
3409 ; GFX6-NEXT: s_cbranch_execnz .LBB12_1
3410 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
3411 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
3412 ; GFX6-NEXT: s_waitcnt expcnt(0)
3413 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3414 %gep = getelementptr double, ptr addrspace(7) %ptr, i32 256
3415 %result = atomicrmw fadd ptr addrspace(7) %gep, double %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0, !amdgpu.no.remote.memory !0
3419 ; --------------------------------------------------------------------
3421 ; --------------------------------------------------------------------
3423 define half @buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, half %val) #0 {
3424 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3426 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
3427 ; GFX12-NEXT: s_wait_expcnt 0x0
3428 ; GFX12-NEXT: s_wait_samplecnt 0x0
3429 ; GFX12-NEXT: s_wait_bvhcnt 0x0
3430 ; GFX12-NEXT: s_wait_kmcnt 0x0
3431 ; GFX12-NEXT: s_addk_co_i32 s16, 0x200
3432 ; GFX12-NEXT: s_wait_alu 0xfffe
3433 ; GFX12-NEXT: s_and_b32 s4, s16, -4
3434 ; GFX12-NEXT: s_wait_alu 0xfffe
3435 ; GFX12-NEXT: v_mov_b32_e32 v5, s4
3436 ; GFX12-NEXT: s_and_b32 s4, s16, 3
3437 ; GFX12-NEXT: s_wait_alu 0xfffe
3438 ; GFX12-NEXT: s_lshl_b32 s4, s4, 3
3439 ; GFX12-NEXT: s_wait_alu 0xfffe
3440 ; GFX12-NEXT: s_lshl_b32 s5, 0xffff, s4
3441 ; GFX12-NEXT: buffer_load_b32 v2, v5, s[0:3], null offen
3442 ; GFX12-NEXT: s_wait_alu 0xfffe
3443 ; GFX12-NEXT: s_not_b32 s6, s5
3444 ; GFX12-NEXT: s_mov_b32 s5, 0
3445 ; GFX12-NEXT: .LBB13_1: ; %atomicrmw.start
3446 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
3447 ; GFX12-NEXT: s_wait_loadcnt 0x0
3448 ; GFX12-NEXT: v_lshrrev_b32_e32 v1, s4, v2
3449 ; GFX12-NEXT: s_wait_storecnt 0x0
3450 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3451 ; GFX12-NEXT: v_add_f16_e32 v1, v1, v0
3452 ; GFX12-NEXT: v_and_b32_e32 v1, 0xffff, v1
3453 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
3454 ; GFX12-NEXT: v_lshlrev_b32_e32 v1, s4, v1
3455 ; GFX12-NEXT: s_wait_alu 0xfffe
3456 ; GFX12-NEXT: v_and_or_b32 v1, v2, s6, v1
3457 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
3458 ; GFX12-NEXT: v_dual_mov_b32 v4, v2 :: v_dual_mov_b32 v3, v1
3459 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[3:4], v5, s[0:3], null offen th:TH_ATOMIC_RETURN
3460 ; GFX12-NEXT: s_wait_loadcnt 0x0
3461 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
3462 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v2
3463 ; GFX12-NEXT: v_mov_b32_e32 v2, v3
3464 ; GFX12-NEXT: s_or_b32 s5, vcc_lo, s5
3465 ; GFX12-NEXT: s_wait_alu 0xfffe
3466 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
3467 ; GFX12-NEXT: s_cbranch_execnz .LBB13_1
3468 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
3469 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s5
3470 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, s4, v3
3471 ; GFX12-NEXT: s_wait_alu 0xfffe
3472 ; GFX12-NEXT: s_setpc_b64 s[30:31]
3474 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3476 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3477 ; GFX940-NEXT: s_addk_i32 s16, 0x200
3478 ; GFX940-NEXT: s_and_b32 s4, s16, -4
3479 ; GFX940-NEXT: v_mov_b32_e32 v1, s4
3480 ; GFX940-NEXT: buffer_load_dword v3, v1, s[0:3], 0 offen
3481 ; GFX940-NEXT: s_and_b32 s4, s16, 3
3482 ; GFX940-NEXT: s_lshl_b32 s6, s4, 3
3483 ; GFX940-NEXT: s_lshl_b32 s4, 0xffff, s6
3484 ; GFX940-NEXT: s_not_b32 s7, s4
3485 ; GFX940-NEXT: s_mov_b64 s[4:5], 0
3486 ; GFX940-NEXT: .LBB13_1: ; %atomicrmw.start
3487 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
3488 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3489 ; GFX940-NEXT: v_lshrrev_b32_e32 v2, s6, v3
3490 ; GFX940-NEXT: v_add_f16_e32 v2, v2, v0
3491 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, s6, v2
3492 ; GFX940-NEXT: v_and_or_b32 v2, v3, s7, v2
3493 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[2:3]
3494 ; GFX940-NEXT: buffer_wbl2 sc1
3495 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[0:3], 0 offen sc0
3496 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3497 ; GFX940-NEXT: buffer_inv sc1
3498 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
3499 ; GFX940-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3500 ; GFX940-NEXT: v_mov_b32_e32 v3, v4
3501 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[4:5]
3502 ; GFX940-NEXT: s_cbranch_execnz .LBB13_1
3503 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
3504 ; GFX940-NEXT: s_or_b64 exec, exec, s[4:5]
3505 ; GFX940-NEXT: v_lshrrev_b32_e32 v0, s6, v4
3506 ; GFX940-NEXT: s_setpc_b64 s[30:31]
3508 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3510 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3511 ; GFX11-NEXT: s_addk_i32 s16, 0x200
3512 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
3513 ; GFX11-NEXT: s_and_b32 s4, s16, -4
3514 ; GFX11-NEXT: v_mov_b32_e32 v5, s4
3515 ; GFX11-NEXT: s_and_b32 s4, s16, 3
3516 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
3517 ; GFX11-NEXT: s_lshl_b32 s4, s4, 3
3518 ; GFX11-NEXT: s_lshl_b32 s5, 0xffff, s4
3519 ; GFX11-NEXT: buffer_load_b32 v2, v5, s[0:3], 0 offen
3520 ; GFX11-NEXT: s_not_b32 s6, s5
3521 ; GFX11-NEXT: s_mov_b32 s5, 0
3522 ; GFX11-NEXT: .LBB13_1: ; %atomicrmw.start
3523 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
3524 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3525 ; GFX11-NEXT: v_lshrrev_b32_e32 v1, s4, v2
3526 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
3527 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3528 ; GFX11-NEXT: v_add_f16_e32 v1, v1, v0
3529 ; GFX11-NEXT: v_and_b32_e32 v1, 0xffff, v1
3530 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3531 ; GFX11-NEXT: v_lshlrev_b32_e32 v1, s4, v1
3532 ; GFX11-NEXT: v_and_or_b32 v1, v2, s6, v1
3533 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
3534 ; GFX11-NEXT: v_dual_mov_b32 v4, v2 :: v_dual_mov_b32 v3, v1
3535 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[3:4], v5, s[0:3], 0 offen glc
3536 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3537 ; GFX11-NEXT: buffer_gl1_inv
3538 ; GFX11-NEXT: buffer_gl0_inv
3539 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v2
3540 ; GFX11-NEXT: v_mov_b32_e32 v2, v3
3541 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
3542 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3543 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
3544 ; GFX11-NEXT: s_cbranch_execnz .LBB13_1
3545 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
3546 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
3547 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, s4, v3
3548 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3550 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3552 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3553 ; GFX10-NEXT: s_addk_i32 s20, 0x200
3554 ; GFX10-NEXT: s_and_b32 s4, s20, -4
3555 ; GFX10-NEXT: v_mov_b32_e32 v5, s4
3556 ; GFX10-NEXT: s_and_b32 s4, s20, 3
3557 ; GFX10-NEXT: s_lshl_b32 s4, s4, 3
3558 ; GFX10-NEXT: s_lshl_b32 s5, 0xffff, s4
3559 ; GFX10-NEXT: buffer_load_dword v2, v5, s[16:19], 0 offen
3560 ; GFX10-NEXT: s_not_b32 s6, s5
3561 ; GFX10-NEXT: s_mov_b32 s5, 0
3562 ; GFX10-NEXT: .LBB13_1: ; %atomicrmw.start
3563 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
3564 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3565 ; GFX10-NEXT: v_lshrrev_b32_e32 v1, s4, v2
3566 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
3567 ; GFX10-NEXT: v_add_f16_e32 v1, v1, v0
3568 ; GFX10-NEXT: v_lshlrev_b32_sdwa v1, s4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
3569 ; GFX10-NEXT: v_and_or_b32 v1, v2, s6, v1
3570 ; GFX10-NEXT: v_mov_b32_e32 v4, v2
3571 ; GFX10-NEXT: v_mov_b32_e32 v3, v1
3572 ; GFX10-NEXT: buffer_atomic_cmpswap v[3:4], v5, s[16:19], 0 offen glc
3573 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3574 ; GFX10-NEXT: buffer_gl1_inv
3575 ; GFX10-NEXT: buffer_gl0_inv
3576 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v3, v2
3577 ; GFX10-NEXT: v_mov_b32_e32 v2, v3
3578 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
3579 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
3580 ; GFX10-NEXT: s_cbranch_execnz .LBB13_1
3581 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
3582 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
3583 ; GFX10-NEXT: v_lshrrev_b32_e32 v0, s4, v3
3584 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3586 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3588 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3589 ; GFX90A-NEXT: s_addk_i32 s20, 0x200
3590 ; GFX90A-NEXT: s_and_b32 s4, s20, -4
3591 ; GFX90A-NEXT: v_mov_b32_e32 v1, s4
3592 ; GFX90A-NEXT: buffer_load_dword v3, v1, s[16:19], 0 offen
3593 ; GFX90A-NEXT: s_and_b32 s4, s20, 3
3594 ; GFX90A-NEXT: s_lshl_b32 s6, s4, 3
3595 ; GFX90A-NEXT: s_lshl_b32 s4, 0xffff, s6
3596 ; GFX90A-NEXT: s_not_b32 s7, s4
3597 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
3598 ; GFX90A-NEXT: .LBB13_1: ; %atomicrmw.start
3599 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
3600 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3601 ; GFX90A-NEXT: v_lshrrev_b32_e32 v2, s6, v3
3602 ; GFX90A-NEXT: v_add_f16_e32 v2, v2, v0
3603 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, s6, v2
3604 ; GFX90A-NEXT: v_and_or_b32 v2, v3, s7, v2
3605 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[2:3], v[2:3] op_sel:[0,1]
3606 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[16:19], 0 offen glc
3607 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3608 ; GFX90A-NEXT: buffer_wbinvl1
3609 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
3610 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3611 ; GFX90A-NEXT: v_mov_b32_e32 v3, v4
3612 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
3613 ; GFX90A-NEXT: s_cbranch_execnz .LBB13_1
3614 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
3615 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
3616 ; GFX90A-NEXT: v_lshrrev_b32_e32 v0, s6, v4
3617 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
3619 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3621 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3622 ; GFX908-NEXT: s_addk_i32 s20, 0x200
3623 ; GFX908-NEXT: s_and_b32 s4, s20, -4
3624 ; GFX908-NEXT: v_mov_b32_e32 v5, s4
3625 ; GFX908-NEXT: buffer_load_dword v2, v5, s[16:19], 0 offen
3626 ; GFX908-NEXT: s_and_b32 s4, s20, 3
3627 ; GFX908-NEXT: s_lshl_b32 s6, s4, 3
3628 ; GFX908-NEXT: s_lshl_b32 s4, 0xffff, s6
3629 ; GFX908-NEXT: s_not_b32 s7, s4
3630 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
3631 ; GFX908-NEXT: .LBB13_1: ; %atomicrmw.start
3632 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
3633 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3634 ; GFX908-NEXT: v_lshrrev_b32_e32 v1, s6, v2
3635 ; GFX908-NEXT: v_add_f16_e32 v1, v1, v0
3636 ; GFX908-NEXT: v_lshlrev_b32_e32 v1, s6, v1
3637 ; GFX908-NEXT: v_and_or_b32 v1, v2, s7, v1
3638 ; GFX908-NEXT: v_mov_b32_e32 v4, v2
3639 ; GFX908-NEXT: v_mov_b32_e32 v3, v1
3640 ; GFX908-NEXT: buffer_atomic_cmpswap v[3:4], v5, s[16:19], 0 offen glc
3641 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3642 ; GFX908-NEXT: buffer_wbinvl1
3643 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v3, v2
3644 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3645 ; GFX908-NEXT: v_mov_b32_e32 v2, v3
3646 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
3647 ; GFX908-NEXT: s_cbranch_execnz .LBB13_1
3648 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
3649 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
3650 ; GFX908-NEXT: v_lshrrev_b32_e32 v0, s6, v3
3651 ; GFX908-NEXT: s_setpc_b64 s[30:31]
3653 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3655 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3656 ; GFX8-NEXT: s_addk_i32 s20, 0x200
3657 ; GFX8-NEXT: s_and_b32 s4, s20, -4
3658 ; GFX8-NEXT: v_mov_b32_e32 v5, s4
3659 ; GFX8-NEXT: buffer_load_dword v2, v5, s[16:19], 0 offen
3660 ; GFX8-NEXT: s_and_b32 s4, s20, 3
3661 ; GFX8-NEXT: s_lshl_b32 s6, s4, 3
3662 ; GFX8-NEXT: s_lshl_b32 s4, 0xffff, s6
3663 ; GFX8-NEXT: s_not_b32 s7, s4
3664 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
3665 ; GFX8-NEXT: .LBB13_1: ; %atomicrmw.start
3666 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
3667 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3668 ; GFX8-NEXT: v_lshrrev_b32_e32 v1, s6, v2
3669 ; GFX8-NEXT: v_add_f16_e32 v1, v1, v0
3670 ; GFX8-NEXT: v_and_b32_e32 v3, s7, v2
3671 ; GFX8-NEXT: v_lshlrev_b32_e32 v1, s6, v1
3672 ; GFX8-NEXT: v_or_b32_e32 v1, v3, v1
3673 ; GFX8-NEXT: v_mov_b32_e32 v4, v2
3674 ; GFX8-NEXT: v_mov_b32_e32 v3, v1
3675 ; GFX8-NEXT: buffer_atomic_cmpswap v[3:4], v5, s[16:19], 0 offen glc
3676 ; GFX8-NEXT: s_waitcnt vmcnt(0)
3677 ; GFX8-NEXT: buffer_wbinvl1
3678 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v3, v2
3679 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3680 ; GFX8-NEXT: v_mov_b32_e32 v2, v3
3681 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
3682 ; GFX8-NEXT: s_cbranch_execnz .LBB13_1
3683 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
3684 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
3685 ; GFX8-NEXT: v_lshrrev_b32_e32 v0, s6, v3
3686 ; GFX8-NEXT: s_setpc_b64 s[30:31]
3688 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3690 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3691 ; GFX7-NEXT: s_addk_i32 s20, 0x200
3692 ; GFX7-NEXT: s_and_b32 s4, s20, -4
3693 ; GFX7-NEXT: v_mov_b32_e32 v4, s4
3694 ; GFX7-NEXT: buffer_load_dword v1, v4, s[16:19], 0 offen
3695 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
3696 ; GFX7-NEXT: s_and_b32 s4, s20, 3
3697 ; GFX7-NEXT: s_lshl_b32 s6, s4, 3
3698 ; GFX7-NEXT: s_lshl_b32 s4, 0xffff, s6
3699 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v0
3700 ; GFX7-NEXT: s_not_b32 s7, s4
3701 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
3702 ; GFX7-NEXT: .LBB13_1: ; %atomicrmw.start
3703 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
3704 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3705 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v1
3706 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0
3707 ; GFX7-NEXT: v_and_b32_e32 v2, s7, v1
3708 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v5
3709 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
3710 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, s6, v0
3711 ; GFX7-NEXT: v_or_b32_e32 v0, v2, v0
3712 ; GFX7-NEXT: v_mov_b32_e32 v3, v1
3713 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
3714 ; GFX7-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[16:19], 0 offen glc
3715 ; GFX7-NEXT: s_waitcnt vmcnt(0)
3716 ; GFX7-NEXT: buffer_wbinvl1
3717 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
3718 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3719 ; GFX7-NEXT: v_mov_b32_e32 v1, v2
3720 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
3721 ; GFX7-NEXT: s_cbranch_execnz .LBB13_1
3722 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
3723 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
3724 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v2
3725 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0
3726 ; GFX7-NEXT: s_setpc_b64 s[30:31]
3728 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__amdgpu_no_fine_grained_memory:
3730 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3731 ; GFX6-NEXT: s_addk_i32 s20, 0x200
3732 ; GFX6-NEXT: s_and_b32 s4, s20, -4
3733 ; GFX6-NEXT: v_mov_b32_e32 v4, s4
3734 ; GFX6-NEXT: buffer_load_dword v1, v4, s[16:19], 0 offen
3735 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
3736 ; GFX6-NEXT: s_and_b32 s4, s20, 3
3737 ; GFX6-NEXT: s_lshl_b32 s6, s4, 3
3738 ; GFX6-NEXT: s_lshl_b32 s4, 0xffff, s6
3739 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v0
3740 ; GFX6-NEXT: s_not_b32 s7, s4
3741 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
3742 ; GFX6-NEXT: .LBB13_1: ; %atomicrmw.start
3743 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
3744 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3745 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v1
3746 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
3747 ; GFX6-NEXT: s_waitcnt expcnt(0)
3748 ; GFX6-NEXT: v_and_b32_e32 v2, s7, v1
3749 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v5
3750 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
3751 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, s6, v0
3752 ; GFX6-NEXT: v_or_b32_e32 v0, v2, v0
3753 ; GFX6-NEXT: v_mov_b32_e32 v3, v1
3754 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
3755 ; GFX6-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[16:19], 0 offen glc
3756 ; GFX6-NEXT: s_waitcnt vmcnt(0)
3757 ; GFX6-NEXT: buffer_wbinvl1
3758 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
3759 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3760 ; GFX6-NEXT: v_mov_b32_e32 v1, v2
3761 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
3762 ; GFX6-NEXT: s_cbranch_execnz .LBB13_1
3763 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
3764 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
3765 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v2
3766 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
3767 ; GFX6-NEXT: s_waitcnt expcnt(0)
3768 ; GFX6-NEXT: s_setpc_b64 s[30:31]
3769 %gep = getelementptr half, ptr addrspace(7) %ptr, i32 256
3770 %result = atomicrmw fadd ptr addrspace(7) %gep, half %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
3774 define void @buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, half %val) #0 {
3775 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
3777 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
3778 ; GFX12-NEXT: s_wait_expcnt 0x0
3779 ; GFX12-NEXT: s_wait_samplecnt 0x0
3780 ; GFX12-NEXT: s_wait_bvhcnt 0x0
3781 ; GFX12-NEXT: s_wait_kmcnt 0x0
3782 ; GFX12-NEXT: s_addk_co_i32 s16, 0x200
3783 ; GFX12-NEXT: s_wait_alu 0xfffe
3784 ; GFX12-NEXT: s_and_b32 s4, s16, -4
3785 ; GFX12-NEXT: s_wait_alu 0xfffe
3786 ; GFX12-NEXT: v_mov_b32_e32 v3, s4
3787 ; GFX12-NEXT: s_and_b32 s4, s16, 3
3788 ; GFX12-NEXT: s_wait_alu 0xfffe
3789 ; GFX12-NEXT: s_lshl_b32 s4, s4, 3
3790 ; GFX12-NEXT: s_wait_alu 0xfffe
3791 ; GFX12-NEXT: s_lshl_b32 s5, 0xffff, s4
3792 ; GFX12-NEXT: buffer_load_b32 v2, v3, s[0:3], null offen
3793 ; GFX12-NEXT: s_wait_alu 0xfffe
3794 ; GFX12-NEXT: s_not_b32 s6, s5
3795 ; GFX12-NEXT: s_mov_b32 s5, 0
3796 ; GFX12-NEXT: .LBB14_1: ; %atomicrmw.start
3797 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
3798 ; GFX12-NEXT: s_wait_loadcnt 0x0
3799 ; GFX12-NEXT: v_lshrrev_b32_e32 v1, s4, v2
3800 ; GFX12-NEXT: s_wait_storecnt 0x0
3801 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3802 ; GFX12-NEXT: v_add_f16_e32 v1, v1, v0
3803 ; GFX12-NEXT: v_and_b32_e32 v1, 0xffff, v1
3804 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
3805 ; GFX12-NEXT: v_lshlrev_b32_e32 v1, s4, v1
3806 ; GFX12-NEXT: s_wait_alu 0xfffe
3807 ; GFX12-NEXT: v_and_or_b32 v1, v2, s6, v1
3808 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
3809 ; GFX12-NEXT: v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v4, v1
3810 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v3, s[0:3], null offen th:TH_ATOMIC_RETURN
3811 ; GFX12-NEXT: s_wait_loadcnt 0x0
3812 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
3813 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
3814 ; GFX12-NEXT: v_mov_b32_e32 v2, v4
3815 ; GFX12-NEXT: s_or_b32 s5, vcc_lo, s5
3816 ; GFX12-NEXT: s_wait_alu 0xfffe
3817 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
3818 ; GFX12-NEXT: s_cbranch_execnz .LBB14_1
3819 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
3820 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s5
3821 ; GFX12-NEXT: s_wait_alu 0xfffe
3822 ; GFX12-NEXT: s_setpc_b64 s[30:31]
3824 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
3826 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3827 ; GFX940-NEXT: s_addk_i32 s16, 0x200
3828 ; GFX940-NEXT: s_and_b32 s4, s16, -4
3829 ; GFX940-NEXT: v_mov_b32_e32 v1, s4
3830 ; GFX940-NEXT: buffer_load_dword v3, v1, s[0:3], 0 offen
3831 ; GFX940-NEXT: s_and_b32 s4, s16, 3
3832 ; GFX940-NEXT: s_lshl_b32 s6, s4, 3
3833 ; GFX940-NEXT: s_lshl_b32 s4, 0xffff, s6
3834 ; GFX940-NEXT: s_not_b32 s7, s4
3835 ; GFX940-NEXT: s_mov_b64 s[4:5], 0
3836 ; GFX940-NEXT: .LBB14_1: ; %atomicrmw.start
3837 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
3838 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3839 ; GFX940-NEXT: v_lshrrev_b32_e32 v2, s6, v3
3840 ; GFX940-NEXT: v_add_f16_e32 v2, v2, v0
3841 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, s6, v2
3842 ; GFX940-NEXT: v_and_or_b32 v2, v3, s7, v2
3843 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[2:3]
3844 ; GFX940-NEXT: buffer_wbl2 sc1
3845 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[0:3], 0 offen sc0
3846 ; GFX940-NEXT: s_waitcnt vmcnt(0)
3847 ; GFX940-NEXT: buffer_inv sc1
3848 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
3849 ; GFX940-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3850 ; GFX940-NEXT: v_mov_b32_e32 v3, v4
3851 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[4:5]
3852 ; GFX940-NEXT: s_cbranch_execnz .LBB14_1
3853 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
3854 ; GFX940-NEXT: s_or_b64 exec, exec, s[4:5]
3855 ; GFX940-NEXT: s_setpc_b64 s[30:31]
3857 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
3859 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3860 ; GFX11-NEXT: s_addk_i32 s16, 0x200
3861 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
3862 ; GFX11-NEXT: s_and_b32 s4, s16, -4
3863 ; GFX11-NEXT: v_mov_b32_e32 v3, s4
3864 ; GFX11-NEXT: s_and_b32 s4, s16, 3
3865 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
3866 ; GFX11-NEXT: s_lshl_b32 s4, s4, 3
3867 ; GFX11-NEXT: s_lshl_b32 s5, 0xffff, s4
3868 ; GFX11-NEXT: buffer_load_b32 v2, v3, s[0:3], 0 offen
3869 ; GFX11-NEXT: s_not_b32 s6, s5
3870 ; GFX11-NEXT: s_mov_b32 s5, 0
3871 ; GFX11-NEXT: .LBB14_1: ; %atomicrmw.start
3872 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
3873 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3874 ; GFX11-NEXT: v_lshrrev_b32_e32 v1, s4, v2
3875 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
3876 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3877 ; GFX11-NEXT: v_add_f16_e32 v1, v1, v0
3878 ; GFX11-NEXT: v_and_b32_e32 v1, 0xffff, v1
3879 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
3880 ; GFX11-NEXT: v_lshlrev_b32_e32 v1, s4, v1
3881 ; GFX11-NEXT: v_and_or_b32 v1, v2, s6, v1
3882 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
3883 ; GFX11-NEXT: v_dual_mov_b32 v5, v2 :: v_dual_mov_b32 v4, v1
3884 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v3, s[0:3], 0 offen glc
3885 ; GFX11-NEXT: s_waitcnt vmcnt(0)
3886 ; GFX11-NEXT: buffer_gl1_inv
3887 ; GFX11-NEXT: buffer_gl0_inv
3888 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
3889 ; GFX11-NEXT: v_mov_b32_e32 v2, v4
3890 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
3891 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3892 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
3893 ; GFX11-NEXT: s_cbranch_execnz .LBB14_1
3894 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
3895 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
3896 ; GFX11-NEXT: s_setpc_b64 s[30:31]
3898 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
3900 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3901 ; GFX10-NEXT: s_addk_i32 s20, 0x200
3902 ; GFX10-NEXT: s_and_b32 s4, s20, -4
3903 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
3904 ; GFX10-NEXT: s_and_b32 s4, s20, 3
3905 ; GFX10-NEXT: s_lshl_b32 s4, s4, 3
3906 ; GFX10-NEXT: s_lshl_b32 s5, 0xffff, s4
3907 ; GFX10-NEXT: buffer_load_dword v2, v3, s[16:19], 0 offen
3908 ; GFX10-NEXT: s_not_b32 s6, s5
3909 ; GFX10-NEXT: s_mov_b32 s5, 0
3910 ; GFX10-NEXT: .LBB14_1: ; %atomicrmw.start
3911 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
3912 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3913 ; GFX10-NEXT: v_lshrrev_b32_e32 v1, s4, v2
3914 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
3915 ; GFX10-NEXT: v_add_f16_e32 v1, v1, v0
3916 ; GFX10-NEXT: v_lshlrev_b32_sdwa v1, s4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
3917 ; GFX10-NEXT: v_and_or_b32 v1, v2, s6, v1
3918 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
3919 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
3920 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
3921 ; GFX10-NEXT: s_waitcnt vmcnt(0)
3922 ; GFX10-NEXT: buffer_gl1_inv
3923 ; GFX10-NEXT: buffer_gl0_inv
3924 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
3925 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
3926 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
3927 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
3928 ; GFX10-NEXT: s_cbranch_execnz .LBB14_1
3929 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
3930 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
3931 ; GFX10-NEXT: s_setpc_b64 s[30:31]
3933 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
3935 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3936 ; GFX90A-NEXT: s_addk_i32 s20, 0x200
3937 ; GFX90A-NEXT: s_and_b32 s4, s20, -4
3938 ; GFX90A-NEXT: v_mov_b32_e32 v1, s4
3939 ; GFX90A-NEXT: buffer_load_dword v3, v1, s[16:19], 0 offen
3940 ; GFX90A-NEXT: s_and_b32 s4, s20, 3
3941 ; GFX90A-NEXT: s_lshl_b32 s6, s4, 3
3942 ; GFX90A-NEXT: s_lshl_b32 s4, 0xffff, s6
3943 ; GFX90A-NEXT: s_not_b32 s7, s4
3944 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
3945 ; GFX90A-NEXT: .LBB14_1: ; %atomicrmw.start
3946 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
3947 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3948 ; GFX90A-NEXT: v_lshrrev_b32_e32 v2, s6, v3
3949 ; GFX90A-NEXT: v_add_f16_e32 v2, v2, v0
3950 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, s6, v2
3951 ; GFX90A-NEXT: v_and_or_b32 v2, v3, s7, v2
3952 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[2:3], v[2:3] op_sel:[0,1]
3953 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[16:19], 0 offen glc
3954 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
3955 ; GFX90A-NEXT: buffer_wbinvl1
3956 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
3957 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3958 ; GFX90A-NEXT: v_mov_b32_e32 v3, v4
3959 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
3960 ; GFX90A-NEXT: s_cbranch_execnz .LBB14_1
3961 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
3962 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
3963 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
3965 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
3967 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
3968 ; GFX908-NEXT: s_addk_i32 s20, 0x200
3969 ; GFX908-NEXT: s_and_b32 s4, s20, -4
3970 ; GFX908-NEXT: v_mov_b32_e32 v3, s4
3971 ; GFX908-NEXT: buffer_load_dword v2, v3, s[16:19], 0 offen
3972 ; GFX908-NEXT: s_and_b32 s4, s20, 3
3973 ; GFX908-NEXT: s_lshl_b32 s6, s4, 3
3974 ; GFX908-NEXT: s_lshl_b32 s4, 0xffff, s6
3975 ; GFX908-NEXT: s_not_b32 s7, s4
3976 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
3977 ; GFX908-NEXT: .LBB14_1: ; %atomicrmw.start
3978 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
3979 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3980 ; GFX908-NEXT: v_lshrrev_b32_e32 v1, s6, v2
3981 ; GFX908-NEXT: v_add_f16_e32 v1, v1, v0
3982 ; GFX908-NEXT: v_lshlrev_b32_e32 v1, s6, v1
3983 ; GFX908-NEXT: v_and_or_b32 v1, v2, s7, v1
3984 ; GFX908-NEXT: v_mov_b32_e32 v5, v2
3985 ; GFX908-NEXT: v_mov_b32_e32 v4, v1
3986 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
3987 ; GFX908-NEXT: s_waitcnt vmcnt(0)
3988 ; GFX908-NEXT: buffer_wbinvl1
3989 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
3990 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
3991 ; GFX908-NEXT: v_mov_b32_e32 v2, v4
3992 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
3993 ; GFX908-NEXT: s_cbranch_execnz .LBB14_1
3994 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
3995 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
3996 ; GFX908-NEXT: s_setpc_b64 s[30:31]
3998 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
4000 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4001 ; GFX8-NEXT: s_addk_i32 s20, 0x200
4002 ; GFX8-NEXT: s_and_b32 s4, s20, -4
4003 ; GFX8-NEXT: v_mov_b32_e32 v3, s4
4004 ; GFX8-NEXT: buffer_load_dword v2, v3, s[16:19], 0 offen
4005 ; GFX8-NEXT: s_and_b32 s4, s20, 3
4006 ; GFX8-NEXT: s_lshl_b32 s6, s4, 3
4007 ; GFX8-NEXT: s_lshl_b32 s4, 0xffff, s6
4008 ; GFX8-NEXT: s_not_b32 s7, s4
4009 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
4010 ; GFX8-NEXT: .LBB14_1: ; %atomicrmw.start
4011 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
4012 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4013 ; GFX8-NEXT: v_lshrrev_b32_e32 v1, s6, v2
4014 ; GFX8-NEXT: v_add_f16_e32 v1, v1, v0
4015 ; GFX8-NEXT: v_and_b32_e32 v4, s7, v2
4016 ; GFX8-NEXT: v_lshlrev_b32_e32 v1, s6, v1
4017 ; GFX8-NEXT: v_or_b32_e32 v1, v4, v1
4018 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
4019 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
4020 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
4021 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4022 ; GFX8-NEXT: buffer_wbinvl1
4023 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
4024 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4025 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
4026 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
4027 ; GFX8-NEXT: s_cbranch_execnz .LBB14_1
4028 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
4029 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
4030 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4032 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
4034 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4035 ; GFX7-NEXT: s_addk_i32 s20, 0x200
4036 ; GFX7-NEXT: s_and_b32 s4, s20, -4
4037 ; GFX7-NEXT: v_mov_b32_e32 v2, s4
4038 ; GFX7-NEXT: buffer_load_dword v1, v2, s[16:19], 0 offen
4039 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
4040 ; GFX7-NEXT: s_and_b32 s4, s20, 3
4041 ; GFX7-NEXT: s_lshl_b32 s6, s4, 3
4042 ; GFX7-NEXT: s_lshl_b32 s4, 0xffff, s6
4043 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v0
4044 ; GFX7-NEXT: s_not_b32 s7, s4
4045 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
4046 ; GFX7-NEXT: .LBB14_1: ; %atomicrmw.start
4047 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
4048 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4049 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v1
4050 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0
4051 ; GFX7-NEXT: v_and_b32_e32 v4, s7, v1
4052 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v3
4053 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
4054 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, s6, v0
4055 ; GFX7-NEXT: v_or_b32_e32 v0, v4, v0
4056 ; GFX7-NEXT: v_mov_b32_e32 v5, v1
4057 ; GFX7-NEXT: v_mov_b32_e32 v4, v0
4058 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[16:19], 0 offen glc
4059 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4060 ; GFX7-NEXT: buffer_wbinvl1
4061 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
4062 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4063 ; GFX7-NEXT: v_mov_b32_e32 v1, v4
4064 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
4065 ; GFX7-NEXT: s_cbranch_execnz .LBB14_1
4066 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
4067 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
4068 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4070 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_f16__offset__amdgpu_no_fine_grained_memory:
4072 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4073 ; GFX6-NEXT: s_addk_i32 s20, 0x200
4074 ; GFX6-NEXT: s_and_b32 s4, s20, -4
4075 ; GFX6-NEXT: v_mov_b32_e32 v2, s4
4076 ; GFX6-NEXT: buffer_load_dword v1, v2, s[16:19], 0 offen
4077 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
4078 ; GFX6-NEXT: s_and_b32 s4, s20, 3
4079 ; GFX6-NEXT: s_lshl_b32 s6, s4, 3
4080 ; GFX6-NEXT: s_lshl_b32 s4, 0xffff, s6
4081 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v0
4082 ; GFX6-NEXT: s_not_b32 s7, s4
4083 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
4084 ; GFX6-NEXT: .LBB14_1: ; %atomicrmw.start
4085 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
4086 ; GFX6-NEXT: s_waitcnt vmcnt(0)
4087 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v1
4088 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
4089 ; GFX6-NEXT: s_waitcnt expcnt(0)
4090 ; GFX6-NEXT: v_and_b32_e32 v4, s7, v1
4091 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v3
4092 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
4093 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, s6, v0
4094 ; GFX6-NEXT: v_or_b32_e32 v0, v4, v0
4095 ; GFX6-NEXT: v_mov_b32_e32 v5, v1
4096 ; GFX6-NEXT: v_mov_b32_e32 v4, v0
4097 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[16:19], 0 offen glc
4098 ; GFX6-NEXT: s_waitcnt vmcnt(0)
4099 ; GFX6-NEXT: buffer_wbinvl1
4100 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
4101 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4102 ; GFX6-NEXT: v_mov_b32_e32 v1, v4
4103 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
4104 ; GFX6-NEXT: s_cbranch_execnz .LBB14_1
4105 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
4106 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
4107 ; GFX6-NEXT: s_waitcnt expcnt(0)
4108 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4109 %gep = getelementptr half, ptr addrspace(7) %ptr, i32 256
4110 %unused = atomicrmw fadd ptr addrspace(7) %gep, half %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
4114 define half @buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory(ptr addrspace(7) %ptr, half %val) #0 {
4115 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4117 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
4118 ; GFX12-NEXT: s_wait_expcnt 0x0
4119 ; GFX12-NEXT: s_wait_samplecnt 0x0
4120 ; GFX12-NEXT: s_wait_bvhcnt 0x0
4121 ; GFX12-NEXT: s_wait_kmcnt 0x0
4122 ; GFX12-NEXT: v_add_nc_u32_e32 v6, 0x200, v4
4123 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
4124 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
4125 ; GFX12-NEXT: v_and_b32_e32 v4, 3, v6
4126 ; GFX12-NEXT: v_and_b32_e32 v10, -4, v6
4127 ; GFX12-NEXT: v_lshlrev_b32_e32 v4, 3, v4
4128 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4129 ; GFX12-NEXT: v_lshlrev_b32_e64 v7, v4, 0xffff
4130 ; GFX12-NEXT: v_not_b32_e32 v11, v7
4131 ; GFX12-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4132 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
4133 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
4134 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
4135 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
4136 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
4137 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
4138 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
4139 ; GFX12-NEXT: s_wait_alu 0xfffe
4140 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
4141 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
4142 ; GFX12-NEXT: s_wait_alu 0xfffe
4143 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
4144 ; GFX12-NEXT: s_wait_loadcnt 0x0
4145 ; GFX12-NEXT: buffer_load_b32 v7, v10, s[4:7], null offen
4146 ; GFX12-NEXT: s_wait_alu 0xfffe
4147 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
4148 ; GFX12-NEXT: s_cbranch_execnz .LBB15_1
4149 ; GFX12-NEXT: ; %bb.2:
4150 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
4151 ; GFX12-NEXT: s_mov_b32 s1, 0
4152 ; GFX12-NEXT: .LBB15_3: ; %atomicrmw.start
4153 ; GFX12-NEXT: ; =>This Loop Header: Depth=1
4154 ; GFX12-NEXT: ; Child Loop BB15_4 Depth 2
4155 ; GFX12-NEXT: s_wait_loadcnt 0x0
4156 ; GFX12-NEXT: v_lshrrev_b32_e32 v6, v4, v7
4157 ; GFX12-NEXT: s_mov_b32 s2, exec_lo
4158 ; GFX12-NEXT: s_wait_storecnt 0x0
4159 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4160 ; GFX12-NEXT: v_add_f16_e32 v6, v6, v5
4161 ; GFX12-NEXT: v_and_b32_e32 v6, 0xffff, v6
4162 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4163 ; GFX12-NEXT: v_lshlrev_b32_e32 v6, v4, v6
4164 ; GFX12-NEXT: v_and_or_b32 v6, v7, v11, v6
4165 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
4166 ; GFX12-NEXT: v_dual_mov_b32 v9, v7 :: v_dual_mov_b32 v8, v6
4167 ; GFX12-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4168 ; GFX12-NEXT: ; => This Inner Loop Header: Depth=2
4169 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
4170 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
4171 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
4172 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
4173 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
4174 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
4175 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
4176 ; GFX12-NEXT: s_wait_alu 0xfffe
4177 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
4178 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
4179 ; GFX12-NEXT: s_wait_alu 0xfffe
4180 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
4181 ; GFX12-NEXT: s_wait_loadcnt 0x0
4182 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[8:9], v10, s[4:7], null offen th:TH_ATOMIC_RETURN
4183 ; GFX12-NEXT: s_wait_alu 0xfffe
4184 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
4185 ; GFX12-NEXT: s_cbranch_execnz .LBB15_4
4186 ; GFX12-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4187 ; GFX12-NEXT: s_mov_b32 exec_lo, s2
4188 ; GFX12-NEXT: s_wait_loadcnt 0x0
4189 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v8, v7
4190 ; GFX12-NEXT: v_mov_b32_e32 v7, v8
4191 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
4192 ; GFX12-NEXT: s_or_b32 s1, vcc_lo, s1
4193 ; GFX12-NEXT: s_wait_alu 0xfffe
4194 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
4195 ; GFX12-NEXT: s_cbranch_execnz .LBB15_3
4196 ; GFX12-NEXT: ; %bb.6: ; %atomicrmw.end
4197 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s1
4198 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, v4, v8
4199 ; GFX12-NEXT: s_wait_alu 0xfffe
4200 ; GFX12-NEXT: s_setpc_b64 s[30:31]
4202 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4204 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4205 ; GFX940-NEXT: v_add_u32_e32 v4, 0x200, v4
4206 ; GFX940-NEXT: v_and_b32_e32 v10, -4, v4
4207 ; GFX940-NEXT: v_and_b32_e32 v4, 3, v4
4208 ; GFX940-NEXT: v_lshlrev_b32_e32 v4, 3, v4
4209 ; GFX940-NEXT: s_mov_b32 s0, 0xffff
4210 ; GFX940-NEXT: v_lshlrev_b32_e64 v6, v4, s0
4211 ; GFX940-NEXT: v_not_b32_e32 v11, v6
4212 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
4213 ; GFX940-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4214 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
4215 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
4216 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
4217 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
4218 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
4219 ; GFX940-NEXT: s_nop 0
4220 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
4221 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
4222 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
4223 ; GFX940-NEXT: buffer_load_dword v7, v10, s[4:7], 0 offen
4224 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
4225 ; GFX940-NEXT: s_cbranch_execnz .LBB15_1
4226 ; GFX940-NEXT: ; %bb.2:
4227 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
4228 ; GFX940-NEXT: s_mov_b64 s[2:3], 0
4229 ; GFX940-NEXT: .LBB15_3: ; %atomicrmw.start
4230 ; GFX940-NEXT: ; =>This Loop Header: Depth=1
4231 ; GFX940-NEXT: ; Child Loop BB15_4 Depth 2
4232 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4233 ; GFX940-NEXT: v_lshrrev_b32_e32 v6, v4, v7
4234 ; GFX940-NEXT: v_add_f16_e32 v6, v6, v5
4235 ; GFX940-NEXT: v_lshlrev_b32_e32 v6, v4, v6
4236 ; GFX940-NEXT: v_and_or_b32 v6, v7, v11, v6
4237 ; GFX940-NEXT: s_mov_b64 s[8:9], exec
4238 ; GFX940-NEXT: v_mov_b64_e32 v[8:9], v[6:7]
4239 ; GFX940-NEXT: buffer_wbl2 sc1
4240 ; GFX940-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4241 ; GFX940-NEXT: ; => This Inner Loop Header: Depth=2
4242 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
4243 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
4244 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
4245 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
4246 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
4247 ; GFX940-NEXT: s_nop 0
4248 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
4249 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
4250 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
4251 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4252 ; GFX940-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[4:7], 0 offen sc0
4253 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
4254 ; GFX940-NEXT: s_cbranch_execnz .LBB15_4
4255 ; GFX940-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4256 ; GFX940-NEXT: s_mov_b64 exec, s[8:9]
4257 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4258 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v8, v7
4259 ; GFX940-NEXT: s_or_b64 s[2:3], vcc, s[2:3]
4260 ; GFX940-NEXT: v_mov_b32_e32 v7, v8
4261 ; GFX940-NEXT: buffer_inv sc1
4262 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[2:3]
4263 ; GFX940-NEXT: s_cbranch_execnz .LBB15_3
4264 ; GFX940-NEXT: ; %bb.6: ; %atomicrmw.end
4265 ; GFX940-NEXT: s_or_b64 exec, exec, s[2:3]
4266 ; GFX940-NEXT: v_lshrrev_b32_e32 v0, v4, v8
4267 ; GFX940-NEXT: s_setpc_b64 s[30:31]
4269 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4271 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4272 ; GFX11-NEXT: v_add_nc_u32_e32 v6, 0x200, v4
4273 ; GFX11-NEXT: s_mov_b32 s1, 0
4274 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
4275 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
4276 ; GFX11-NEXT: v_and_b32_e32 v4, 3, v6
4277 ; GFX11-NEXT: v_and_b32_e32 v10, -4, v6
4278 ; GFX11-NEXT: v_lshlrev_b32_e32 v4, 3, v4
4279 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4280 ; GFX11-NEXT: v_lshlrev_b32_e64 v7, v4, 0xffff
4281 ; GFX11-NEXT: v_not_b32_e32 v11, v7
4282 ; GFX11-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4283 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
4284 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
4285 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
4286 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
4287 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
4288 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
4289 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
4290 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
4291 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
4292 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
4293 ; GFX11-NEXT: buffer_load_b32 v7, v10, s[4:7], 0 offen
4294 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
4295 ; GFX11-NEXT: s_cbranch_execnz .LBB15_1
4296 ; GFX11-NEXT: ; %bb.2:
4297 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
4298 ; GFX11-NEXT: .p2align 6
4299 ; GFX11-NEXT: .LBB15_3: ; %atomicrmw.start
4300 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
4301 ; GFX11-NEXT: ; Child Loop BB15_4 Depth 2
4302 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4303 ; GFX11-NEXT: v_lshrrev_b32_e32 v6, v4, v7
4304 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
4305 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
4306 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4307 ; GFX11-NEXT: v_add_f16_e32 v6, v6, v5
4308 ; GFX11-NEXT: v_and_b32_e32 v6, 0xffff, v6
4309 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4310 ; GFX11-NEXT: v_lshlrev_b32_e32 v6, v4, v6
4311 ; GFX11-NEXT: v_and_or_b32 v6, v7, v11, v6
4312 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
4313 ; GFX11-NEXT: v_dual_mov_b32 v9, v7 :: v_dual_mov_b32 v8, v6
4314 ; GFX11-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4315 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
4316 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
4317 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
4318 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
4319 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
4320 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
4321 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
4322 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
4323 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
4324 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
4325 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
4326 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4327 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[8:9], v10, s[4:7], 0 offen glc
4328 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
4329 ; GFX11-NEXT: s_cbranch_execnz .LBB15_4
4330 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4331 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
4332 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4333 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v8, v7
4334 ; GFX11-NEXT: v_mov_b32_e32 v7, v8
4335 ; GFX11-NEXT: buffer_gl1_inv
4336 ; GFX11-NEXT: buffer_gl0_inv
4337 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
4338 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4339 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
4340 ; GFX11-NEXT: s_cbranch_execnz .LBB15_3
4341 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
4342 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
4343 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, v4, v8
4344 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4346 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4348 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4349 ; GFX10-NEXT: v_add_nc_u32_e32 v6, 0x200, v4
4350 ; GFX10-NEXT: s_mov_b32 s5, 0
4351 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
4352 ; GFX10-NEXT: v_and_b32_e32 v4, 3, v6
4353 ; GFX10-NEXT: v_and_b32_e32 v10, -4, v6
4354 ; GFX10-NEXT: v_lshlrev_b32_e32 v4, 3, v4
4355 ; GFX10-NEXT: v_lshlrev_b32_e64 v7, v4, 0xffff
4356 ; GFX10-NEXT: v_not_b32_e32 v11, v7
4357 ; GFX10-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4358 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
4359 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
4360 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
4361 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
4362 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
4363 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
4364 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
4365 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
4366 ; GFX10-NEXT: buffer_load_dword v7, v10, s[8:11], 0 offen
4367 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
4368 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
4369 ; GFX10-NEXT: s_cbranch_execnz .LBB15_1
4370 ; GFX10-NEXT: ; %bb.2:
4371 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
4372 ; GFX10-NEXT: .LBB15_3: ; %atomicrmw.start
4373 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
4374 ; GFX10-NEXT: ; Child Loop BB15_4 Depth 2
4375 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4376 ; GFX10-NEXT: v_lshrrev_b32_e32 v6, v4, v7
4377 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
4378 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
4379 ; GFX10-NEXT: v_add_f16_e32 v6, v6, v5
4380 ; GFX10-NEXT: v_lshlrev_b32_sdwa v6, v4, v6 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
4381 ; GFX10-NEXT: v_and_or_b32 v6, v7, v11, v6
4382 ; GFX10-NEXT: v_mov_b32_e32 v9, v7
4383 ; GFX10-NEXT: v_mov_b32_e32 v8, v6
4384 ; GFX10-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4385 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
4386 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
4387 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
4388 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
4389 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
4390 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
4391 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
4392 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
4393 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
4394 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4395 ; GFX10-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[8:11], 0 offen glc
4396 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
4397 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
4398 ; GFX10-NEXT: s_cbranch_execnz .LBB15_4
4399 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4400 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
4401 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4402 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v8, v7
4403 ; GFX10-NEXT: v_mov_b32_e32 v7, v8
4404 ; GFX10-NEXT: buffer_gl1_inv
4405 ; GFX10-NEXT: buffer_gl0_inv
4406 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
4407 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
4408 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
4409 ; GFX10-NEXT: s_cbranch_execnz .LBB15_3
4410 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
4411 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
4412 ; GFX10-NEXT: v_lshrrev_b32_e32 v0, v4, v8
4413 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4415 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4417 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4418 ; GFX90A-NEXT: v_add_u32_e32 v4, 0x200, v4
4419 ; GFX90A-NEXT: v_and_b32_e32 v10, -4, v4
4420 ; GFX90A-NEXT: v_and_b32_e32 v4, 3, v4
4421 ; GFX90A-NEXT: v_lshlrev_b32_e32 v4, 3, v4
4422 ; GFX90A-NEXT: s_mov_b32 s4, 0xffff
4423 ; GFX90A-NEXT: v_lshlrev_b32_e64 v6, v4, s4
4424 ; GFX90A-NEXT: v_not_b32_e32 v11, v6
4425 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
4426 ; GFX90A-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4427 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
4428 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
4429 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
4430 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
4431 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4432 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4433 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4434 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4435 ; GFX90A-NEXT: s_nop 0
4436 ; GFX90A-NEXT: buffer_load_dword v7, v10, s[8:11], 0 offen
4437 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
4438 ; GFX90A-NEXT: s_cbranch_execnz .LBB15_1
4439 ; GFX90A-NEXT: ; %bb.2:
4440 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
4441 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
4442 ; GFX90A-NEXT: .LBB15_3: ; %atomicrmw.start
4443 ; GFX90A-NEXT: ; =>This Loop Header: Depth=1
4444 ; GFX90A-NEXT: ; Child Loop BB15_4 Depth 2
4445 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4446 ; GFX90A-NEXT: v_lshrrev_b32_e32 v6, v4, v7
4447 ; GFX90A-NEXT: v_add_f16_e32 v6, v6, v5
4448 ; GFX90A-NEXT: v_lshlrev_b32_e32 v6, v4, v6
4449 ; GFX90A-NEXT: v_and_or_b32 v6, v7, v11, v6
4450 ; GFX90A-NEXT: s_mov_b64 s[12:13], exec
4451 ; GFX90A-NEXT: v_pk_mov_b32 v[8:9], v[6:7], v[6:7] op_sel:[0,1]
4452 ; GFX90A-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4453 ; GFX90A-NEXT: ; => This Inner Loop Header: Depth=2
4454 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
4455 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
4456 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
4457 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
4458 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4459 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4460 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4461 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4462 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4463 ; GFX90A-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[8:11], 0 offen glc
4464 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
4465 ; GFX90A-NEXT: s_cbranch_execnz .LBB15_4
4466 ; GFX90A-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4467 ; GFX90A-NEXT: s_mov_b64 exec, s[12:13]
4468 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4469 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v8, v7
4470 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4471 ; GFX90A-NEXT: v_mov_b32_e32 v7, v8
4472 ; GFX90A-NEXT: buffer_wbinvl1
4473 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
4474 ; GFX90A-NEXT: s_cbranch_execnz .LBB15_3
4475 ; GFX90A-NEXT: ; %bb.6: ; %atomicrmw.end
4476 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
4477 ; GFX90A-NEXT: v_lshrrev_b32_e32 v0, v4, v8
4478 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
4480 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4482 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4483 ; GFX908-NEXT: v_add_u32_e32 v4, 0x200, v4
4484 ; GFX908-NEXT: v_and_b32_e32 v10, -4, v4
4485 ; GFX908-NEXT: v_and_b32_e32 v4, 3, v4
4486 ; GFX908-NEXT: v_lshlrev_b32_e32 v4, 3, v4
4487 ; GFX908-NEXT: s_mov_b32 s4, 0xffff
4488 ; GFX908-NEXT: v_lshlrev_b32_e64 v6, v4, s4
4489 ; GFX908-NEXT: v_not_b32_e32 v11, v6
4490 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
4491 ; GFX908-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4492 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
4493 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
4494 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
4495 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
4496 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4497 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4498 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4499 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4500 ; GFX908-NEXT: s_nop 0
4501 ; GFX908-NEXT: buffer_load_dword v7, v10, s[8:11], 0 offen
4502 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
4503 ; GFX908-NEXT: s_cbranch_execnz .LBB15_1
4504 ; GFX908-NEXT: ; %bb.2:
4505 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
4506 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
4507 ; GFX908-NEXT: .LBB15_3: ; %atomicrmw.start
4508 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
4509 ; GFX908-NEXT: ; Child Loop BB15_4 Depth 2
4510 ; GFX908-NEXT: s_waitcnt vmcnt(0)
4511 ; GFX908-NEXT: v_lshrrev_b32_e32 v6, v4, v7
4512 ; GFX908-NEXT: v_add_f16_e32 v6, v6, v5
4513 ; GFX908-NEXT: v_lshlrev_b32_e32 v6, v4, v6
4514 ; GFX908-NEXT: v_and_or_b32 v6, v7, v11, v6
4515 ; GFX908-NEXT: v_mov_b32_e32 v9, v7
4516 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
4517 ; GFX908-NEXT: v_mov_b32_e32 v8, v6
4518 ; GFX908-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4519 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
4520 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
4521 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
4522 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
4523 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
4524 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4525 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4526 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4527 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4528 ; GFX908-NEXT: s_waitcnt vmcnt(0)
4529 ; GFX908-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[8:11], 0 offen glc
4530 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
4531 ; GFX908-NEXT: s_cbranch_execnz .LBB15_4
4532 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4533 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
4534 ; GFX908-NEXT: s_waitcnt vmcnt(0)
4535 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v8, v7
4536 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4537 ; GFX908-NEXT: v_mov_b32_e32 v7, v8
4538 ; GFX908-NEXT: buffer_wbinvl1
4539 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
4540 ; GFX908-NEXT: s_cbranch_execnz .LBB15_3
4541 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
4542 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
4543 ; GFX908-NEXT: v_lshrrev_b32_e32 v0, v4, v8
4544 ; GFX908-NEXT: s_setpc_b64 s[30:31]
4546 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4548 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4549 ; GFX8-NEXT: v_add_u32_e32 v4, vcc, 0x200, v4
4550 ; GFX8-NEXT: v_and_b32_e32 v10, -4, v4
4551 ; GFX8-NEXT: v_and_b32_e32 v4, 3, v4
4552 ; GFX8-NEXT: v_lshlrev_b32_e32 v4, 3, v4
4553 ; GFX8-NEXT: s_mov_b32 s4, 0xffff
4554 ; GFX8-NEXT: v_lshlrev_b32_e64 v6, v4, s4
4555 ; GFX8-NEXT: v_not_b32_e32 v11, v6
4556 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
4557 ; GFX8-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4558 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
4559 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
4560 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
4561 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
4562 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4563 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4564 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4565 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4566 ; GFX8-NEXT: s_nop 0
4567 ; GFX8-NEXT: buffer_load_dword v7, v10, s[8:11], 0 offen
4568 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
4569 ; GFX8-NEXT: s_cbranch_execnz .LBB15_1
4570 ; GFX8-NEXT: ; %bb.2:
4571 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
4572 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
4573 ; GFX8-NEXT: .LBB15_3: ; %atomicrmw.start
4574 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
4575 ; GFX8-NEXT: ; Child Loop BB15_4 Depth 2
4576 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4577 ; GFX8-NEXT: v_lshrrev_b32_e32 v6, v4, v7
4578 ; GFX8-NEXT: v_add_f16_e32 v6, v6, v5
4579 ; GFX8-NEXT: v_lshlrev_b32_e32 v6, v4, v6
4580 ; GFX8-NEXT: v_and_b32_e32 v8, v7, v11
4581 ; GFX8-NEXT: v_or_b32_e32 v6, v8, v6
4582 ; GFX8-NEXT: v_mov_b32_e32 v9, v7
4583 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
4584 ; GFX8-NEXT: v_mov_b32_e32 v8, v6
4585 ; GFX8-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4586 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
4587 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
4588 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
4589 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
4590 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
4591 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4592 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4593 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4594 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4595 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4596 ; GFX8-NEXT: buffer_atomic_cmpswap v[8:9], v10, s[8:11], 0 offen glc
4597 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
4598 ; GFX8-NEXT: s_cbranch_execnz .LBB15_4
4599 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4600 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
4601 ; GFX8-NEXT: s_waitcnt vmcnt(0)
4602 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v8, v7
4603 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4604 ; GFX8-NEXT: v_mov_b32_e32 v7, v8
4605 ; GFX8-NEXT: buffer_wbinvl1
4606 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
4607 ; GFX8-NEXT: s_cbranch_execnz .LBB15_3
4608 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
4609 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
4610 ; GFX8-NEXT: v_lshrrev_b32_e32 v0, v4, v8
4611 ; GFX8-NEXT: s_setpc_b64 s[30:31]
4613 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4615 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4616 ; GFX7-NEXT: v_add_i32_e32 v4, vcc, 0x200, v4
4617 ; GFX7-NEXT: v_and_b32_e32 v8, -4, v4
4618 ; GFX7-NEXT: v_and_b32_e32 v4, 3, v4
4619 ; GFX7-NEXT: v_lshlrev_b32_e32 v7, 3, v4
4620 ; GFX7-NEXT: v_lshl_b32_e32 v4, 0xffff, v7
4621 ; GFX7-NEXT: v_not_b32_e32 v9, v4
4622 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
4623 ; GFX7-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4624 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
4625 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
4626 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
4627 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
4628 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4629 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4630 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4631 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4632 ; GFX7-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
4633 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
4634 ; GFX7-NEXT: s_cbranch_execnz .LBB15_1
4635 ; GFX7-NEXT: ; %bb.2:
4636 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
4637 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v5
4638 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
4639 ; GFX7-NEXT: v_cvt_f32_f16_e32 v10, v4
4640 ; GFX7-NEXT: .LBB15_3: ; %atomicrmw.start
4641 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
4642 ; GFX7-NEXT: ; Child Loop BB15_4 Depth 2
4643 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4644 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, v7, v6
4645 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v4
4646 ; GFX7-NEXT: v_and_b32_e32 v5, v6, v9
4647 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
4648 ; GFX7-NEXT: v_add_f32_e32 v4, v4, v10
4649 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v4
4650 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, v7, v4
4651 ; GFX7-NEXT: v_or_b32_e32 v5, v5, v4
4652 ; GFX7-NEXT: v_mov_b32_e32 v4, v5
4653 ; GFX7-NEXT: v_mov_b32_e32 v5, v6
4654 ; GFX7-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4655 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
4656 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
4657 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
4658 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
4659 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
4660 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4661 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4662 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4663 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4664 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4665 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
4666 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
4667 ; GFX7-NEXT: s_cbranch_execnz .LBB15_4
4668 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4669 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
4670 ; GFX7-NEXT: s_waitcnt vmcnt(0)
4671 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
4672 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4673 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
4674 ; GFX7-NEXT: buffer_wbinvl1
4675 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
4676 ; GFX7-NEXT: s_cbranch_execnz .LBB15_3
4677 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
4678 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
4679 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4680 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0
4681 ; GFX7-NEXT: s_setpc_b64 s[30:31]
4683 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_f16__offset__waterfall__amdgpu_no_fine_grained_memory:
4685 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4686 ; GFX6-NEXT: v_add_i32_e32 v4, vcc, 0x200, v4
4687 ; GFX6-NEXT: v_and_b32_e32 v8, -4, v4
4688 ; GFX6-NEXT: v_and_b32_e32 v4, 3, v4
4689 ; GFX6-NEXT: v_lshlrev_b32_e32 v7, 3, v4
4690 ; GFX6-NEXT: v_lshl_b32_e32 v4, 0xffff, v7
4691 ; GFX6-NEXT: v_not_b32_e32 v9, v4
4692 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
4693 ; GFX6-NEXT: .LBB15_1: ; =>This Inner Loop Header: Depth=1
4694 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
4695 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
4696 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
4697 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
4698 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4699 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4700 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4701 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4702 ; GFX6-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
4703 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
4704 ; GFX6-NEXT: s_cbranch_execnz .LBB15_1
4705 ; GFX6-NEXT: ; %bb.2:
4706 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
4707 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v5
4708 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
4709 ; GFX6-NEXT: v_cvt_f32_f16_e32 v10, v4
4710 ; GFX6-NEXT: .LBB15_3: ; %atomicrmw.start
4711 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
4712 ; GFX6-NEXT: ; Child Loop BB15_4 Depth 2
4713 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
4714 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, v7, v6
4715 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v4
4716 ; GFX6-NEXT: v_and_b32_e32 v5, v6, v9
4717 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
4718 ; GFX6-NEXT: v_add_f32_e32 v4, v4, v10
4719 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v4
4720 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, v7, v4
4721 ; GFX6-NEXT: v_or_b32_e32 v5, v5, v4
4722 ; GFX6-NEXT: v_mov_b32_e32 v4, v5
4723 ; GFX6-NEXT: v_mov_b32_e32 v5, v6
4724 ; GFX6-NEXT: .LBB15_4: ; Parent Loop BB15_3 Depth=1
4725 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
4726 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
4727 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
4728 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
4729 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
4730 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
4731 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
4732 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
4733 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
4734 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
4735 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
4736 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
4737 ; GFX6-NEXT: s_cbranch_execnz .LBB15_4
4738 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB15_3 Depth=1
4739 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
4740 ; GFX6-NEXT: s_waitcnt vmcnt(0)
4741 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
4742 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
4743 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
4744 ; GFX6-NEXT: buffer_wbinvl1
4745 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
4746 ; GFX6-NEXT: s_cbranch_execnz .LBB15_3
4747 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
4748 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
4749 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, v7, v4
4750 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v0
4751 ; GFX6-NEXT: s_waitcnt expcnt(0)
4752 ; GFX6-NEXT: s_setpc_b64 s[30:31]
4753 %gep = getelementptr half, ptr addrspace(7) %ptr, i32 256
4754 %result = atomicrmw fadd ptr addrspace(7) %gep, half %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
4758 ; --------------------------------------------------------------------
4760 ; --------------------------------------------------------------------
4762 define bfloat @buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, bfloat %val) #0 {
4763 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
4765 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
4766 ; GFX12-NEXT: s_wait_expcnt 0x0
4767 ; GFX12-NEXT: s_wait_samplecnt 0x0
4768 ; GFX12-NEXT: s_wait_bvhcnt 0x0
4769 ; GFX12-NEXT: s_wait_kmcnt 0x0
4770 ; GFX12-NEXT: s_addk_co_i32 s16, 0x200
4771 ; GFX12-NEXT: v_lshlrev_b32_e32 v5, 16, v0
4772 ; GFX12-NEXT: s_wait_alu 0xfffe
4773 ; GFX12-NEXT: s_and_b32 s4, s16, -4
4774 ; GFX12-NEXT: s_wait_alu 0xfffe
4775 ; GFX12-NEXT: v_mov_b32_e32 v4, s4
4776 ; GFX12-NEXT: s_and_b32 s4, s16, 3
4777 ; GFX12-NEXT: s_wait_alu 0xfffe
4778 ; GFX12-NEXT: s_lshl_b32 s4, s4, 3
4779 ; GFX12-NEXT: s_wait_alu 0xfffe
4780 ; GFX12-NEXT: s_lshl_b32 s5, 0xffff, s4
4781 ; GFX12-NEXT: buffer_load_b32 v1, v4, s[0:3], null offen
4782 ; GFX12-NEXT: s_wait_alu 0xfffe
4783 ; GFX12-NEXT: s_not_b32 s6, s5
4784 ; GFX12-NEXT: s_mov_b32 s5, 0
4785 ; GFX12-NEXT: .LBB16_1: ; %atomicrmw.start
4786 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
4787 ; GFX12-NEXT: s_wait_loadcnt 0x0
4788 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, s4, v1
4789 ; GFX12-NEXT: s_wait_storecnt 0x0
4790 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4791 ; GFX12-NEXT: v_lshlrev_b32_e32 v0, 16, v0
4792 ; GFX12-NEXT: v_add_f32_e32 v0, v0, v5
4793 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
4794 ; GFX12-NEXT: v_bfe_u32 v2, v0, 16, 1
4795 ; GFX12-NEXT: v_or_b32_e32 v3, 0x400000, v0
4796 ; GFX12-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
4797 ; GFX12-NEXT: v_add3_u32 v2, v2, v0, 0x7fff
4798 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4799 ; GFX12-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc_lo
4800 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, 16, v0
4801 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
4802 ; GFX12-NEXT: v_lshlrev_b32_e32 v0, s4, v0
4803 ; GFX12-NEXT: s_wait_alu 0xfffe
4804 ; GFX12-NEXT: v_and_or_b32 v0, v1, s6, v0
4805 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
4806 ; GFX12-NEXT: v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
4807 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[2:3], v4, s[0:3], null offen th:TH_ATOMIC_RETURN
4808 ; GFX12-NEXT: s_wait_loadcnt 0x0
4809 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
4810 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v1
4811 ; GFX12-NEXT: v_mov_b32_e32 v1, v2
4812 ; GFX12-NEXT: s_or_b32 s5, vcc_lo, s5
4813 ; GFX12-NEXT: s_wait_alu 0xfffe
4814 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
4815 ; GFX12-NEXT: s_cbranch_execnz .LBB16_1
4816 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
4817 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s5
4818 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, s4, v2
4819 ; GFX12-NEXT: s_wait_alu 0xfffe
4820 ; GFX12-NEXT: s_setpc_b64 s[30:31]
4822 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
4824 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4825 ; GFX940-NEXT: s_addk_i32 s16, 0x200
4826 ; GFX940-NEXT: s_and_b32 s4, s16, -4
4827 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
4828 ; GFX940-NEXT: buffer_load_dword v1, v4, s[0:3], 0 offen
4829 ; GFX940-NEXT: s_and_b32 s4, s16, 3
4830 ; GFX940-NEXT: s_lshl_b32 s6, s4, 3
4831 ; GFX940-NEXT: s_lshl_b32 s4, 0xffff, s6
4832 ; GFX940-NEXT: s_not_b32 s7, s4
4833 ; GFX940-NEXT: s_mov_b64 s[4:5], 0
4834 ; GFX940-NEXT: v_lshlrev_b32_e32 v5, 16, v0
4835 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
4836 ; GFX940-NEXT: .LBB16_1: ; %atomicrmw.start
4837 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
4838 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4839 ; GFX940-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4840 ; GFX940-NEXT: buffer_wbl2 sc1
4841 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v5
4842 ; GFX940-NEXT: v_bfe_u32 v2, v0, 16, 1
4843 ; GFX940-NEXT: v_or_b32_e32 v3, 0x400000, v0
4844 ; GFX940-NEXT: v_add3_u32 v2, v2, v0, s8
4845 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
4846 ; GFX940-NEXT: s_nop 1
4847 ; GFX940-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc
4848 ; GFX940-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4849 ; GFX940-NEXT: v_and_or_b32 v0, v1, s7, v0
4850 ; GFX940-NEXT: v_mov_b64_e32 v[2:3], v[0:1]
4851 ; GFX940-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[0:3], 0 offen sc0
4852 ; GFX940-NEXT: s_waitcnt vmcnt(0)
4853 ; GFX940-NEXT: buffer_inv sc1
4854 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
4855 ; GFX940-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4856 ; GFX940-NEXT: v_mov_b32_e32 v1, v2
4857 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[4:5]
4858 ; GFX940-NEXT: s_cbranch_execnz .LBB16_1
4859 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
4860 ; GFX940-NEXT: s_or_b64 exec, exec, s[4:5]
4861 ; GFX940-NEXT: v_lshrrev_b32_e32 v0, s6, v2
4862 ; GFX940-NEXT: s_setpc_b64 s[30:31]
4864 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
4866 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4867 ; GFX11-NEXT: s_addk_i32 s16, 0x200
4868 ; GFX11-NEXT: v_lshlrev_b32_e32 v5, 16, v0
4869 ; GFX11-NEXT: s_and_b32 s4, s16, -4
4870 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
4871 ; GFX11-NEXT: v_mov_b32_e32 v4, s4
4872 ; GFX11-NEXT: s_and_b32 s4, s16, 3
4873 ; GFX11-NEXT: s_lshl_b32 s4, s4, 3
4874 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4875 ; GFX11-NEXT: s_lshl_b32 s5, 0xffff, s4
4876 ; GFX11-NEXT: buffer_load_b32 v1, v4, s[0:3], 0 offen
4877 ; GFX11-NEXT: s_not_b32 s6, s5
4878 ; GFX11-NEXT: s_mov_b32 s5, 0
4879 ; GFX11-NEXT: .p2align 6
4880 ; GFX11-NEXT: .LBB16_1: ; %atomicrmw.start
4881 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
4882 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4883 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, s4, v1
4884 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
4885 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4886 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v0
4887 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v5
4888 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
4889 ; GFX11-NEXT: v_bfe_u32 v2, v0, 16, 1
4890 ; GFX11-NEXT: v_or_b32_e32 v3, 0x400000, v0
4891 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
4892 ; GFX11-NEXT: v_add3_u32 v2, v2, v0, 0x7fff
4893 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4894 ; GFX11-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc_lo
4895 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, 16, v0
4896 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
4897 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, s4, v0
4898 ; GFX11-NEXT: v_and_or_b32 v0, v1, s6, v0
4899 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
4900 ; GFX11-NEXT: v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
4901 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[2:3], v4, s[0:3], 0 offen glc
4902 ; GFX11-NEXT: s_waitcnt vmcnt(0)
4903 ; GFX11-NEXT: buffer_gl1_inv
4904 ; GFX11-NEXT: buffer_gl0_inv
4905 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v1
4906 ; GFX11-NEXT: v_mov_b32_e32 v1, v2
4907 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
4908 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4909 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
4910 ; GFX11-NEXT: s_cbranch_execnz .LBB16_1
4911 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
4912 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
4913 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, s4, v2
4914 ; GFX11-NEXT: s_setpc_b64 s[30:31]
4916 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
4918 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4919 ; GFX10-NEXT: s_addk_i32 s20, 0x200
4920 ; GFX10-NEXT: v_lshlrev_b32_e32 v5, 16, v0
4921 ; GFX10-NEXT: s_and_b32 s4, s20, -4
4922 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
4923 ; GFX10-NEXT: s_and_b32 s4, s20, 3
4924 ; GFX10-NEXT: s_lshl_b32 s4, s4, 3
4925 ; GFX10-NEXT: s_lshl_b32 s5, 0xffff, s4
4926 ; GFX10-NEXT: buffer_load_dword v1, v4, s[16:19], 0 offen
4927 ; GFX10-NEXT: s_not_b32 s6, s5
4928 ; GFX10-NEXT: s_mov_b32 s5, 0
4929 ; GFX10-NEXT: .LBB16_1: ; %atomicrmw.start
4930 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
4931 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4932 ; GFX10-NEXT: v_lshrrev_b32_sdwa v0, s4, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4933 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
4934 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v5
4935 ; GFX10-NEXT: v_bfe_u32 v2, v0, 16, 1
4936 ; GFX10-NEXT: v_or_b32_e32 v3, 0x400000, v0
4937 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
4938 ; GFX10-NEXT: v_add3_u32 v2, v2, v0, 0x7fff
4939 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc_lo
4940 ; GFX10-NEXT: v_lshlrev_b32_sdwa v0, s4, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4941 ; GFX10-NEXT: v_and_or_b32 v0, v1, s6, v0
4942 ; GFX10-NEXT: v_mov_b32_e32 v3, v1
4943 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
4944 ; GFX10-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[16:19], 0 offen glc
4945 ; GFX10-NEXT: s_waitcnt vmcnt(0)
4946 ; GFX10-NEXT: buffer_gl1_inv
4947 ; GFX10-NEXT: buffer_gl0_inv
4948 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v2, v1
4949 ; GFX10-NEXT: v_mov_b32_e32 v1, v2
4950 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
4951 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
4952 ; GFX10-NEXT: s_cbranch_execnz .LBB16_1
4953 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
4954 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
4955 ; GFX10-NEXT: v_lshrrev_b32_e32 v0, s4, v2
4956 ; GFX10-NEXT: s_setpc_b64 s[30:31]
4958 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
4960 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
4961 ; GFX90A-NEXT: s_addk_i32 s20, 0x200
4962 ; GFX90A-NEXT: s_and_b32 s4, s20, -4
4963 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
4964 ; GFX90A-NEXT: buffer_load_dword v1, v4, s[16:19], 0 offen
4965 ; GFX90A-NEXT: s_and_b32 s4, s20, 3
4966 ; GFX90A-NEXT: s_lshl_b32 s6, s4, 3
4967 ; GFX90A-NEXT: s_lshl_b32 s4, 0xffff, s6
4968 ; GFX90A-NEXT: s_not_b32 s7, s4
4969 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
4970 ; GFX90A-NEXT: v_lshlrev_b32_e32 v5, 16, v0
4971 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
4972 ; GFX90A-NEXT: .LBB16_1: ; %atomicrmw.start
4973 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
4974 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4975 ; GFX90A-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
4976 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v5
4977 ; GFX90A-NEXT: v_bfe_u32 v2, v0, 16, 1
4978 ; GFX90A-NEXT: v_or_b32_e32 v3, 0x400000, v0
4979 ; GFX90A-NEXT: v_add3_u32 v2, v2, v0, s8
4980 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
4981 ; GFX90A-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc
4982 ; GFX90A-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
4983 ; GFX90A-NEXT: v_and_or_b32 v0, v1, s7, v0
4984 ; GFX90A-NEXT: v_pk_mov_b32 v[2:3], v[0:1], v[0:1] op_sel:[0,1]
4985 ; GFX90A-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[16:19], 0 offen glc
4986 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
4987 ; GFX90A-NEXT: buffer_wbinvl1
4988 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
4989 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
4990 ; GFX90A-NEXT: v_mov_b32_e32 v1, v2
4991 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
4992 ; GFX90A-NEXT: s_cbranch_execnz .LBB16_1
4993 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
4994 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
4995 ; GFX90A-NEXT: v_lshrrev_b32_e32 v0, s6, v2
4996 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
4998 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
5000 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5001 ; GFX908-NEXT: s_addk_i32 s20, 0x200
5002 ; GFX908-NEXT: s_and_b32 s4, s20, -4
5003 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
5004 ; GFX908-NEXT: buffer_load_dword v1, v4, s[16:19], 0 offen
5005 ; GFX908-NEXT: s_and_b32 s4, s20, 3
5006 ; GFX908-NEXT: s_lshl_b32 s6, s4, 3
5007 ; GFX908-NEXT: s_lshl_b32 s4, 0xffff, s6
5008 ; GFX908-NEXT: s_not_b32 s7, s4
5009 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
5010 ; GFX908-NEXT: v_lshlrev_b32_e32 v5, 16, v0
5011 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
5012 ; GFX908-NEXT: .LBB16_1: ; %atomicrmw.start
5013 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
5014 ; GFX908-NEXT: s_waitcnt vmcnt(0)
5015 ; GFX908-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5016 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v5
5017 ; GFX908-NEXT: v_bfe_u32 v2, v0, 16, 1
5018 ; GFX908-NEXT: v_or_b32_e32 v3, 0x400000, v0
5019 ; GFX908-NEXT: v_add3_u32 v2, v2, v0, s8
5020 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
5021 ; GFX908-NEXT: v_cndmask_b32_e32 v0, v2, v3, vcc
5022 ; GFX908-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5023 ; GFX908-NEXT: v_and_or_b32 v0, v1, s7, v0
5024 ; GFX908-NEXT: v_mov_b32_e32 v3, v1
5025 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
5026 ; GFX908-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[16:19], 0 offen glc
5027 ; GFX908-NEXT: s_waitcnt vmcnt(0)
5028 ; GFX908-NEXT: buffer_wbinvl1
5029 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
5030 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5031 ; GFX908-NEXT: v_mov_b32_e32 v1, v2
5032 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
5033 ; GFX908-NEXT: s_cbranch_execnz .LBB16_1
5034 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
5035 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
5036 ; GFX908-NEXT: v_lshrrev_b32_e32 v0, s6, v2
5037 ; GFX908-NEXT: s_setpc_b64 s[30:31]
5039 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
5041 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5042 ; GFX8-NEXT: s_addk_i32 s20, 0x200
5043 ; GFX8-NEXT: s_and_b32 s4, s20, -4
5044 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
5045 ; GFX8-NEXT: buffer_load_dword v1, v4, s[16:19], 0 offen
5046 ; GFX8-NEXT: s_and_b32 s4, s20, 3
5047 ; GFX8-NEXT: s_lshl_b32 s6, s4, 3
5048 ; GFX8-NEXT: s_lshl_b32 s4, 0xffff, s6
5049 ; GFX8-NEXT: s_not_b32 s7, s4
5050 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
5051 ; GFX8-NEXT: v_lshlrev_b32_e32 v5, 16, v0
5052 ; GFX8-NEXT: .LBB16_1: ; %atomicrmw.start
5053 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
5054 ; GFX8-NEXT: v_mov_b32_e32 v0, s6
5055 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5056 ; GFX8-NEXT: v_lshrrev_b32_sdwa v3, v0, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5057 ; GFX8-NEXT: v_add_f32_e32 v3, v3, v5
5058 ; GFX8-NEXT: v_bfe_u32 v6, v3, 16, 1
5059 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v3
5060 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
5061 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v3
5062 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v3, v3
5063 ; GFX8-NEXT: v_cndmask_b32_e32 v3, v6, v7, vcc
5064 ; GFX8-NEXT: v_and_b32_e32 v2, s7, v1
5065 ; GFX8-NEXT: v_lshlrev_b32_sdwa v0, v0, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5066 ; GFX8-NEXT: v_or_b32_e32 v0, v2, v0
5067 ; GFX8-NEXT: v_mov_b32_e32 v3, v1
5068 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
5069 ; GFX8-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[16:19], 0 offen glc
5070 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5071 ; GFX8-NEXT: buffer_wbinvl1
5072 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
5073 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5074 ; GFX8-NEXT: v_mov_b32_e32 v1, v2
5075 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
5076 ; GFX8-NEXT: s_cbranch_execnz .LBB16_1
5077 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
5078 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
5079 ; GFX8-NEXT: v_lshrrev_b32_e32 v0, s6, v2
5080 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5082 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
5084 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5085 ; GFX7-NEXT: s_addk_i32 s20, 0x200
5086 ; GFX7-NEXT: s_and_b32 s4, s20, -4
5087 ; GFX7-NEXT: v_mov_b32_e32 v4, s4
5088 ; GFX7-NEXT: buffer_load_dword v1, v4, s[16:19], 0 offen
5089 ; GFX7-NEXT: s_and_b32 s4, s20, 3
5090 ; GFX7-NEXT: s_lshl_b32 s6, s4, 3
5091 ; GFX7-NEXT: s_lshl_b32 s4, 0xffff, s6
5092 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
5093 ; GFX7-NEXT: s_not_b32 s7, s4
5094 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
5095 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
5096 ; GFX7-NEXT: .LBB16_1: ; %atomicrmw.start
5097 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
5098 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5099 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v1
5100 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v0
5101 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v5
5102 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v0
5103 ; GFX7-NEXT: v_and_b32_e32 v2, s7, v1
5104 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, s6, v0
5105 ; GFX7-NEXT: v_or_b32_e32 v0, v2, v0
5106 ; GFX7-NEXT: v_mov_b32_e32 v3, v1
5107 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
5108 ; GFX7-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[16:19], 0 offen glc
5109 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5110 ; GFX7-NEXT: buffer_wbinvl1
5111 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
5112 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5113 ; GFX7-NEXT: v_mov_b32_e32 v1, v2
5114 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
5115 ; GFX7-NEXT: s_cbranch_execnz .LBB16_1
5116 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
5117 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
5118 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v2
5119 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v0
5120 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5122 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__amdgpu_no_fine_grained_memory:
5124 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5125 ; GFX6-NEXT: s_addk_i32 s20, 0x200
5126 ; GFX6-NEXT: s_and_b32 s4, s20, -4
5127 ; GFX6-NEXT: v_mov_b32_e32 v4, s4
5128 ; GFX6-NEXT: buffer_load_dword v1, v4, s[16:19], 0 offen
5129 ; GFX6-NEXT: s_and_b32 s4, s20, 3
5130 ; GFX6-NEXT: s_lshl_b32 s6, s4, 3
5131 ; GFX6-NEXT: s_lshl_b32 s4, 0xffff, s6
5132 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
5133 ; GFX6-NEXT: s_not_b32 s7, s4
5134 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
5135 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
5136 ; GFX6-NEXT: .LBB16_1: ; %atomicrmw.start
5137 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
5138 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5139 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v1
5140 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v0
5141 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v5
5142 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, 16, v0
5143 ; GFX6-NEXT: s_waitcnt expcnt(0)
5144 ; GFX6-NEXT: v_and_b32_e32 v2, s7, v1
5145 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, s6, v0
5146 ; GFX6-NEXT: v_or_b32_e32 v0, v2, v0
5147 ; GFX6-NEXT: v_mov_b32_e32 v3, v1
5148 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
5149 ; GFX6-NEXT: buffer_atomic_cmpswap v[2:3], v4, s[16:19], 0 offen glc
5150 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5151 ; GFX6-NEXT: buffer_wbinvl1
5152 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v2, v1
5153 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5154 ; GFX6-NEXT: v_mov_b32_e32 v1, v2
5155 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
5156 ; GFX6-NEXT: s_cbranch_execnz .LBB16_1
5157 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
5158 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
5159 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v2
5160 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v0
5161 ; GFX6-NEXT: s_waitcnt expcnt(0)
5162 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5163 %gep = getelementptr bfloat, ptr addrspace(7) %ptr, i32 256
5164 %result = atomicrmw fadd ptr addrspace(7) %gep, bfloat %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
5168 define void @buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, bfloat %val) #0 {
5169 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5171 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
5172 ; GFX12-NEXT: s_wait_expcnt 0x0
5173 ; GFX12-NEXT: s_wait_samplecnt 0x0
5174 ; GFX12-NEXT: s_wait_bvhcnt 0x0
5175 ; GFX12-NEXT: s_wait_kmcnt 0x0
5176 ; GFX12-NEXT: s_addk_co_i32 s16, 0x200
5177 ; GFX12-NEXT: v_lshlrev_b32_e32 v3, 16, v0
5178 ; GFX12-NEXT: s_wait_alu 0xfffe
5179 ; GFX12-NEXT: s_and_b32 s4, s16, -4
5180 ; GFX12-NEXT: s_wait_alu 0xfffe
5181 ; GFX12-NEXT: v_mov_b32_e32 v2, s4
5182 ; GFX12-NEXT: s_and_b32 s4, s16, 3
5183 ; GFX12-NEXT: s_wait_alu 0xfffe
5184 ; GFX12-NEXT: s_lshl_b32 s4, s4, 3
5185 ; GFX12-NEXT: s_wait_alu 0xfffe
5186 ; GFX12-NEXT: s_lshl_b32 s5, 0xffff, s4
5187 ; GFX12-NEXT: buffer_load_b32 v1, v2, s[0:3], null offen
5188 ; GFX12-NEXT: s_wait_alu 0xfffe
5189 ; GFX12-NEXT: s_not_b32 s6, s5
5190 ; GFX12-NEXT: s_mov_b32 s5, 0
5191 ; GFX12-NEXT: .LBB17_1: ; %atomicrmw.start
5192 ; GFX12-NEXT: ; =>This Inner Loop Header: Depth=1
5193 ; GFX12-NEXT: s_wait_loadcnt 0x0
5194 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, s4, v1
5195 ; GFX12-NEXT: s_wait_storecnt 0x0
5196 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5197 ; GFX12-NEXT: v_lshlrev_b32_e32 v0, 16, v0
5198 ; GFX12-NEXT: v_add_f32_e32 v0, v0, v3
5199 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
5200 ; GFX12-NEXT: v_bfe_u32 v4, v0, 16, 1
5201 ; GFX12-NEXT: v_or_b32_e32 v5, 0x400000, v0
5202 ; GFX12-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
5203 ; GFX12-NEXT: v_add3_u32 v4, v4, v0, 0x7fff
5204 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5205 ; GFX12-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc_lo
5206 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, 16, v0
5207 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
5208 ; GFX12-NEXT: v_lshlrev_b32_e32 v0, s4, v0
5209 ; GFX12-NEXT: s_wait_alu 0xfffe
5210 ; GFX12-NEXT: v_and_or_b32 v0, v1, s6, v0
5211 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
5212 ; GFX12-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
5213 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v2, s[0:3], null offen th:TH_ATOMIC_RETURN
5214 ; GFX12-NEXT: s_wait_loadcnt 0x0
5215 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
5216 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v1
5217 ; GFX12-NEXT: v_mov_b32_e32 v1, v4
5218 ; GFX12-NEXT: s_or_b32 s5, vcc_lo, s5
5219 ; GFX12-NEXT: s_wait_alu 0xfffe
5220 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
5221 ; GFX12-NEXT: s_cbranch_execnz .LBB17_1
5222 ; GFX12-NEXT: ; %bb.2: ; %atomicrmw.end
5223 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s5
5224 ; GFX12-NEXT: s_wait_alu 0xfffe
5225 ; GFX12-NEXT: s_setpc_b64 s[30:31]
5227 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5229 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5230 ; GFX940-NEXT: s_addk_i32 s16, 0x200
5231 ; GFX940-NEXT: s_and_b32 s4, s16, -4
5232 ; GFX940-NEXT: v_mov_b32_e32 v2, s4
5233 ; GFX940-NEXT: buffer_load_dword v1, v2, s[0:3], 0 offen
5234 ; GFX940-NEXT: s_and_b32 s4, s16, 3
5235 ; GFX940-NEXT: s_lshl_b32 s6, s4, 3
5236 ; GFX940-NEXT: s_lshl_b32 s4, 0xffff, s6
5237 ; GFX940-NEXT: s_not_b32 s7, s4
5238 ; GFX940-NEXT: s_mov_b64 s[4:5], 0
5239 ; GFX940-NEXT: v_lshlrev_b32_e32 v3, 16, v0
5240 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
5241 ; GFX940-NEXT: .LBB17_1: ; %atomicrmw.start
5242 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
5243 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5244 ; GFX940-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5245 ; GFX940-NEXT: buffer_wbl2 sc1
5246 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v3
5247 ; GFX940-NEXT: v_bfe_u32 v4, v0, 16, 1
5248 ; GFX940-NEXT: v_or_b32_e32 v5, 0x400000, v0
5249 ; GFX940-NEXT: v_add3_u32 v4, v4, v0, s8
5250 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
5251 ; GFX940-NEXT: s_nop 1
5252 ; GFX940-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc
5253 ; GFX940-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5254 ; GFX940-NEXT: v_and_or_b32 v0, v1, s7, v0
5255 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[0:1]
5256 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[0:3], 0 offen sc0
5257 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5258 ; GFX940-NEXT: buffer_inv sc1
5259 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
5260 ; GFX940-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5261 ; GFX940-NEXT: v_mov_b32_e32 v1, v4
5262 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[4:5]
5263 ; GFX940-NEXT: s_cbranch_execnz .LBB17_1
5264 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
5265 ; GFX940-NEXT: s_or_b64 exec, exec, s[4:5]
5266 ; GFX940-NEXT: s_setpc_b64 s[30:31]
5268 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5270 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5271 ; GFX11-NEXT: s_addk_i32 s16, 0x200
5272 ; GFX11-NEXT: v_lshlrev_b32_e32 v3, 16, v0
5273 ; GFX11-NEXT: s_and_b32 s4, s16, -4
5274 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
5275 ; GFX11-NEXT: v_mov_b32_e32 v2, s4
5276 ; GFX11-NEXT: s_and_b32 s4, s16, 3
5277 ; GFX11-NEXT: s_lshl_b32 s4, s4, 3
5278 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
5279 ; GFX11-NEXT: s_lshl_b32 s5, 0xffff, s4
5280 ; GFX11-NEXT: buffer_load_b32 v1, v2, s[0:3], 0 offen
5281 ; GFX11-NEXT: s_not_b32 s6, s5
5282 ; GFX11-NEXT: s_mov_b32 s5, 0
5283 ; GFX11-NEXT: .p2align 6
5284 ; GFX11-NEXT: .LBB17_1: ; %atomicrmw.start
5285 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
5286 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5287 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, s4, v1
5288 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
5289 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5290 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v0
5291 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v3
5292 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
5293 ; GFX11-NEXT: v_bfe_u32 v4, v0, 16, 1
5294 ; GFX11-NEXT: v_or_b32_e32 v5, 0x400000, v0
5295 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
5296 ; GFX11-NEXT: v_add3_u32 v4, v4, v0, 0x7fff
5297 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5298 ; GFX11-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc_lo
5299 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, 16, v0
5300 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5301 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, s4, v0
5302 ; GFX11-NEXT: v_and_or_b32 v0, v1, s6, v0
5303 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
5304 ; GFX11-NEXT: v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
5305 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v2, s[0:3], 0 offen glc
5306 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5307 ; GFX11-NEXT: buffer_gl1_inv
5308 ; GFX11-NEXT: buffer_gl0_inv
5309 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v1
5310 ; GFX11-NEXT: v_mov_b32_e32 v1, v4
5311 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
5312 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
5313 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
5314 ; GFX11-NEXT: s_cbranch_execnz .LBB17_1
5315 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
5316 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
5317 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5319 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5321 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5322 ; GFX10-NEXT: s_addk_i32 s20, 0x200
5323 ; GFX10-NEXT: v_lshlrev_b32_e32 v3, 16, v0
5324 ; GFX10-NEXT: s_and_b32 s4, s20, -4
5325 ; GFX10-NEXT: v_mov_b32_e32 v2, s4
5326 ; GFX10-NEXT: s_and_b32 s4, s20, 3
5327 ; GFX10-NEXT: s_lshl_b32 s4, s4, 3
5328 ; GFX10-NEXT: s_lshl_b32 s5, 0xffff, s4
5329 ; GFX10-NEXT: buffer_load_dword v1, v2, s[16:19], 0 offen
5330 ; GFX10-NEXT: s_not_b32 s6, s5
5331 ; GFX10-NEXT: s_mov_b32 s5, 0
5332 ; GFX10-NEXT: .LBB17_1: ; %atomicrmw.start
5333 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
5334 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5335 ; GFX10-NEXT: v_lshrrev_b32_sdwa v0, s4, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5336 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
5337 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v3
5338 ; GFX10-NEXT: v_bfe_u32 v4, v0, 16, 1
5339 ; GFX10-NEXT: v_or_b32_e32 v5, 0x400000, v0
5340 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v0, v0
5341 ; GFX10-NEXT: v_add3_u32 v4, v4, v0, 0x7fff
5342 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc_lo
5343 ; GFX10-NEXT: v_lshlrev_b32_sdwa v0, s4, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5344 ; GFX10-NEXT: v_and_or_b32 v0, v1, s6, v0
5345 ; GFX10-NEXT: v_mov_b32_e32 v5, v1
5346 ; GFX10-NEXT: v_mov_b32_e32 v4, v0
5347 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[16:19], 0 offen glc
5348 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5349 ; GFX10-NEXT: buffer_gl1_inv
5350 ; GFX10-NEXT: buffer_gl0_inv
5351 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v1
5352 ; GFX10-NEXT: v_mov_b32_e32 v1, v4
5353 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
5354 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
5355 ; GFX10-NEXT: s_cbranch_execnz .LBB17_1
5356 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
5357 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
5358 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5360 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5362 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5363 ; GFX90A-NEXT: s_addk_i32 s20, 0x200
5364 ; GFX90A-NEXT: s_and_b32 s4, s20, -4
5365 ; GFX90A-NEXT: v_mov_b32_e32 v2, s4
5366 ; GFX90A-NEXT: buffer_load_dword v1, v2, s[16:19], 0 offen
5367 ; GFX90A-NEXT: s_and_b32 s4, s20, 3
5368 ; GFX90A-NEXT: s_lshl_b32 s6, s4, 3
5369 ; GFX90A-NEXT: s_lshl_b32 s4, 0xffff, s6
5370 ; GFX90A-NEXT: s_not_b32 s7, s4
5371 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
5372 ; GFX90A-NEXT: v_lshlrev_b32_e32 v3, 16, v0
5373 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
5374 ; GFX90A-NEXT: .LBB17_1: ; %atomicrmw.start
5375 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
5376 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
5377 ; GFX90A-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5378 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v3
5379 ; GFX90A-NEXT: v_bfe_u32 v4, v0, 16, 1
5380 ; GFX90A-NEXT: v_or_b32_e32 v5, 0x400000, v0
5381 ; GFX90A-NEXT: v_add3_u32 v4, v4, v0, s8
5382 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
5383 ; GFX90A-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc
5384 ; GFX90A-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5385 ; GFX90A-NEXT: v_and_or_b32 v0, v1, s7, v0
5386 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[0:1], v[0:1] op_sel:[0,1]
5387 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[16:19], 0 offen glc
5388 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
5389 ; GFX90A-NEXT: buffer_wbinvl1
5390 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
5391 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5392 ; GFX90A-NEXT: v_mov_b32_e32 v1, v4
5393 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
5394 ; GFX90A-NEXT: s_cbranch_execnz .LBB17_1
5395 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
5396 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
5397 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
5399 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5401 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5402 ; GFX908-NEXT: s_addk_i32 s20, 0x200
5403 ; GFX908-NEXT: s_and_b32 s4, s20, -4
5404 ; GFX908-NEXT: v_mov_b32_e32 v2, s4
5405 ; GFX908-NEXT: buffer_load_dword v1, v2, s[16:19], 0 offen
5406 ; GFX908-NEXT: s_and_b32 s4, s20, 3
5407 ; GFX908-NEXT: s_lshl_b32 s6, s4, 3
5408 ; GFX908-NEXT: s_lshl_b32 s4, 0xffff, s6
5409 ; GFX908-NEXT: s_not_b32 s7, s4
5410 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
5411 ; GFX908-NEXT: v_lshlrev_b32_e32 v3, 16, v0
5412 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
5413 ; GFX908-NEXT: .LBB17_1: ; %atomicrmw.start
5414 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
5415 ; GFX908-NEXT: s_waitcnt vmcnt(0)
5416 ; GFX908-NEXT: v_lshrrev_b32_sdwa v0, s6, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5417 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v3
5418 ; GFX908-NEXT: v_bfe_u32 v4, v0, 16, 1
5419 ; GFX908-NEXT: v_or_b32_e32 v5, 0x400000, v0
5420 ; GFX908-NEXT: v_add3_u32 v4, v4, v0, s8
5421 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v0, v0
5422 ; GFX908-NEXT: v_cndmask_b32_e32 v0, v4, v5, vcc
5423 ; GFX908-NEXT: v_lshlrev_b32_sdwa v0, s6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5424 ; GFX908-NEXT: v_and_or_b32 v0, v1, s7, v0
5425 ; GFX908-NEXT: v_mov_b32_e32 v5, v1
5426 ; GFX908-NEXT: v_mov_b32_e32 v4, v0
5427 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[16:19], 0 offen glc
5428 ; GFX908-NEXT: s_waitcnt vmcnt(0)
5429 ; GFX908-NEXT: buffer_wbinvl1
5430 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
5431 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5432 ; GFX908-NEXT: v_mov_b32_e32 v1, v4
5433 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
5434 ; GFX908-NEXT: s_cbranch_execnz .LBB17_1
5435 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
5436 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
5437 ; GFX908-NEXT: s_setpc_b64 s[30:31]
5439 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5441 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5442 ; GFX8-NEXT: s_addk_i32 s20, 0x200
5443 ; GFX8-NEXT: s_and_b32 s4, s20, -4
5444 ; GFX8-NEXT: v_mov_b32_e32 v2, s4
5445 ; GFX8-NEXT: buffer_load_dword v1, v2, s[16:19], 0 offen
5446 ; GFX8-NEXT: s_and_b32 s4, s20, 3
5447 ; GFX8-NEXT: s_lshl_b32 s6, s4, 3
5448 ; GFX8-NEXT: s_lshl_b32 s4, 0xffff, s6
5449 ; GFX8-NEXT: s_not_b32 s7, s4
5450 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
5451 ; GFX8-NEXT: v_lshlrev_b32_e32 v3, 16, v0
5452 ; GFX8-NEXT: .LBB17_1: ; %atomicrmw.start
5453 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
5454 ; GFX8-NEXT: v_mov_b32_e32 v0, s6
5455 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5456 ; GFX8-NEXT: v_lshrrev_b32_sdwa v5, v0, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5457 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v3
5458 ; GFX8-NEXT: v_bfe_u32 v6, v5, 16, 1
5459 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v5
5460 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
5461 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v5
5462 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
5463 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v6, v7, vcc
5464 ; GFX8-NEXT: v_and_b32_e32 v4, s7, v1
5465 ; GFX8-NEXT: v_lshlrev_b32_sdwa v0, v0, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5466 ; GFX8-NEXT: v_or_b32_e32 v0, v4, v0
5467 ; GFX8-NEXT: v_mov_b32_e32 v5, v1
5468 ; GFX8-NEXT: v_mov_b32_e32 v4, v0
5469 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[16:19], 0 offen glc
5470 ; GFX8-NEXT: s_waitcnt vmcnt(0)
5471 ; GFX8-NEXT: buffer_wbinvl1
5472 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
5473 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5474 ; GFX8-NEXT: v_mov_b32_e32 v1, v4
5475 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
5476 ; GFX8-NEXT: s_cbranch_execnz .LBB17_1
5477 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
5478 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
5479 ; GFX8-NEXT: s_setpc_b64 s[30:31]
5481 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5483 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5484 ; GFX7-NEXT: s_addk_i32 s20, 0x200
5485 ; GFX7-NEXT: s_and_b32 s4, s20, -4
5486 ; GFX7-NEXT: v_mov_b32_e32 v2, s4
5487 ; GFX7-NEXT: buffer_load_dword v1, v2, s[16:19], 0 offen
5488 ; GFX7-NEXT: s_and_b32 s4, s20, 3
5489 ; GFX7-NEXT: s_lshl_b32 s6, s4, 3
5490 ; GFX7-NEXT: s_lshl_b32 s4, 0xffff, s6
5491 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
5492 ; GFX7-NEXT: s_not_b32 s7, s4
5493 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
5494 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
5495 ; GFX7-NEXT: .LBB17_1: ; %atomicrmw.start
5496 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
5497 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5498 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, s6, v1
5499 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v0
5500 ; GFX7-NEXT: v_add_f32_e32 v0, v0, v3
5501 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v0
5502 ; GFX7-NEXT: v_and_b32_e32 v4, s7, v1
5503 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, s6, v0
5504 ; GFX7-NEXT: v_or_b32_e32 v0, v4, v0
5505 ; GFX7-NEXT: v_mov_b32_e32 v5, v1
5506 ; GFX7-NEXT: v_mov_b32_e32 v4, v0
5507 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[16:19], 0 offen glc
5508 ; GFX7-NEXT: s_waitcnt vmcnt(0)
5509 ; GFX7-NEXT: buffer_wbinvl1
5510 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
5511 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5512 ; GFX7-NEXT: v_mov_b32_e32 v1, v4
5513 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
5514 ; GFX7-NEXT: s_cbranch_execnz .LBB17_1
5515 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
5516 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
5517 ; GFX7-NEXT: s_setpc_b64 s[30:31]
5519 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_bf16__offset__amdgpu_no_fine_grained_memory:
5521 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5522 ; GFX6-NEXT: s_addk_i32 s20, 0x200
5523 ; GFX6-NEXT: s_and_b32 s4, s20, -4
5524 ; GFX6-NEXT: v_mov_b32_e32 v2, s4
5525 ; GFX6-NEXT: buffer_load_dword v1, v2, s[16:19], 0 offen
5526 ; GFX6-NEXT: s_and_b32 s4, s20, 3
5527 ; GFX6-NEXT: s_lshl_b32 s6, s4, 3
5528 ; GFX6-NEXT: s_lshl_b32 s4, 0xffff, s6
5529 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
5530 ; GFX6-NEXT: s_not_b32 s7, s4
5531 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
5532 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
5533 ; GFX6-NEXT: .LBB17_1: ; %atomicrmw.start
5534 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
5535 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5536 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, s6, v1
5537 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v0
5538 ; GFX6-NEXT: v_add_f32_e32 v0, v0, v3
5539 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, 16, v0
5540 ; GFX6-NEXT: s_waitcnt expcnt(0)
5541 ; GFX6-NEXT: v_and_b32_e32 v4, s7, v1
5542 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, s6, v0
5543 ; GFX6-NEXT: v_or_b32_e32 v0, v4, v0
5544 ; GFX6-NEXT: v_mov_b32_e32 v5, v1
5545 ; GFX6-NEXT: v_mov_b32_e32 v4, v0
5546 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v2, s[16:19], 0 offen glc
5547 ; GFX6-NEXT: s_waitcnt vmcnt(0)
5548 ; GFX6-NEXT: buffer_wbinvl1
5549 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v1
5550 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
5551 ; GFX6-NEXT: v_mov_b32_e32 v1, v4
5552 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
5553 ; GFX6-NEXT: s_cbranch_execnz .LBB17_1
5554 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
5555 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
5556 ; GFX6-NEXT: s_waitcnt expcnt(0)
5557 ; GFX6-NEXT: s_setpc_b64 s[30:31]
5558 %gep = getelementptr bfloat, ptr addrspace(7) %ptr, i32 256
5559 %unused = atomicrmw fadd ptr addrspace(7) %gep, bfloat %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
5563 define bfloat @buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory(ptr addrspace(7) %ptr, bfloat %val) #0 {
5564 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
5566 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
5567 ; GFX12-NEXT: s_wait_expcnt 0x0
5568 ; GFX12-NEXT: s_wait_samplecnt 0x0
5569 ; GFX12-NEXT: s_wait_bvhcnt 0x0
5570 ; GFX12-NEXT: s_wait_kmcnt 0x0
5571 ; GFX12-NEXT: v_add_nc_u32_e32 v4, 0x200, v4
5572 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
5573 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
5574 ; GFX12-NEXT: v_and_b32_e32 v6, 3, v4
5575 ; GFX12-NEXT: v_and_b32_e32 v8, -4, v4
5576 ; GFX12-NEXT: v_lshlrev_b32_e32 v7, 3, v6
5577 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5578 ; GFX12-NEXT: v_lshlrev_b32_e64 v6, v7, 0xffff
5579 ; GFX12-NEXT: v_not_b32_e32 v9, v6
5580 ; GFX12-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
5581 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
5582 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
5583 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
5584 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
5585 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
5586 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
5587 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
5588 ; GFX12-NEXT: s_wait_alu 0xfffe
5589 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
5590 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
5591 ; GFX12-NEXT: s_wait_alu 0xfffe
5592 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
5593 ; GFX12-NEXT: s_wait_loadcnt 0x0
5594 ; GFX12-NEXT: buffer_load_b32 v6, v8, s[4:7], null offen
5595 ; GFX12-NEXT: s_wait_alu 0xfffe
5596 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
5597 ; GFX12-NEXT: s_cbranch_execnz .LBB18_1
5598 ; GFX12-NEXT: ; %bb.2:
5599 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
5600 ; GFX12-NEXT: v_lshlrev_b32_e32 v10, 16, v5
5601 ; GFX12-NEXT: s_mov_b32 s1, 0
5602 ; GFX12-NEXT: .LBB18_3: ; %atomicrmw.start
5603 ; GFX12-NEXT: ; =>This Loop Header: Depth=1
5604 ; GFX12-NEXT: ; Child Loop BB18_4 Depth 2
5605 ; GFX12-NEXT: s_wait_loadcnt 0x0
5606 ; GFX12-NEXT: v_lshrrev_b32_e32 v4, v7, v6
5607 ; GFX12-NEXT: s_mov_b32 s2, exec_lo
5608 ; GFX12-NEXT: s_wait_storecnt 0x0
5609 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5610 ; GFX12-NEXT: v_lshlrev_b32_e32 v4, 16, v4
5611 ; GFX12-NEXT: v_add_f32_e32 v4, v4, v10
5612 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
5613 ; GFX12-NEXT: v_bfe_u32 v5, v4, 16, 1
5614 ; GFX12-NEXT: v_or_b32_e32 v11, 0x400000, v4
5615 ; GFX12-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
5616 ; GFX12-NEXT: v_add3_u32 v5, v5, v4, 0x7fff
5617 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5618 ; GFX12-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc_lo
5619 ; GFX12-NEXT: v_lshrrev_b32_e32 v4, 16, v4
5620 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5621 ; GFX12-NEXT: v_lshlrev_b32_e32 v4, v7, v4
5622 ; GFX12-NEXT: v_and_or_b32 v5, v6, v9, v4
5623 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
5624 ; GFX12-NEXT: v_mov_b32_e32 v4, v5
5625 ; GFX12-NEXT: v_mov_b32_e32 v5, v6
5626 ; GFX12-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
5627 ; GFX12-NEXT: ; => This Inner Loop Header: Depth=2
5628 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
5629 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
5630 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
5631 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
5632 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
5633 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
5634 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
5635 ; GFX12-NEXT: s_wait_alu 0xfffe
5636 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
5637 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
5638 ; GFX12-NEXT: s_wait_alu 0xfffe
5639 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
5640 ; GFX12-NEXT: s_wait_loadcnt 0x0
5641 ; GFX12-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v8, s[4:7], null offen th:TH_ATOMIC_RETURN
5642 ; GFX12-NEXT: s_wait_alu 0xfffe
5643 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
5644 ; GFX12-NEXT: s_cbranch_execnz .LBB18_4
5645 ; GFX12-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
5646 ; GFX12-NEXT: s_mov_b32 exec_lo, s2
5647 ; GFX12-NEXT: s_wait_loadcnt 0x0
5648 ; GFX12-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
5649 ; GFX12-NEXT: v_mov_b32_e32 v6, v4
5650 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
5651 ; GFX12-NEXT: s_or_b32 s1, vcc_lo, s1
5652 ; GFX12-NEXT: s_wait_alu 0xfffe
5653 ; GFX12-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
5654 ; GFX12-NEXT: s_cbranch_execnz .LBB18_3
5655 ; GFX12-NEXT: ; %bb.6: ; %atomicrmw.end
5656 ; GFX12-NEXT: s_or_b32 exec_lo, exec_lo, s1
5657 ; GFX12-NEXT: v_lshrrev_b32_e32 v0, v7, v4
5658 ; GFX12-NEXT: s_wait_alu 0xfffe
5659 ; GFX12-NEXT: s_setpc_b64 s[30:31]
5661 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
5663 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5664 ; GFX940-NEXT: v_add_u32_e32 v4, 0x200, v4
5665 ; GFX940-NEXT: v_and_b32_e32 v9, -4, v4
5666 ; GFX940-NEXT: v_and_b32_e32 v4, 3, v4
5667 ; GFX940-NEXT: v_lshlrev_b32_e32 v8, 3, v4
5668 ; GFX940-NEXT: s_mov_b32 s0, 0xffff
5669 ; GFX940-NEXT: v_lshlrev_b32_e64 v4, v8, s0
5670 ; GFX940-NEXT: v_not_b32_e32 v10, v4
5671 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
5672 ; GFX940-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
5673 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
5674 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
5675 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
5676 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
5677 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
5678 ; GFX940-NEXT: s_nop 0
5679 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
5680 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
5681 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
5682 ; GFX940-NEXT: buffer_load_dword v7, v9, s[4:7], 0 offen
5683 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
5684 ; GFX940-NEXT: s_cbranch_execnz .LBB18_1
5685 ; GFX940-NEXT: ; %bb.2:
5686 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
5687 ; GFX940-NEXT: s_mov_b64 s[2:3], 0
5688 ; GFX940-NEXT: v_lshlrev_b32_e32 v11, 16, v5
5689 ; GFX940-NEXT: s_movk_i32 s10, 0x7fff
5690 ; GFX940-NEXT: .LBB18_3: ; %atomicrmw.start
5691 ; GFX940-NEXT: ; =>This Loop Header: Depth=1
5692 ; GFX940-NEXT: ; Child Loop BB18_4 Depth 2
5693 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5694 ; GFX940-NEXT: v_lshrrev_b32_sdwa v4, v8, v7 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5695 ; GFX940-NEXT: s_mov_b64 s[8:9], exec
5696 ; GFX940-NEXT: v_add_f32_e32 v4, v4, v11
5697 ; GFX940-NEXT: v_bfe_u32 v5, v4, 16, 1
5698 ; GFX940-NEXT: v_add3_u32 v5, v5, v4, s10
5699 ; GFX940-NEXT: v_or_b32_e32 v6, 0x400000, v4
5700 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
5701 ; GFX940-NEXT: buffer_wbl2 sc1
5702 ; GFX940-NEXT: s_nop 0
5703 ; GFX940-NEXT: v_cndmask_b32_e32 v4, v5, v6, vcc
5704 ; GFX940-NEXT: v_lshlrev_b32_sdwa v4, v8, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5705 ; GFX940-NEXT: v_and_or_b32 v6, v7, v10, v4
5706 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[6:7]
5707 ; GFX940-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
5708 ; GFX940-NEXT: ; => This Inner Loop Header: Depth=2
5709 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
5710 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
5711 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
5712 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
5713 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
5714 ; GFX940-NEXT: s_nop 0
5715 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
5716 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
5717 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
5718 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5719 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v9, s[4:7], 0 offen sc0
5720 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
5721 ; GFX940-NEXT: s_cbranch_execnz .LBB18_4
5722 ; GFX940-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
5723 ; GFX940-NEXT: s_mov_b64 exec, s[8:9]
5724 ; GFX940-NEXT: s_waitcnt vmcnt(0)
5725 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v7
5726 ; GFX940-NEXT: s_or_b64 s[2:3], vcc, s[2:3]
5727 ; GFX940-NEXT: v_mov_b32_e32 v7, v4
5728 ; GFX940-NEXT: buffer_inv sc1
5729 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[2:3]
5730 ; GFX940-NEXT: s_cbranch_execnz .LBB18_3
5731 ; GFX940-NEXT: ; %bb.6: ; %atomicrmw.end
5732 ; GFX940-NEXT: s_or_b64 exec, exec, s[2:3]
5733 ; GFX940-NEXT: v_lshrrev_b32_e32 v0, v8, v4
5734 ; GFX940-NEXT: s_setpc_b64 s[30:31]
5736 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
5738 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5739 ; GFX11-NEXT: v_add_nc_u32_e32 v4, 0x200, v4
5740 ; GFX11-NEXT: s_mov_b32 s1, 0
5741 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
5742 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
5743 ; GFX11-NEXT: v_and_b32_e32 v6, 3, v4
5744 ; GFX11-NEXT: v_and_b32_e32 v8, -4, v4
5745 ; GFX11-NEXT: v_lshlrev_b32_e32 v7, 3, v6
5746 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5747 ; GFX11-NEXT: v_lshlrev_b32_e64 v6, v7, 0xffff
5748 ; GFX11-NEXT: v_not_b32_e32 v9, v6
5749 ; GFX11-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
5750 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
5751 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
5752 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
5753 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
5754 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
5755 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
5756 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
5757 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
5758 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
5759 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
5760 ; GFX11-NEXT: buffer_load_b32 v6, v8, s[4:7], 0 offen
5761 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
5762 ; GFX11-NEXT: s_cbranch_execnz .LBB18_1
5763 ; GFX11-NEXT: ; %bb.2:
5764 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
5765 ; GFX11-NEXT: v_lshlrev_b32_e32 v10, 16, v5
5766 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
5767 ; GFX11-NEXT: .p2align 6
5768 ; GFX11-NEXT: .LBB18_3: ; %atomicrmw.start
5769 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
5770 ; GFX11-NEXT: ; Child Loop BB18_4 Depth 2
5771 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5772 ; GFX11-NEXT: v_lshrrev_b32_e32 v4, v7, v6
5773 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
5774 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
5775 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5776 ; GFX11-NEXT: v_lshlrev_b32_e32 v4, 16, v4
5777 ; GFX11-NEXT: v_add_f32_e32 v4, v4, v10
5778 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
5779 ; GFX11-NEXT: v_bfe_u32 v5, v4, 16, 1
5780 ; GFX11-NEXT: v_or_b32_e32 v11, 0x400000, v4
5781 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
5782 ; GFX11-NEXT: v_add3_u32 v5, v5, v4, 0x7fff
5783 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5784 ; GFX11-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc_lo
5785 ; GFX11-NEXT: v_lshrrev_b32_e32 v4, 16, v4
5786 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
5787 ; GFX11-NEXT: v_lshlrev_b32_e32 v4, v7, v4
5788 ; GFX11-NEXT: v_and_or_b32 v5, v6, v9, v4
5789 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
5790 ; GFX11-NEXT: v_mov_b32_e32 v4, v5
5791 ; GFX11-NEXT: v_mov_b32_e32 v5, v6
5792 ; GFX11-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
5793 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
5794 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
5795 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
5796 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
5797 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
5798 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
5799 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
5800 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
5801 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
5802 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
5803 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
5804 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5805 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v8, s[4:7], 0 offen glc
5806 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
5807 ; GFX11-NEXT: s_cbranch_execnz .LBB18_4
5808 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
5809 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
5810 ; GFX11-NEXT: s_waitcnt vmcnt(0)
5811 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
5812 ; GFX11-NEXT: v_mov_b32_e32 v6, v4
5813 ; GFX11-NEXT: buffer_gl1_inv
5814 ; GFX11-NEXT: buffer_gl0_inv
5815 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
5816 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
5817 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
5818 ; GFX11-NEXT: s_cbranch_execnz .LBB18_3
5819 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
5820 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
5821 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
5822 ; GFX11-NEXT: v_lshrrev_b32_e32 v0, v7, v4
5823 ; GFX11-NEXT: s_setpc_b64 s[30:31]
5825 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
5827 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5828 ; GFX10-NEXT: v_add_nc_u32_e32 v4, 0x200, v4
5829 ; GFX10-NEXT: s_mov_b32 s5, 0
5830 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
5831 ; GFX10-NEXT: v_and_b32_e32 v6, 3, v4
5832 ; GFX10-NEXT: v_and_b32_e32 v8, -4, v4
5833 ; GFX10-NEXT: v_lshlrev_b32_e32 v7, 3, v6
5834 ; GFX10-NEXT: v_lshlrev_b32_e64 v6, v7, 0xffff
5835 ; GFX10-NEXT: v_not_b32_e32 v9, v6
5836 ; GFX10-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
5837 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
5838 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
5839 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
5840 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
5841 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
5842 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
5843 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
5844 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
5845 ; GFX10-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
5846 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
5847 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
5848 ; GFX10-NEXT: s_cbranch_execnz .LBB18_1
5849 ; GFX10-NEXT: ; %bb.2:
5850 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
5851 ; GFX10-NEXT: v_lshlrev_b32_e32 v10, 16, v5
5852 ; GFX10-NEXT: .LBB18_3: ; %atomicrmw.start
5853 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
5854 ; GFX10-NEXT: ; Child Loop BB18_4 Depth 2
5855 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5856 ; GFX10-NEXT: v_lshrrev_b32_sdwa v4, v7, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5857 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
5858 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
5859 ; GFX10-NEXT: v_add_f32_e32 v4, v4, v10
5860 ; GFX10-NEXT: v_bfe_u32 v5, v4, 16, 1
5861 ; GFX10-NEXT: v_or_b32_e32 v11, 0x400000, v4
5862 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
5863 ; GFX10-NEXT: v_add3_u32 v5, v5, v4, 0x7fff
5864 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc_lo
5865 ; GFX10-NEXT: v_lshlrev_b32_sdwa v4, v7, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5866 ; GFX10-NEXT: v_and_or_b32 v5, v6, v9, v4
5867 ; GFX10-NEXT: v_mov_b32_e32 v4, v5
5868 ; GFX10-NEXT: v_mov_b32_e32 v5, v6
5869 ; GFX10-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
5870 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
5871 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
5872 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
5873 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
5874 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
5875 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
5876 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
5877 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
5878 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
5879 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5880 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
5881 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
5882 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
5883 ; GFX10-NEXT: s_cbranch_execnz .LBB18_4
5884 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
5885 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
5886 ; GFX10-NEXT: s_waitcnt vmcnt(0)
5887 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
5888 ; GFX10-NEXT: v_mov_b32_e32 v6, v4
5889 ; GFX10-NEXT: buffer_gl1_inv
5890 ; GFX10-NEXT: buffer_gl0_inv
5891 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
5892 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
5893 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
5894 ; GFX10-NEXT: s_cbranch_execnz .LBB18_3
5895 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
5896 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
5897 ; GFX10-NEXT: v_lshrrev_b32_e32 v0, v7, v4
5898 ; GFX10-NEXT: s_setpc_b64 s[30:31]
5900 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
5902 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5903 ; GFX90A-NEXT: v_add_u32_e32 v4, 0x200, v4
5904 ; GFX90A-NEXT: v_and_b32_e32 v9, -4, v4
5905 ; GFX90A-NEXT: v_and_b32_e32 v4, 3, v4
5906 ; GFX90A-NEXT: v_lshlrev_b32_e32 v8, 3, v4
5907 ; GFX90A-NEXT: s_mov_b32 s4, 0xffff
5908 ; GFX90A-NEXT: v_lshlrev_b32_e64 v4, v8, s4
5909 ; GFX90A-NEXT: v_not_b32_e32 v10, v4
5910 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
5911 ; GFX90A-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
5912 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
5913 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
5914 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
5915 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
5916 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5917 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5918 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5919 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5920 ; GFX90A-NEXT: s_nop 0
5921 ; GFX90A-NEXT: buffer_load_dword v7, v9, s[8:11], 0 offen
5922 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
5923 ; GFX90A-NEXT: s_cbranch_execnz .LBB18_1
5924 ; GFX90A-NEXT: ; %bb.2:
5925 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
5926 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
5927 ; GFX90A-NEXT: v_lshlrev_b32_e32 v11, 16, v5
5928 ; GFX90A-NEXT: s_movk_i32 s14, 0x7fff
5929 ; GFX90A-NEXT: .LBB18_3: ; %atomicrmw.start
5930 ; GFX90A-NEXT: ; =>This Loop Header: Depth=1
5931 ; GFX90A-NEXT: ; Child Loop BB18_4 Depth 2
5932 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
5933 ; GFX90A-NEXT: v_lshrrev_b32_sdwa v4, v8, v7 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
5934 ; GFX90A-NEXT: v_add_f32_e32 v4, v4, v11
5935 ; GFX90A-NEXT: v_bfe_u32 v5, v4, 16, 1
5936 ; GFX90A-NEXT: v_add3_u32 v5, v5, v4, s14
5937 ; GFX90A-NEXT: v_or_b32_e32 v6, 0x400000, v4
5938 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
5939 ; GFX90A-NEXT: v_cndmask_b32_e32 v4, v5, v6, vcc
5940 ; GFX90A-NEXT: v_lshlrev_b32_sdwa v4, v8, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
5941 ; GFX90A-NEXT: v_and_or_b32 v6, v7, v10, v4
5942 ; GFX90A-NEXT: s_mov_b64 s[12:13], exec
5943 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[6:7], v[6:7] op_sel:[0,1]
5944 ; GFX90A-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
5945 ; GFX90A-NEXT: ; => This Inner Loop Header: Depth=2
5946 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
5947 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
5948 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
5949 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
5950 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5951 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5952 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5953 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5954 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
5955 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v9, s[8:11], 0 offen glc
5956 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
5957 ; GFX90A-NEXT: s_cbranch_execnz .LBB18_4
5958 ; GFX90A-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
5959 ; GFX90A-NEXT: s_mov_b64 exec, s[12:13]
5960 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
5961 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v7
5962 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
5963 ; GFX90A-NEXT: v_mov_b32_e32 v7, v4
5964 ; GFX90A-NEXT: buffer_wbinvl1
5965 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
5966 ; GFX90A-NEXT: s_cbranch_execnz .LBB18_3
5967 ; GFX90A-NEXT: ; %bb.6: ; %atomicrmw.end
5968 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
5969 ; GFX90A-NEXT: v_lshrrev_b32_e32 v0, v8, v4
5970 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
5972 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
5974 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5975 ; GFX908-NEXT: v_add_u32_e32 v4, 0x200, v4
5976 ; GFX908-NEXT: v_and_b32_e32 v8, -4, v4
5977 ; GFX908-NEXT: v_and_b32_e32 v4, 3, v4
5978 ; GFX908-NEXT: v_lshlrev_b32_e32 v7, 3, v4
5979 ; GFX908-NEXT: s_mov_b32 s4, 0xffff
5980 ; GFX908-NEXT: v_lshlrev_b32_e64 v4, v7, s4
5981 ; GFX908-NEXT: v_not_b32_e32 v9, v4
5982 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
5983 ; GFX908-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
5984 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
5985 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
5986 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
5987 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
5988 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
5989 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
5990 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
5991 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
5992 ; GFX908-NEXT: s_nop 0
5993 ; GFX908-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
5994 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
5995 ; GFX908-NEXT: s_cbranch_execnz .LBB18_1
5996 ; GFX908-NEXT: ; %bb.2:
5997 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
5998 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
5999 ; GFX908-NEXT: v_lshlrev_b32_e32 v10, 16, v5
6000 ; GFX908-NEXT: s_movk_i32 s14, 0x7fff
6001 ; GFX908-NEXT: .LBB18_3: ; %atomicrmw.start
6002 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
6003 ; GFX908-NEXT: ; Child Loop BB18_4 Depth 2
6004 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6005 ; GFX908-NEXT: v_lshrrev_b32_sdwa v4, v7, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
6006 ; GFX908-NEXT: v_add_f32_e32 v4, v4, v10
6007 ; GFX908-NEXT: v_bfe_u32 v5, v4, 16, 1
6008 ; GFX908-NEXT: v_add3_u32 v5, v5, v4, s14
6009 ; GFX908-NEXT: v_or_b32_e32 v11, 0x400000, v4
6010 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
6011 ; GFX908-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc
6012 ; GFX908-NEXT: v_lshlrev_b32_sdwa v4, v7, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
6013 ; GFX908-NEXT: v_and_or_b32 v5, v6, v9, v4
6014 ; GFX908-NEXT: v_mov_b32_e32 v4, v5
6015 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
6016 ; GFX908-NEXT: v_mov_b32_e32 v5, v6
6017 ; GFX908-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
6018 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
6019 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
6020 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
6021 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
6022 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
6023 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6024 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6025 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6026 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6027 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6028 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
6029 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
6030 ; GFX908-NEXT: s_cbranch_execnz .LBB18_4
6031 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
6032 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
6033 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6034 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
6035 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6036 ; GFX908-NEXT: v_mov_b32_e32 v6, v4
6037 ; GFX908-NEXT: buffer_wbinvl1
6038 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
6039 ; GFX908-NEXT: s_cbranch_execnz .LBB18_3
6040 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
6041 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
6042 ; GFX908-NEXT: v_lshrrev_b32_e32 v0, v7, v4
6043 ; GFX908-NEXT: s_setpc_b64 s[30:31]
6045 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
6047 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6048 ; GFX8-NEXT: v_add_u32_e32 v4, vcc, 0x200, v4
6049 ; GFX8-NEXT: v_and_b32_e32 v8, -4, v4
6050 ; GFX8-NEXT: v_and_b32_e32 v4, 3, v4
6051 ; GFX8-NEXT: v_lshlrev_b32_e32 v7, 3, v4
6052 ; GFX8-NEXT: s_mov_b32 s4, 0xffff
6053 ; GFX8-NEXT: v_lshlrev_b32_e64 v4, v7, s4
6054 ; GFX8-NEXT: v_not_b32_e32 v9, v4
6055 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
6056 ; GFX8-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
6057 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
6058 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
6059 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
6060 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
6061 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6062 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6063 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6064 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6065 ; GFX8-NEXT: s_nop 0
6066 ; GFX8-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
6067 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
6068 ; GFX8-NEXT: s_cbranch_execnz .LBB18_1
6069 ; GFX8-NEXT: ; %bb.2:
6070 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
6071 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
6072 ; GFX8-NEXT: v_lshlrev_b32_e32 v10, 16, v5
6073 ; GFX8-NEXT: .LBB18_3: ; %atomicrmw.start
6074 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
6075 ; GFX8-NEXT: ; Child Loop BB18_4 Depth 2
6076 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6077 ; GFX8-NEXT: v_lshrrev_b32_sdwa v4, v7, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
6078 ; GFX8-NEXT: v_add_f32_e32 v4, v4, v10
6079 ; GFX8-NEXT: v_bfe_u32 v5, v4, 16, 1
6080 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, v5, v4
6081 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, 0x7fff, v5
6082 ; GFX8-NEXT: v_or_b32_e32 v11, 0x400000, v4
6083 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
6084 ; GFX8-NEXT: v_cndmask_b32_e32 v4, v5, v11, vcc
6085 ; GFX8-NEXT: v_lshlrev_b32_sdwa v4, v7, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_1
6086 ; GFX8-NEXT: v_and_b32_e32 v5, v6, v9
6087 ; GFX8-NEXT: v_or_b32_e32 v5, v5, v4
6088 ; GFX8-NEXT: v_mov_b32_e32 v4, v5
6089 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
6090 ; GFX8-NEXT: v_mov_b32_e32 v5, v6
6091 ; GFX8-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
6092 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
6093 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
6094 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
6095 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
6096 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
6097 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6098 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6099 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6100 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6101 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6102 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
6103 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
6104 ; GFX8-NEXT: s_cbranch_execnz .LBB18_4
6105 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
6106 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
6107 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6108 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
6109 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6110 ; GFX8-NEXT: v_mov_b32_e32 v6, v4
6111 ; GFX8-NEXT: buffer_wbinvl1
6112 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
6113 ; GFX8-NEXT: s_cbranch_execnz .LBB18_3
6114 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
6115 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
6116 ; GFX8-NEXT: v_lshrrev_b32_e32 v0, v7, v4
6117 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6119 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
6121 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6122 ; GFX7-NEXT: v_add_i32_e32 v4, vcc, 0x200, v4
6123 ; GFX7-NEXT: v_and_b32_e32 v8, -4, v4
6124 ; GFX7-NEXT: v_and_b32_e32 v4, 3, v4
6125 ; GFX7-NEXT: v_lshlrev_b32_e32 v7, 3, v4
6126 ; GFX7-NEXT: v_lshl_b32_e32 v4, 0xffff, v7
6127 ; GFX7-NEXT: v_not_b32_e32 v9, v4
6128 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
6129 ; GFX7-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
6130 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
6131 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
6132 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
6133 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
6134 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6135 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6136 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6137 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6138 ; GFX7-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
6139 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
6140 ; GFX7-NEXT: s_cbranch_execnz .LBB18_1
6141 ; GFX7-NEXT: ; %bb.2:
6142 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
6143 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v5
6144 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
6145 ; GFX7-NEXT: v_and_b32_e32 v10, 0xffff0000, v4
6146 ; GFX7-NEXT: .LBB18_3: ; %atomicrmw.start
6147 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
6148 ; GFX7-NEXT: ; Child Loop BB18_4 Depth 2
6149 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6150 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, v7, v6
6151 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v4
6152 ; GFX7-NEXT: v_add_f32_e32 v4, v4, v10
6153 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, 16, v4
6154 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, v7, v4
6155 ; GFX7-NEXT: v_and_b32_e32 v5, v6, v9
6156 ; GFX7-NEXT: v_or_b32_e32 v5, v5, v4
6157 ; GFX7-NEXT: v_mov_b32_e32 v4, v5
6158 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
6159 ; GFX7-NEXT: v_mov_b32_e32 v5, v6
6160 ; GFX7-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
6161 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
6162 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
6163 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
6164 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
6165 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
6166 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6167 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6168 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6169 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6170 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6171 ; GFX7-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
6172 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
6173 ; GFX7-NEXT: s_cbranch_execnz .LBB18_4
6174 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
6175 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
6176 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6177 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
6178 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6179 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
6180 ; GFX7-NEXT: buffer_wbinvl1
6181 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
6182 ; GFX7-NEXT: s_cbranch_execnz .LBB18_3
6183 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
6184 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
6185 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, v7, v4
6186 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v0
6187 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6189 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
6191 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6192 ; GFX6-NEXT: v_add_i32_e32 v4, vcc, 0x200, v4
6193 ; GFX6-NEXT: v_and_b32_e32 v8, -4, v4
6194 ; GFX6-NEXT: v_and_b32_e32 v4, 3, v4
6195 ; GFX6-NEXT: v_lshlrev_b32_e32 v7, 3, v4
6196 ; GFX6-NEXT: v_lshl_b32_e32 v4, 0xffff, v7
6197 ; GFX6-NEXT: v_not_b32_e32 v9, v4
6198 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
6199 ; GFX6-NEXT: .LBB18_1: ; =>This Inner Loop Header: Depth=1
6200 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
6201 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
6202 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
6203 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
6204 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6205 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6206 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6207 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6208 ; GFX6-NEXT: buffer_load_dword v6, v8, s[8:11], 0 offen
6209 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
6210 ; GFX6-NEXT: s_cbranch_execnz .LBB18_1
6211 ; GFX6-NEXT: ; %bb.2:
6212 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
6213 ; GFX6-NEXT: v_mul_f32_e32 v4, 1.0, v5
6214 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
6215 ; GFX6-NEXT: v_and_b32_e32 v10, 0xffff0000, v4
6216 ; GFX6-NEXT: .LBB18_3: ; %atomicrmw.start
6217 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
6218 ; GFX6-NEXT: ; Child Loop BB18_4 Depth 2
6219 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
6220 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, v7, v6
6221 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v4
6222 ; GFX6-NEXT: v_add_f32_e32 v4, v4, v10
6223 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, 16, v4
6224 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, v7, v4
6225 ; GFX6-NEXT: v_and_b32_e32 v5, v6, v9
6226 ; GFX6-NEXT: v_or_b32_e32 v5, v5, v4
6227 ; GFX6-NEXT: v_mov_b32_e32 v4, v5
6228 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
6229 ; GFX6-NEXT: v_mov_b32_e32 v5, v6
6230 ; GFX6-NEXT: .LBB18_4: ; Parent Loop BB18_3 Depth=1
6231 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
6232 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
6233 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
6234 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
6235 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
6236 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6237 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6238 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6239 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6240 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
6241 ; GFX6-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
6242 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
6243 ; GFX6-NEXT: s_cbranch_execnz .LBB18_4
6244 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB18_3 Depth=1
6245 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
6246 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6247 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
6248 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
6249 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
6250 ; GFX6-NEXT: buffer_wbinvl1
6251 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
6252 ; GFX6-NEXT: s_cbranch_execnz .LBB18_3
6253 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
6254 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
6255 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, v7, v4
6256 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v0
6257 ; GFX6-NEXT: s_waitcnt expcnt(0)
6258 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6259 %gep = getelementptr bfloat, ptr addrspace(7) %ptr, i32 256
6260 %result = atomicrmw fadd ptr addrspace(7) %gep, bfloat %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
6264 ; --------------------------------------------------------------------
6266 ; --------------------------------------------------------------------
6268 define <2 x half> @buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, <2 x half> %val) #0 {
6269 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6271 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
6272 ; GFX12-NEXT: s_wait_expcnt 0x0
6273 ; GFX12-NEXT: s_wait_samplecnt 0x0
6274 ; GFX12-NEXT: s_wait_bvhcnt 0x0
6275 ; GFX12-NEXT: s_wait_kmcnt 0x0
6276 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
6277 ; GFX12-NEXT: s_wait_storecnt 0x0
6278 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
6279 ; GFX12-NEXT: s_wait_loadcnt 0x0
6280 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
6281 ; GFX12-NEXT: s_setpc_b64 s[30:31]
6283 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6285 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6286 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
6287 ; GFX940-NEXT: buffer_wbl2 sc1
6288 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], 0 offen offset:1024 sc0
6289 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6290 ; GFX940-NEXT: buffer_inv sc1
6291 ; GFX940-NEXT: s_setpc_b64 s[30:31]
6293 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6295 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6296 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
6297 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
6298 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
6299 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
6300 ; GFX11-NEXT: s_mov_b32 s4, 0
6301 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
6302 ; GFX11-NEXT: .LBB19_1: ; %atomicrmw.start
6303 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
6304 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6305 ; GFX11-NEXT: v_mov_b32_e32 v5, v0
6306 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
6307 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
6308 ; GFX11-NEXT: v_pk_add_f16 v4, v5, v2
6309 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
6310 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], 0 offen glc
6311 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6312 ; GFX11-NEXT: buffer_gl1_inv
6313 ; GFX11-NEXT: buffer_gl0_inv
6314 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
6315 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
6316 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
6317 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
6318 ; GFX11-NEXT: s_cbranch_execnz .LBB19_1
6319 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
6320 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
6321 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6323 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6325 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6326 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
6327 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
6328 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
6329 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
6330 ; GFX10-NEXT: s_mov_b32 s4, 0
6331 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
6332 ; GFX10-NEXT: .LBB19_1: ; %atomicrmw.start
6333 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
6334 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6335 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
6336 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
6337 ; GFX10-NEXT: v_pk_add_f16 v4, v5, v2
6338 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
6339 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
6340 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
6341 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6342 ; GFX10-NEXT: buffer_gl1_inv
6343 ; GFX10-NEXT: buffer_gl0_inv
6344 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
6345 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
6346 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
6347 ; GFX10-NEXT: s_cbranch_execnz .LBB19_1
6348 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
6349 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
6350 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6352 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6354 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6355 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
6356 ; GFX90A-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[16:19], 0 offen offset:1024 glc
6357 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6358 ; GFX90A-NEXT: buffer_wbinvl1
6359 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
6361 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6363 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6364 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
6365 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
6366 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
6367 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
6368 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
6369 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
6370 ; GFX908-NEXT: .LBB19_1: ; %atomicrmw.start
6371 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
6372 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6373 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
6374 ; GFX908-NEXT: v_pk_add_f16 v4, v5, v2
6375 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
6376 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
6377 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
6378 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6379 ; GFX908-NEXT: buffer_wbinvl1
6380 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
6381 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6382 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
6383 ; GFX908-NEXT: s_cbranch_execnz .LBB19_1
6384 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
6385 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
6386 ; GFX908-NEXT: s_setpc_b64 s[30:31]
6388 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6390 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6391 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
6392 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
6393 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
6394 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
6395 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
6396 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
6397 ; GFX8-NEXT: .LBB19_1: ; %atomicrmw.start
6398 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
6399 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6400 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
6401 ; 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
6402 ; GFX8-NEXT: v_add_f16_e32 v1, v5, v2
6403 ; GFX8-NEXT: v_or_b32_e32 v4, v1, v0
6404 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
6405 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
6406 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
6407 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6408 ; GFX8-NEXT: buffer_wbinvl1
6409 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
6410 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6411 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
6412 ; GFX8-NEXT: s_cbranch_execnz .LBB19_1
6413 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
6414 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
6415 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6417 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6419 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6420 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
6421 ; GFX7-NEXT: buffer_load_dword v3, v2, s[16:19], 0 offen offset:1024
6422 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
6423 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v0
6424 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
6425 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
6426 ; GFX7-NEXT: v_cvt_f32_f16_e32 v2, v1
6427 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6428 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v3
6429 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v3
6430 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1
6431 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v4
6432 ; GFX7-NEXT: v_mov_b32_e32 v4, s6
6433 ; GFX7-NEXT: .LBB19_1: ; %atomicrmw.start
6434 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
6435 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
6436 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
6437 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v1
6438 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v0
6439 ; GFX7-NEXT: v_lshlrev_b32_e32 v1, 16, v1
6440 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v2
6441 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v3
6442 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v5
6443 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v6
6444 ; GFX7-NEXT: v_or_b32_e32 v6, v0, v1
6445 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v5
6446 ; GFX7-NEXT: v_or_b32_e32 v5, v7, v0
6447 ; GFX7-NEXT: v_mov_b32_e32 v8, v6
6448 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
6449 ; GFX7-NEXT: buffer_atomic_cmpswap v[7:8], v4, s[16:19], 0 offen glc
6450 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6451 ; GFX7-NEXT: buffer_wbinvl1
6452 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v7
6453 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v7
6454 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1
6455 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
6456 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6457 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
6458 ; GFX7-NEXT: s_cbranch_execnz .LBB19_1
6459 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
6460 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
6461 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6463 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_fine_grained_memory:
6465 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6466 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
6467 ; GFX6-NEXT: buffer_load_dword v3, v2, s[16:19], 0 offen offset:1024
6468 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
6469 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v0
6470 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
6471 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
6472 ; GFX6-NEXT: v_cvt_f32_f16_e32 v2, v1
6473 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6474 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v3
6475 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v3
6476 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v1
6477 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v4
6478 ; GFX6-NEXT: v_mov_b32_e32 v4, s6
6479 ; GFX6-NEXT: .LBB19_1: ; %atomicrmw.start
6480 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
6481 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
6482 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
6483 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v1
6484 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v0
6485 ; GFX6-NEXT: v_lshlrev_b32_e32 v1, 16, v1
6486 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v2
6487 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v3
6488 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v5
6489 ; GFX6-NEXT: s_waitcnt expcnt(0)
6490 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v6
6491 ; GFX6-NEXT: v_or_b32_e32 v6, v0, v1
6492 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v5
6493 ; GFX6-NEXT: v_or_b32_e32 v5, v7, v0
6494 ; GFX6-NEXT: v_mov_b32_e32 v8, v6
6495 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
6496 ; GFX6-NEXT: buffer_atomic_cmpswap v[7:8], v4, s[16:19], 0 offen glc
6497 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6498 ; GFX6-NEXT: buffer_wbinvl1
6499 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v7
6500 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v7
6501 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v1
6502 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
6503 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6504 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
6505 ; GFX6-NEXT: s_cbranch_execnz .LBB19_1
6506 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
6507 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
6508 ; GFX6-NEXT: s_waitcnt expcnt(0)
6509 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6510 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
6511 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
6512 ret <2 x half> %result
6515 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, <2 x half> %val) #0 {
6516 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6518 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
6519 ; GFX12-NEXT: s_wait_expcnt 0x0
6520 ; GFX12-NEXT: s_wait_samplecnt 0x0
6521 ; GFX12-NEXT: s_wait_bvhcnt 0x0
6522 ; GFX12-NEXT: s_wait_kmcnt 0x0
6523 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
6524 ; GFX12-NEXT: s_wait_storecnt 0x0
6525 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], null offen offset:1024
6526 ; GFX12-NEXT: s_wait_storecnt 0x0
6527 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
6528 ; GFX12-NEXT: s_setpc_b64 s[30:31]
6530 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6532 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6533 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
6534 ; GFX940-NEXT: buffer_wbl2 sc1
6535 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], 0 offen offset:1024
6536 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6537 ; GFX940-NEXT: buffer_inv sc1
6538 ; GFX940-NEXT: s_setpc_b64 s[30:31]
6540 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6542 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6543 ; GFX11-NEXT: v_mov_b32_e32 v1, s16
6544 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
6545 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
6546 ; GFX11-NEXT: v_mov_b32_e32 v3, s4
6547 ; GFX11-NEXT: s_mov_b32 s4, 0
6548 ; GFX11-NEXT: buffer_load_b32 v2, v1, s[0:3], 0 offen offset:1024
6549 ; GFX11-NEXT: .LBB20_1: ; %atomicrmw.start
6550 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
6551 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6552 ; GFX11-NEXT: v_pk_add_f16 v1, v2, v0
6553 ; GFX11-NEXT: v_mov_b32_e32 v5, v2
6554 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
6555 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
6556 ; GFX11-NEXT: v_mov_b32_e32 v4, v1
6557 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v3, s[0:3], 0 offen glc
6558 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6559 ; GFX11-NEXT: buffer_gl1_inv
6560 ; GFX11-NEXT: buffer_gl0_inv
6561 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
6562 ; GFX11-NEXT: v_mov_b32_e32 v2, v4
6563 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
6564 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
6565 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
6566 ; GFX11-NEXT: s_cbranch_execnz .LBB20_1
6567 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
6568 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
6569 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6571 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6573 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6574 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
6575 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
6576 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
6577 ; GFX10-NEXT: s_mov_b32 s4, 0
6578 ; GFX10-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
6579 ; GFX10-NEXT: .LBB20_1: ; %atomicrmw.start
6580 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
6581 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6582 ; GFX10-NEXT: v_pk_add_f16 v1, v2, v0
6583 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
6584 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
6585 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
6586 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
6587 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6588 ; GFX10-NEXT: buffer_gl1_inv
6589 ; GFX10-NEXT: buffer_gl0_inv
6590 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
6591 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
6592 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
6593 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
6594 ; GFX10-NEXT: s_cbranch_execnz .LBB20_1
6595 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
6596 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
6597 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6599 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6601 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6602 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
6603 ; GFX90A-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[16:19], 0 offen offset:1024
6604 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6605 ; GFX90A-NEXT: buffer_wbinvl1
6606 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
6608 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6610 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6611 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
6612 ; GFX908-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[16:19], 0 offen offset:1024
6613 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6614 ; GFX908-NEXT: buffer_wbinvl1
6615 ; GFX908-NEXT: s_setpc_b64 s[30:31]
6617 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6619 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6620 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
6621 ; GFX8-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
6622 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
6623 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
6624 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
6625 ; GFX8-NEXT: .LBB20_1: ; %atomicrmw.start
6626 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
6627 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6628 ; 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
6629 ; GFX8-NEXT: v_add_f16_e32 v4, v2, v0
6630 ; GFX8-NEXT: v_or_b32_e32 v1, v4, v1
6631 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
6632 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
6633 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
6634 ; GFX8-NEXT: s_waitcnt vmcnt(0)
6635 ; GFX8-NEXT: buffer_wbinvl1
6636 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
6637 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6638 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
6639 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
6640 ; GFX8-NEXT: s_cbranch_execnz .LBB20_1
6641 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
6642 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
6643 ; GFX8-NEXT: s_setpc_b64 s[30:31]
6645 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6647 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6648 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
6649 ; GFX7-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
6650 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
6651 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v0
6652 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
6653 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
6654 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v1
6655 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6656 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v2
6657 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v2
6658 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v1
6659 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v5
6660 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
6661 ; GFX7-NEXT: .LBB20_1: ; %atomicrmw.start
6662 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
6663 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v4
6664 ; GFX7-NEXT: v_cvt_f16_f32_e32 v3, v3
6665 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v4
6666 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v3
6667 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v4
6668 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
6669 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
6670 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v5
6671 ; GFX7-NEXT: v_cvt_f16_f32_e32 v6, v6
6672 ; GFX7-NEXT: v_or_b32_e32 v5, v3, v4
6673 ; GFX7-NEXT: v_lshlrev_b32_e32 v3, 16, v7
6674 ; GFX7-NEXT: v_or_b32_e32 v4, v6, v3
6675 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
6676 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
6677 ; GFX7-NEXT: buffer_atomic_cmpswap v[6:7], v2, s[16:19], 0 offen glc
6678 ; GFX7-NEXT: s_waitcnt vmcnt(0)
6679 ; GFX7-NEXT: buffer_wbinvl1
6680 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, 16, v6
6681 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v6
6682 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v4
6683 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
6684 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6685 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
6686 ; GFX7-NEXT: s_cbranch_execnz .LBB20_1
6687 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
6688 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
6689 ; GFX7-NEXT: s_setpc_b64 s[30:31]
6691 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_fine_grained_memory:
6693 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6694 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
6695 ; GFX6-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
6696 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
6697 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v0
6698 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
6699 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
6700 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v1
6701 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6702 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v2
6703 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v2
6704 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v1
6705 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v5
6706 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
6707 ; GFX6-NEXT: .LBB20_1: ; %atomicrmw.start
6708 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
6709 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v4
6710 ; GFX6-NEXT: v_cvt_f16_f32_e32 v3, v3
6711 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v4
6712 ; GFX6-NEXT: s_waitcnt expcnt(0)
6713 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v3
6714 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v4
6715 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
6716 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
6717 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v5
6718 ; GFX6-NEXT: v_cvt_f16_f32_e32 v6, v6
6719 ; GFX6-NEXT: v_or_b32_e32 v5, v3, v4
6720 ; GFX6-NEXT: v_lshlrev_b32_e32 v3, 16, v7
6721 ; GFX6-NEXT: v_or_b32_e32 v4, v6, v3
6722 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
6723 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
6724 ; GFX6-NEXT: buffer_atomic_cmpswap v[6:7], v2, s[16:19], 0 offen glc
6725 ; GFX6-NEXT: s_waitcnt vmcnt(0)
6726 ; GFX6-NEXT: buffer_wbinvl1
6727 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, 16, v6
6728 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v6
6729 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v4
6730 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
6731 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
6732 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
6733 ; GFX6-NEXT: s_cbranch_execnz .LBB20_1
6734 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
6735 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
6736 ; GFX6-NEXT: s_waitcnt expcnt(0)
6737 ; GFX6-NEXT: s_setpc_b64 s[30:31]
6738 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
6739 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
6743 define <2 x half> @buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory(ptr addrspace(7) %ptr, <2 x half> %val) #0 {
6744 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
6746 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
6747 ; GFX12-NEXT: s_wait_expcnt 0x0
6748 ; GFX12-NEXT: s_wait_samplecnt 0x0
6749 ; GFX12-NEXT: s_wait_bvhcnt 0x0
6750 ; GFX12-NEXT: s_wait_kmcnt 0x0
6751 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
6752 ; GFX12-NEXT: s_wait_storecnt 0x0
6753 ; GFX12-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
6754 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
6755 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
6756 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
6757 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
6758 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
6759 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
6760 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
6761 ; GFX12-NEXT: s_wait_alu 0xfffe
6762 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
6763 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
6764 ; GFX12-NEXT: s_wait_alu 0xfffe
6765 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
6766 ; GFX12-NEXT: s_wait_loadcnt 0x0
6767 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v5, v4, s[4:7], null offen offset:1024 th:TH_ATOMIC_RETURN
6768 ; GFX12-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
6769 ; GFX12-NEXT: ; implicit-def: $vgpr4
6770 ; GFX12-NEXT: s_wait_alu 0xfffe
6771 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
6772 ; GFX12-NEXT: s_cbranch_execnz .LBB21_1
6773 ; GFX12-NEXT: ; %bb.2:
6774 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
6775 ; GFX12-NEXT: s_wait_loadcnt 0x0
6776 ; GFX12-NEXT: v_mov_b32_e32 v0, v5
6777 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
6778 ; GFX12-NEXT: s_wait_alu 0xfffe
6779 ; GFX12-NEXT: s_setpc_b64 s[30:31]
6781 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
6783 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6784 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
6785 ; GFX940-NEXT: buffer_wbl2 sc1
6786 ; GFX940-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
6787 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
6788 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
6789 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
6790 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
6791 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
6792 ; GFX940-NEXT: s_nop 0
6793 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
6794 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
6795 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
6796 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6797 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v5, v4, s[4:7], 0 offen offset:1024 sc0
6798 ; GFX940-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
6799 ; GFX940-NEXT: ; implicit-def: $vgpr4
6800 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
6801 ; GFX940-NEXT: s_cbranch_execnz .LBB21_1
6802 ; GFX940-NEXT: ; %bb.2:
6803 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
6804 ; GFX940-NEXT: s_waitcnt vmcnt(0)
6805 ; GFX940-NEXT: v_mov_b32_e32 v0, v5
6806 ; GFX940-NEXT: buffer_inv sc1
6807 ; GFX940-NEXT: s_setpc_b64 s[30:31]
6809 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
6811 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6812 ; GFX11-NEXT: v_add_nc_u32_e32 v9, 0x400, v4
6813 ; GFX11-NEXT: s_mov_b32 s1, 0
6814 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
6815 ; GFX11-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
6816 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
6817 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
6818 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
6819 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
6820 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
6821 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
6822 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
6823 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
6824 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
6825 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
6826 ; GFX11-NEXT: buffer_load_b32 v8, v4, s[4:7], 0 offen offset:1024
6827 ; GFX11-NEXT: ; implicit-def: $vgpr4
6828 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
6829 ; GFX11-NEXT: s_cbranch_execnz .LBB21_1
6830 ; GFX11-NEXT: ; %bb.2:
6831 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
6832 ; GFX11-NEXT: .p2align 6
6833 ; GFX11-NEXT: .LBB21_3: ; %atomicrmw.start
6834 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
6835 ; GFX11-NEXT: ; Child Loop BB21_4 Depth 2
6836 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6837 ; GFX11-NEXT: v_pk_add_f16 v7, v8, v5
6838 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
6839 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
6840 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
6841 ; GFX11-NEXT: v_mov_b32_e32 v6, v7
6842 ; GFX11-NEXT: v_mov_b32_e32 v7, v8
6843 ; GFX11-NEXT: .LBB21_4: ; Parent Loop BB21_3 Depth=1
6844 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
6845 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
6846 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
6847 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
6848 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
6849 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
6850 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
6851 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
6852 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
6853 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
6854 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
6855 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6856 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[6:7], v9, s[4:7], 0 offen glc
6857 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
6858 ; GFX11-NEXT: s_cbranch_execnz .LBB21_4
6859 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB21_3 Depth=1
6860 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
6861 ; GFX11-NEXT: s_waitcnt vmcnt(0)
6862 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v6, v8
6863 ; GFX11-NEXT: v_mov_b32_e32 v8, v6
6864 ; GFX11-NEXT: buffer_gl1_inv
6865 ; GFX11-NEXT: buffer_gl0_inv
6866 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
6867 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
6868 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
6869 ; GFX11-NEXT: s_cbranch_execnz .LBB21_3
6870 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
6871 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
6872 ; GFX11-NEXT: v_mov_b32_e32 v0, v6
6873 ; GFX11-NEXT: s_setpc_b64 s[30:31]
6875 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
6877 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6878 ; GFX10-NEXT: v_add_nc_u32_e32 v9, 0x400, v4
6879 ; GFX10-NEXT: s_mov_b32 s5, 0
6880 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
6881 ; GFX10-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
6882 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
6883 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
6884 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
6885 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
6886 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
6887 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
6888 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
6889 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
6890 ; GFX10-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
6891 ; GFX10-NEXT: ; implicit-def: $vgpr4
6892 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
6893 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
6894 ; GFX10-NEXT: s_cbranch_execnz .LBB21_1
6895 ; GFX10-NEXT: ; %bb.2:
6896 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
6897 ; GFX10-NEXT: .LBB21_3: ; %atomicrmw.start
6898 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
6899 ; GFX10-NEXT: ; Child Loop BB21_4 Depth 2
6900 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6901 ; GFX10-NEXT: v_pk_add_f16 v7, v8, v5
6902 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
6903 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
6904 ; GFX10-NEXT: v_mov_b32_e32 v6, v7
6905 ; GFX10-NEXT: v_mov_b32_e32 v7, v8
6906 ; GFX10-NEXT: .LBB21_4: ; Parent Loop BB21_3 Depth=1
6907 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
6908 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
6909 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
6910 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
6911 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
6912 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
6913 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
6914 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
6915 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
6916 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6917 ; GFX10-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
6918 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
6919 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
6920 ; GFX10-NEXT: s_cbranch_execnz .LBB21_4
6921 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB21_3 Depth=1
6922 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
6923 ; GFX10-NEXT: s_waitcnt vmcnt(0)
6924 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v6, v8
6925 ; GFX10-NEXT: v_mov_b32_e32 v8, v6
6926 ; GFX10-NEXT: buffer_gl1_inv
6927 ; GFX10-NEXT: buffer_gl0_inv
6928 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
6929 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
6930 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
6931 ; GFX10-NEXT: s_cbranch_execnz .LBB21_3
6932 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
6933 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
6934 ; GFX10-NEXT: v_mov_b32_e32 v0, v6
6935 ; GFX10-NEXT: s_setpc_b64 s[30:31]
6937 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
6939 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6940 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
6941 ; GFX90A-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
6942 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
6943 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
6944 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
6945 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
6946 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6947 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6948 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6949 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6950 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6951 ; GFX90A-NEXT: buffer_atomic_pk_add_f16 v5, v4, s[8:11], 0 offen offset:1024 glc
6952 ; GFX90A-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
6953 ; GFX90A-NEXT: ; implicit-def: $vgpr4
6954 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
6955 ; GFX90A-NEXT: s_cbranch_execnz .LBB21_1
6956 ; GFX90A-NEXT: ; %bb.2:
6957 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
6958 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
6959 ; GFX90A-NEXT: v_mov_b32_e32 v0, v5
6960 ; GFX90A-NEXT: buffer_wbinvl1
6961 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
6963 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
6965 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
6966 ; GFX908-NEXT: v_add_u32_e32 v9, 0x400, v4
6967 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
6968 ; GFX908-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
6969 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
6970 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
6971 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
6972 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
6973 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
6974 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
6975 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
6976 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
6977 ; GFX908-NEXT: s_nop 0
6978 ; GFX908-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
6979 ; GFX908-NEXT: ; implicit-def: $vgpr4
6980 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
6981 ; GFX908-NEXT: s_cbranch_execnz .LBB21_1
6982 ; GFX908-NEXT: ; %bb.2:
6983 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
6984 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
6985 ; GFX908-NEXT: .LBB21_3: ; %atomicrmw.start
6986 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
6987 ; GFX908-NEXT: ; Child Loop BB21_4 Depth 2
6988 ; GFX908-NEXT: s_waitcnt vmcnt(0)
6989 ; GFX908-NEXT: v_pk_add_f16 v7, v8, v5
6990 ; GFX908-NEXT: v_mov_b32_e32 v6, v7
6991 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
6992 ; GFX908-NEXT: v_mov_b32_e32 v7, v8
6993 ; GFX908-NEXT: .LBB21_4: ; Parent Loop BB21_3 Depth=1
6994 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
6995 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
6996 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
6997 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
6998 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
6999 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7000 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7001 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7002 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7003 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7004 ; GFX908-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
7005 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
7006 ; GFX908-NEXT: s_cbranch_execnz .LBB21_4
7007 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB21_3 Depth=1
7008 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
7009 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7010 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
7011 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
7012 ; GFX908-NEXT: v_mov_b32_e32 v8, v6
7013 ; GFX908-NEXT: buffer_wbinvl1
7014 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
7015 ; GFX908-NEXT: s_cbranch_execnz .LBB21_3
7016 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
7017 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
7018 ; GFX908-NEXT: v_mov_b32_e32 v0, v6
7019 ; GFX908-NEXT: s_setpc_b64 s[30:31]
7021 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
7023 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7024 ; GFX8-NEXT: v_add_u32_e32 v9, vcc, 0x400, v4
7025 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
7026 ; GFX8-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
7027 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
7028 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
7029 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
7030 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
7031 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7032 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7033 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7034 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7035 ; GFX8-NEXT: s_nop 0
7036 ; GFX8-NEXT: buffer_load_dword v8, v4, s[8:11], 0 offen offset:1024
7037 ; GFX8-NEXT: ; implicit-def: $vgpr4
7038 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
7039 ; GFX8-NEXT: s_cbranch_execnz .LBB21_1
7040 ; GFX8-NEXT: ; %bb.2:
7041 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
7042 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
7043 ; GFX8-NEXT: .LBB21_3: ; %atomicrmw.start
7044 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
7045 ; GFX8-NEXT: ; Child Loop BB21_4 Depth 2
7046 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7047 ; 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
7048 ; GFX8-NEXT: v_add_f16_e32 v6, v8, v5
7049 ; GFX8-NEXT: v_or_b32_e32 v7, v6, v4
7050 ; GFX8-NEXT: v_mov_b32_e32 v6, v7
7051 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
7052 ; GFX8-NEXT: v_mov_b32_e32 v7, v8
7053 ; GFX8-NEXT: .LBB21_4: ; Parent Loop BB21_3 Depth=1
7054 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
7055 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
7056 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
7057 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
7058 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
7059 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7060 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7061 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7062 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7063 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7064 ; GFX8-NEXT: buffer_atomic_cmpswap v[6:7], v9, s[8:11], 0 offen glc
7065 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
7066 ; GFX8-NEXT: s_cbranch_execnz .LBB21_4
7067 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB21_3 Depth=1
7068 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
7069 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7070 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v6, v8
7071 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
7072 ; GFX8-NEXT: v_mov_b32_e32 v8, v6
7073 ; GFX8-NEXT: buffer_wbinvl1
7074 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
7075 ; GFX8-NEXT: s_cbranch_execnz .LBB21_3
7076 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
7077 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
7078 ; GFX8-NEXT: v_mov_b32_e32 v0, v6
7079 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7081 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
7083 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7084 ; GFX7-NEXT: v_add_i32_e32 v9, vcc, 0x400, v4
7085 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
7086 ; GFX7-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
7087 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
7088 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
7089 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
7090 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
7091 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7092 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7093 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7094 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7095 ; GFX7-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
7096 ; GFX7-NEXT: ; implicit-def: $vgpr4
7097 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
7098 ; GFX7-NEXT: s_cbranch_execnz .LBB21_1
7099 ; GFX7-NEXT: ; %bb.2:
7100 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
7101 ; GFX7-NEXT: v_cvt_f16_f32_e32 v6, v6
7102 ; GFX7-NEXT: v_cvt_f16_f32_e32 v8, v5
7103 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7104 ; GFX7-NEXT: v_lshrrev_b32_e32 v5, 16, v7
7105 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v7
7106 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v5
7107 ; GFX7-NEXT: v_cvt_f32_f16_e32 v10, v6
7108 ; GFX7-NEXT: v_cvt_f32_f16_e32 v11, v8
7109 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
7110 ; GFX7-NEXT: .LBB21_3: ; %atomicrmw.start
7111 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
7112 ; GFX7-NEXT: ; Child Loop BB21_4 Depth 2
7113 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v5
7114 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v4
7115 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
7116 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v5
7117 ; GFX7-NEXT: v_cvt_f32_f16_e32 v7, v4
7118 ; GFX7-NEXT: v_lshlrev_b32_e32 v5, 16, v5
7119 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v10
7120 ; GFX7-NEXT: v_add_f32_e32 v7, v7, v11
7121 ; GFX7-NEXT: v_cvt_f16_f32_e32 v8, v6
7122 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v7
7123 ; GFX7-NEXT: v_or_b32_e32 v6, v4, v5
7124 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v8
7125 ; GFX7-NEXT: v_or_b32_e32 v5, v7, v4
7126 ; GFX7-NEXT: v_mov_b32_e32 v8, v6
7127 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
7128 ; GFX7-NEXT: .LBB21_4: ; Parent Loop BB21_3 Depth=1
7129 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
7130 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
7131 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
7132 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
7133 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
7134 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7135 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7136 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7137 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7138 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7139 ; GFX7-NEXT: buffer_atomic_cmpswap v[7:8], v9, s[8:11], 0 offen glc
7140 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
7141 ; GFX7-NEXT: s_cbranch_execnz .LBB21_4
7142 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB21_3 Depth=1
7143 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
7144 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7145 ; GFX7-NEXT: v_lshrrev_b32_e32 v5, 16, v7
7146 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v7
7147 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v5
7148 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
7149 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
7150 ; GFX7-NEXT: buffer_wbinvl1
7151 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
7152 ; GFX7-NEXT: s_cbranch_execnz .LBB21_3
7153 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
7154 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
7155 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
7156 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
7157 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7159 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__waterfall__amdgpu_no_fine_grained_memory:
7161 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7162 ; GFX6-NEXT: v_add_i32_e32 v9, vcc, 0x400, v4
7163 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
7164 ; GFX6-NEXT: .LBB21_1: ; =>This Inner Loop Header: Depth=1
7165 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
7166 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
7167 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
7168 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
7169 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7170 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7171 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7172 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7173 ; GFX6-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
7174 ; GFX6-NEXT: ; implicit-def: $vgpr4
7175 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
7176 ; GFX6-NEXT: s_cbranch_execnz .LBB21_1
7177 ; GFX6-NEXT: ; %bb.2:
7178 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
7179 ; GFX6-NEXT: v_cvt_f16_f32_e32 v6, v6
7180 ; GFX6-NEXT: v_cvt_f16_f32_e32 v8, v5
7181 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7182 ; GFX6-NEXT: v_lshrrev_b32_e32 v5, 16, v7
7183 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v7
7184 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v5
7185 ; GFX6-NEXT: v_cvt_f32_f16_e32 v10, v6
7186 ; GFX6-NEXT: v_cvt_f32_f16_e32 v11, v8
7187 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
7188 ; GFX6-NEXT: .LBB21_3: ; %atomicrmw.start
7189 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
7190 ; GFX6-NEXT: ; Child Loop BB21_4 Depth 2
7191 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v5
7192 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v4
7193 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
7194 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v5
7195 ; GFX6-NEXT: s_waitcnt expcnt(0)
7196 ; GFX6-NEXT: v_cvt_f32_f16_e32 v7, v4
7197 ; GFX6-NEXT: v_lshlrev_b32_e32 v5, 16, v5
7198 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v10
7199 ; GFX6-NEXT: v_add_f32_e32 v7, v7, v11
7200 ; GFX6-NEXT: v_cvt_f16_f32_e32 v8, v6
7201 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v7
7202 ; GFX6-NEXT: v_or_b32_e32 v6, v4, v5
7203 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v8
7204 ; GFX6-NEXT: v_or_b32_e32 v5, v7, v4
7205 ; GFX6-NEXT: v_mov_b32_e32 v8, v6
7206 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
7207 ; GFX6-NEXT: .LBB21_4: ; Parent Loop BB21_3 Depth=1
7208 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
7209 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
7210 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
7211 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
7212 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
7213 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
7214 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
7215 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
7216 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
7217 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
7218 ; GFX6-NEXT: buffer_atomic_cmpswap v[7:8], v9, s[8:11], 0 offen glc
7219 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
7220 ; GFX6-NEXT: s_cbranch_execnz .LBB21_4
7221 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB21_3 Depth=1
7222 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
7223 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7224 ; GFX6-NEXT: v_lshrrev_b32_e32 v5, 16, v7
7225 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v7
7226 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v5
7227 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
7228 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
7229 ; GFX6-NEXT: buffer_wbinvl1
7230 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
7231 ; GFX6-NEXT: s_cbranch_execnz .LBB21_3
7232 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
7233 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
7234 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
7235 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
7236 ; GFX6-NEXT: s_waitcnt expcnt(0)
7237 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7238 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
7239 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
7240 ret <2 x half> %result
7243 define <2 x half> @buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset(ptr addrspace(7) inreg %ptr, <2 x half> %val) {
7244 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7246 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
7247 ; GFX12-NEXT: s_wait_expcnt 0x0
7248 ; GFX12-NEXT: s_wait_samplecnt 0x0
7249 ; GFX12-NEXT: s_wait_bvhcnt 0x0
7250 ; GFX12-NEXT: s_wait_kmcnt 0x0
7251 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
7252 ; GFX12-NEXT: s_wait_storecnt 0x0
7253 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
7254 ; GFX12-NEXT: s_wait_loadcnt 0x0
7255 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
7256 ; GFX12-NEXT: s_setpc_b64 s[30:31]
7258 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7260 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7261 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
7262 ; GFX940-NEXT: buffer_wbl2 sc1
7263 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], 0 offen offset:1024 sc0
7264 ; GFX940-NEXT: s_waitcnt vmcnt(0)
7265 ; GFX940-NEXT: buffer_inv sc1
7266 ; GFX940-NEXT: s_setpc_b64 s[30:31]
7268 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7270 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7271 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
7272 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7273 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
7274 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
7275 ; GFX11-NEXT: s_mov_b32 s4, 0
7276 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
7277 ; GFX11-NEXT: .LBB22_1: ; %atomicrmw.start
7278 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
7279 ; GFX11-NEXT: s_waitcnt vmcnt(0)
7280 ; GFX11-NEXT: v_mov_b32_e32 v5, v0
7281 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
7282 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
7283 ; GFX11-NEXT: v_pk_add_f16 v4, v5, v2
7284 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
7285 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], 0 offen glc
7286 ; GFX11-NEXT: s_waitcnt vmcnt(0)
7287 ; GFX11-NEXT: buffer_gl1_inv
7288 ; GFX11-NEXT: buffer_gl0_inv
7289 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
7290 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
7291 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7292 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
7293 ; GFX11-NEXT: s_cbranch_execnz .LBB22_1
7294 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
7295 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
7296 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7298 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7300 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7301 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
7302 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
7303 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
7304 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
7305 ; GFX10-NEXT: s_mov_b32 s4, 0
7306 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
7307 ; GFX10-NEXT: .LBB22_1: ; %atomicrmw.start
7308 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
7309 ; GFX10-NEXT: s_waitcnt vmcnt(0)
7310 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
7311 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
7312 ; GFX10-NEXT: v_pk_add_f16 v4, v5, v2
7313 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
7314 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
7315 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
7316 ; GFX10-NEXT: s_waitcnt vmcnt(0)
7317 ; GFX10-NEXT: buffer_gl1_inv
7318 ; GFX10-NEXT: buffer_gl0_inv
7319 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
7320 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
7321 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
7322 ; GFX10-NEXT: s_cbranch_execnz .LBB22_1
7323 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
7324 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
7325 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7327 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7329 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7330 ; GFX90A-NEXT: v_mov_b32_e32 v2, v0
7331 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
7332 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
7333 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
7334 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
7335 ; GFX90A-NEXT: v_mov_b32_e32 v3, s6
7336 ; GFX90A-NEXT: .LBB22_1: ; %atomicrmw.start
7337 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
7338 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
7339 ; GFX90A-NEXT: v_mov_b32_e32 v5, v0
7340 ; GFX90A-NEXT: v_pk_add_f16 v4, v5, v2
7341 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[4:5], v[4:5] op_sel:[0,1]
7342 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
7343 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
7344 ; GFX90A-NEXT: buffer_wbinvl1
7345 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7346 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7347 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
7348 ; GFX90A-NEXT: s_cbranch_execnz .LBB22_1
7349 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
7350 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
7351 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
7353 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7355 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7356 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
7357 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
7358 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
7359 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
7360 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
7361 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
7362 ; GFX908-NEXT: .LBB22_1: ; %atomicrmw.start
7363 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
7364 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7365 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
7366 ; GFX908-NEXT: v_pk_add_f16 v4, v5, v2
7367 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
7368 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
7369 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
7370 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7371 ; GFX908-NEXT: buffer_wbinvl1
7372 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7373 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7374 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
7375 ; GFX908-NEXT: s_cbranch_execnz .LBB22_1
7376 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
7377 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
7378 ; GFX908-NEXT: s_setpc_b64 s[30:31]
7380 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7382 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7383 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
7384 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
7385 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
7386 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
7387 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
7388 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
7389 ; GFX8-NEXT: .LBB22_1: ; %atomicrmw.start
7390 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
7391 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7392 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
7393 ; 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
7394 ; GFX8-NEXT: v_add_f16_e32 v1, v5, v2
7395 ; GFX8-NEXT: v_or_b32_e32 v4, v1, v0
7396 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
7397 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
7398 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
7399 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7400 ; GFX8-NEXT: buffer_wbinvl1
7401 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7402 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7403 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
7404 ; GFX8-NEXT: s_cbranch_execnz .LBB22_1
7405 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
7406 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
7407 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7409 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7411 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7412 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
7413 ; GFX7-NEXT: buffer_load_dword v3, v2, s[16:19], 0 offen offset:1024
7414 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
7415 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v0
7416 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
7417 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
7418 ; GFX7-NEXT: v_cvt_f32_f16_e32 v2, v1
7419 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7420 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v3
7421 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v3
7422 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1
7423 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v4
7424 ; GFX7-NEXT: v_mov_b32_e32 v4, s6
7425 ; GFX7-NEXT: .LBB22_1: ; %atomicrmw.start
7426 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
7427 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
7428 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
7429 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v1
7430 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v0
7431 ; GFX7-NEXT: v_lshlrev_b32_e32 v1, 16, v1
7432 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v2
7433 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v3
7434 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v5
7435 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v6
7436 ; GFX7-NEXT: v_or_b32_e32 v6, v0, v1
7437 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v5
7438 ; GFX7-NEXT: v_or_b32_e32 v5, v7, v0
7439 ; GFX7-NEXT: v_mov_b32_e32 v8, v6
7440 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
7441 ; GFX7-NEXT: buffer_atomic_cmpswap v[7:8], v4, s[16:19], 0 offen glc
7442 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7443 ; GFX7-NEXT: buffer_wbinvl1
7444 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v7
7445 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v7
7446 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1
7447 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
7448 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7449 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
7450 ; GFX7-NEXT: s_cbranch_execnz .LBB22_1
7451 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
7452 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
7453 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7455 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset:
7457 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7458 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
7459 ; GFX6-NEXT: buffer_load_dword v3, v2, s[16:19], 0 offen offset:1024
7460 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
7461 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v0
7462 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
7463 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
7464 ; GFX6-NEXT: v_cvt_f32_f16_e32 v2, v1
7465 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7466 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v3
7467 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v3
7468 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v1
7469 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v4
7470 ; GFX6-NEXT: v_mov_b32_e32 v4, s6
7471 ; GFX6-NEXT: .LBB22_1: ; %atomicrmw.start
7472 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
7473 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
7474 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
7475 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v1
7476 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v0
7477 ; GFX6-NEXT: v_lshlrev_b32_e32 v1, 16, v1
7478 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v2
7479 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v3
7480 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v5
7481 ; GFX6-NEXT: s_waitcnt expcnt(0)
7482 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v6
7483 ; GFX6-NEXT: v_or_b32_e32 v6, v0, v1
7484 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v5
7485 ; GFX6-NEXT: v_or_b32_e32 v5, v7, v0
7486 ; GFX6-NEXT: v_mov_b32_e32 v8, v6
7487 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
7488 ; GFX6-NEXT: buffer_atomic_cmpswap v[7:8], v4, s[16:19], 0 offen glc
7489 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7490 ; GFX6-NEXT: buffer_wbinvl1
7491 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v7
7492 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v7
7493 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v1
7494 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
7495 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7496 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
7497 ; GFX6-NEXT: s_cbranch_execnz .LBB22_1
7498 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
7499 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
7500 ; GFX6-NEXT: s_waitcnt expcnt(0)
7501 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7502 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
7503 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst
7504 ret <2 x half> %result
7507 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset(ptr addrspace(7) inreg %ptr, <2 x half> %val) {
7508 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7510 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
7511 ; GFX12-NEXT: s_wait_expcnt 0x0
7512 ; GFX12-NEXT: s_wait_samplecnt 0x0
7513 ; GFX12-NEXT: s_wait_bvhcnt 0x0
7514 ; GFX12-NEXT: s_wait_kmcnt 0x0
7515 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
7516 ; GFX12-NEXT: s_wait_storecnt 0x0
7517 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], null offen offset:1024
7518 ; GFX12-NEXT: s_wait_storecnt 0x0
7519 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
7520 ; GFX12-NEXT: s_setpc_b64 s[30:31]
7522 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7524 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7525 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
7526 ; GFX940-NEXT: buffer_wbl2 sc1
7527 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], 0 offen offset:1024
7528 ; GFX940-NEXT: s_waitcnt vmcnt(0)
7529 ; GFX940-NEXT: buffer_inv sc1
7530 ; GFX940-NEXT: s_setpc_b64 s[30:31]
7532 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7534 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7535 ; GFX11-NEXT: v_mov_b32_e32 v1, s16
7536 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
7537 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7538 ; GFX11-NEXT: v_mov_b32_e32 v3, s4
7539 ; GFX11-NEXT: s_mov_b32 s4, 0
7540 ; GFX11-NEXT: buffer_load_b32 v2, v1, s[0:3], 0 offen offset:1024
7541 ; GFX11-NEXT: .LBB23_1: ; %atomicrmw.start
7542 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
7543 ; GFX11-NEXT: s_waitcnt vmcnt(0)
7544 ; GFX11-NEXT: v_pk_add_f16 v1, v2, v0
7545 ; GFX11-NEXT: v_mov_b32_e32 v5, v2
7546 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
7547 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
7548 ; GFX11-NEXT: v_mov_b32_e32 v4, v1
7549 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v3, s[0:3], 0 offen glc
7550 ; GFX11-NEXT: s_waitcnt vmcnt(0)
7551 ; GFX11-NEXT: buffer_gl1_inv
7552 ; GFX11-NEXT: buffer_gl0_inv
7553 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
7554 ; GFX11-NEXT: v_mov_b32_e32 v2, v4
7555 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
7556 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7557 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
7558 ; GFX11-NEXT: s_cbranch_execnz .LBB23_1
7559 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
7560 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
7561 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7563 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7565 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7566 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
7567 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
7568 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
7569 ; GFX10-NEXT: s_mov_b32 s4, 0
7570 ; GFX10-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
7571 ; GFX10-NEXT: .LBB23_1: ; %atomicrmw.start
7572 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
7573 ; GFX10-NEXT: s_waitcnt vmcnt(0)
7574 ; GFX10-NEXT: v_pk_add_f16 v1, v2, v0
7575 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
7576 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
7577 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
7578 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
7579 ; GFX10-NEXT: s_waitcnt vmcnt(0)
7580 ; GFX10-NEXT: buffer_gl1_inv
7581 ; GFX10-NEXT: buffer_gl0_inv
7582 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
7583 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
7584 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
7585 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
7586 ; GFX10-NEXT: s_cbranch_execnz .LBB23_1
7587 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
7588 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
7589 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7591 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7593 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7594 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
7595 ; GFX90A-NEXT: buffer_load_dword v3, v1, s[16:19], 0 offen offset:1024
7596 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
7597 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
7598 ; GFX90A-NEXT: v_mov_b32_e32 v1, s6
7599 ; GFX90A-NEXT: .LBB23_1: ; %atomicrmw.start
7600 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
7601 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
7602 ; GFX90A-NEXT: v_pk_add_f16 v2, v3, v0
7603 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[2:3], v[2:3] op_sel:[0,1]
7604 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[16:19], 0 offen glc
7605 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
7606 ; GFX90A-NEXT: buffer_wbinvl1
7607 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
7608 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7609 ; GFX90A-NEXT: v_mov_b32_e32 v3, v4
7610 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
7611 ; GFX90A-NEXT: s_cbranch_execnz .LBB23_1
7612 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
7613 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
7614 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
7616 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7618 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7619 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
7620 ; GFX908-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
7621 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
7622 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
7623 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
7624 ; GFX908-NEXT: .LBB23_1: ; %atomicrmw.start
7625 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
7626 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7627 ; GFX908-NEXT: v_pk_add_f16 v1, v2, v0
7628 ; GFX908-NEXT: v_mov_b32_e32 v5, v2
7629 ; GFX908-NEXT: v_mov_b32_e32 v4, v1
7630 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
7631 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7632 ; GFX908-NEXT: buffer_wbinvl1
7633 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
7634 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7635 ; GFX908-NEXT: v_mov_b32_e32 v2, v4
7636 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
7637 ; GFX908-NEXT: s_cbranch_execnz .LBB23_1
7638 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
7639 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
7640 ; GFX908-NEXT: s_setpc_b64 s[30:31]
7642 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7644 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7645 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
7646 ; GFX8-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
7647 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
7648 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
7649 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
7650 ; GFX8-NEXT: .LBB23_1: ; %atomicrmw.start
7651 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
7652 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7653 ; 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
7654 ; GFX8-NEXT: v_add_f16_e32 v4, v2, v0
7655 ; GFX8-NEXT: v_or_b32_e32 v1, v4, v1
7656 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
7657 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
7658 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
7659 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7660 ; GFX8-NEXT: buffer_wbinvl1
7661 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
7662 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7663 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
7664 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
7665 ; GFX8-NEXT: s_cbranch_execnz .LBB23_1
7666 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
7667 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
7668 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7670 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7672 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7673 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
7674 ; GFX7-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
7675 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
7676 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v0
7677 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
7678 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
7679 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v1
7680 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7681 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v2
7682 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v2
7683 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v1
7684 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v5
7685 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
7686 ; GFX7-NEXT: .LBB23_1: ; %atomicrmw.start
7687 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
7688 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v4
7689 ; GFX7-NEXT: v_cvt_f16_f32_e32 v3, v3
7690 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v4
7691 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v3
7692 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v4
7693 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
7694 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
7695 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v5
7696 ; GFX7-NEXT: v_cvt_f16_f32_e32 v6, v6
7697 ; GFX7-NEXT: v_or_b32_e32 v5, v3, v4
7698 ; GFX7-NEXT: v_lshlrev_b32_e32 v3, 16, v7
7699 ; GFX7-NEXT: v_or_b32_e32 v4, v6, v3
7700 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
7701 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
7702 ; GFX7-NEXT: buffer_atomic_cmpswap v[6:7], v2, s[16:19], 0 offen glc
7703 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7704 ; GFX7-NEXT: buffer_wbinvl1
7705 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, 16, v6
7706 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v6
7707 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v4
7708 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
7709 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7710 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
7711 ; GFX7-NEXT: s_cbranch_execnz .LBB23_1
7712 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
7713 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
7714 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7716 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset:
7718 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7719 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
7720 ; GFX6-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
7721 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
7722 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v0
7723 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
7724 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
7725 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v1
7726 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7727 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v2
7728 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v2
7729 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v1
7730 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v5
7731 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
7732 ; GFX6-NEXT: .LBB23_1: ; %atomicrmw.start
7733 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
7734 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v4
7735 ; GFX6-NEXT: v_cvt_f16_f32_e32 v3, v3
7736 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v4
7737 ; GFX6-NEXT: s_waitcnt expcnt(0)
7738 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v3
7739 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v4
7740 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
7741 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
7742 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v5
7743 ; GFX6-NEXT: v_cvt_f16_f32_e32 v6, v6
7744 ; GFX6-NEXT: v_or_b32_e32 v5, v3, v4
7745 ; GFX6-NEXT: v_lshlrev_b32_e32 v3, 16, v7
7746 ; GFX6-NEXT: v_or_b32_e32 v4, v6, v3
7747 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
7748 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
7749 ; GFX6-NEXT: buffer_atomic_cmpswap v[6:7], v2, s[16:19], 0 offen glc
7750 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7751 ; GFX6-NEXT: buffer_wbinvl1
7752 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, 16, v6
7753 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v6
7754 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v4
7755 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
7756 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7757 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
7758 ; GFX6-NEXT: s_cbranch_execnz .LBB23_1
7759 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
7760 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
7761 ; GFX6-NEXT: s_waitcnt expcnt(0)
7762 ; GFX6-NEXT: s_setpc_b64 s[30:31]
7763 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
7764 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst
7768 define <2 x half> @buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory(ptr addrspace(7) inreg %ptr, <2 x half> %val) #0 {
7769 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7771 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
7772 ; GFX12-NEXT: s_wait_expcnt 0x0
7773 ; GFX12-NEXT: s_wait_samplecnt 0x0
7774 ; GFX12-NEXT: s_wait_bvhcnt 0x0
7775 ; GFX12-NEXT: s_wait_kmcnt 0x0
7776 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
7777 ; GFX12-NEXT: s_wait_storecnt 0x0
7778 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
7779 ; GFX12-NEXT: s_wait_loadcnt 0x0
7780 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
7781 ; GFX12-NEXT: s_setpc_b64 s[30:31]
7783 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7785 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7786 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
7787 ; GFX940-NEXT: buffer_wbl2 sc1
7788 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], 0 offen offset:1024 sc0
7789 ; GFX940-NEXT: s_waitcnt vmcnt(0)
7790 ; GFX940-NEXT: buffer_inv sc1
7791 ; GFX940-NEXT: s_setpc_b64 s[30:31]
7793 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7795 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7796 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
7797 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7798 ; GFX11-NEXT: v_dual_mov_b32 v2, v0 :: v_dual_mov_b32 v3, s4
7799 ; GFX11-NEXT: v_mov_b32_e32 v0, s16
7800 ; GFX11-NEXT: s_mov_b32 s4, 0
7801 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
7802 ; GFX11-NEXT: .LBB24_1: ; %atomicrmw.start
7803 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
7804 ; GFX11-NEXT: s_waitcnt vmcnt(0)
7805 ; GFX11-NEXT: v_mov_b32_e32 v5, v0
7806 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
7807 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
7808 ; GFX11-NEXT: v_pk_add_f16 v4, v5, v2
7809 ; GFX11-NEXT: v_dual_mov_b32 v0, v4 :: v_dual_mov_b32 v1, v5
7810 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v3, s[0:3], 0 offen glc
7811 ; GFX11-NEXT: s_waitcnt vmcnt(0)
7812 ; GFX11-NEXT: buffer_gl1_inv
7813 ; GFX11-NEXT: buffer_gl0_inv
7814 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
7815 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
7816 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
7817 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
7818 ; GFX11-NEXT: s_cbranch_execnz .LBB24_1
7819 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
7820 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
7821 ; GFX11-NEXT: s_setpc_b64 s[30:31]
7823 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7825 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7826 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
7827 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
7828 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
7829 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
7830 ; GFX10-NEXT: s_mov_b32 s4, 0
7831 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
7832 ; GFX10-NEXT: .LBB24_1: ; %atomicrmw.start
7833 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
7834 ; GFX10-NEXT: s_waitcnt vmcnt(0)
7835 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
7836 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
7837 ; GFX10-NEXT: v_pk_add_f16 v4, v5, v2
7838 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
7839 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
7840 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
7841 ; GFX10-NEXT: s_waitcnt vmcnt(0)
7842 ; GFX10-NEXT: buffer_gl1_inv
7843 ; GFX10-NEXT: buffer_gl0_inv
7844 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
7845 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
7846 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
7847 ; GFX10-NEXT: s_cbranch_execnz .LBB24_1
7848 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
7849 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
7850 ; GFX10-NEXT: s_setpc_b64 s[30:31]
7852 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7854 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7855 ; GFX90A-NEXT: v_mov_b32_e32 v2, v0
7856 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
7857 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
7858 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
7859 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
7860 ; GFX90A-NEXT: v_mov_b32_e32 v3, s6
7861 ; GFX90A-NEXT: .LBB24_1: ; %atomicrmw.start
7862 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
7863 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
7864 ; GFX90A-NEXT: v_mov_b32_e32 v5, v0
7865 ; GFX90A-NEXT: v_pk_add_f16 v4, v5, v2
7866 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[4:5], v[4:5] op_sel:[0,1]
7867 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
7868 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
7869 ; GFX90A-NEXT: buffer_wbinvl1
7870 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7871 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7872 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
7873 ; GFX90A-NEXT: s_cbranch_execnz .LBB24_1
7874 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
7875 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
7876 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
7878 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7880 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7881 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
7882 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
7883 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
7884 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
7885 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
7886 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
7887 ; GFX908-NEXT: .LBB24_1: ; %atomicrmw.start
7888 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
7889 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7890 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
7891 ; GFX908-NEXT: v_pk_add_f16 v4, v5, v2
7892 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
7893 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
7894 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
7895 ; GFX908-NEXT: s_waitcnt vmcnt(0)
7896 ; GFX908-NEXT: buffer_wbinvl1
7897 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7898 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7899 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
7900 ; GFX908-NEXT: s_cbranch_execnz .LBB24_1
7901 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
7902 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
7903 ; GFX908-NEXT: s_setpc_b64 s[30:31]
7905 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7907 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7908 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
7909 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
7910 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
7911 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
7912 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
7913 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
7914 ; GFX8-NEXT: .LBB24_1: ; %atomicrmw.start
7915 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
7916 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7917 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
7918 ; 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
7919 ; GFX8-NEXT: v_add_f16_e32 v1, v5, v2
7920 ; GFX8-NEXT: v_or_b32_e32 v4, v1, v0
7921 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
7922 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
7923 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
7924 ; GFX8-NEXT: s_waitcnt vmcnt(0)
7925 ; GFX8-NEXT: buffer_wbinvl1
7926 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
7927 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7928 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
7929 ; GFX8-NEXT: s_cbranch_execnz .LBB24_1
7930 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
7931 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
7932 ; GFX8-NEXT: s_setpc_b64 s[30:31]
7934 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7936 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7937 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
7938 ; GFX7-NEXT: buffer_load_dword v3, v2, s[16:19], 0 offen offset:1024
7939 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
7940 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v0
7941 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
7942 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
7943 ; GFX7-NEXT: v_cvt_f32_f16_e32 v2, v1
7944 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7945 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v3
7946 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v3
7947 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1
7948 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v4
7949 ; GFX7-NEXT: v_mov_b32_e32 v4, s6
7950 ; GFX7-NEXT: .LBB24_1: ; %atomicrmw.start
7951 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
7952 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
7953 ; GFX7-NEXT: v_cvt_f16_f32_e32 v0, v0
7954 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v1
7955 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v0
7956 ; GFX7-NEXT: v_lshlrev_b32_e32 v1, 16, v1
7957 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v2
7958 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v3
7959 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v5
7960 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v6
7961 ; GFX7-NEXT: v_or_b32_e32 v6, v0, v1
7962 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v5
7963 ; GFX7-NEXT: v_or_b32_e32 v5, v7, v0
7964 ; GFX7-NEXT: v_mov_b32_e32 v8, v6
7965 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
7966 ; GFX7-NEXT: buffer_atomic_cmpswap v[7:8], v4, s[16:19], 0 offen glc
7967 ; GFX7-NEXT: s_waitcnt vmcnt(0)
7968 ; GFX7-NEXT: buffer_wbinvl1
7969 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v7
7970 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v7
7971 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1
7972 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
7973 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
7974 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
7975 ; GFX7-NEXT: s_cbranch_execnz .LBB24_1
7976 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
7977 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
7978 ; GFX7-NEXT: s_setpc_b64 s[30:31]
7980 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2f16__offset__amdgpu_no_remote_memory:
7982 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
7983 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
7984 ; GFX6-NEXT: buffer_load_dword v3, v2, s[16:19], 0 offen offset:1024
7985 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
7986 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v0
7987 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
7988 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
7989 ; GFX6-NEXT: v_cvt_f32_f16_e32 v2, v1
7990 ; GFX6-NEXT: s_waitcnt vmcnt(0)
7991 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v3
7992 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v3
7993 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v1
7994 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v4
7995 ; GFX6-NEXT: v_mov_b32_e32 v4, s6
7996 ; GFX6-NEXT: .LBB24_1: ; %atomicrmw.start
7997 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
7998 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
7999 ; GFX6-NEXT: v_cvt_f16_f32_e32 v0, v0
8000 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v1
8001 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v0
8002 ; GFX6-NEXT: v_lshlrev_b32_e32 v1, 16, v1
8003 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v2
8004 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v3
8005 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v5
8006 ; GFX6-NEXT: s_waitcnt expcnt(0)
8007 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v6
8008 ; GFX6-NEXT: v_or_b32_e32 v6, v0, v1
8009 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v5
8010 ; GFX6-NEXT: v_or_b32_e32 v5, v7, v0
8011 ; GFX6-NEXT: v_mov_b32_e32 v8, v6
8012 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
8013 ; GFX6-NEXT: buffer_atomic_cmpswap v[7:8], v4, s[16:19], 0 offen glc
8014 ; GFX6-NEXT: s_waitcnt vmcnt(0)
8015 ; GFX6-NEXT: buffer_wbinvl1
8016 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v7
8017 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v7
8018 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v1
8019 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v7, v6
8020 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8021 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
8022 ; GFX6-NEXT: s_cbranch_execnz .LBB24_1
8023 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
8024 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
8025 ; GFX6-NEXT: s_waitcnt expcnt(0)
8026 ; GFX6-NEXT: s_setpc_b64 s[30:31]
8027 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
8028 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst, !amdgpu.no.remote.memory !0
8029 ret <2 x half> %result
8032 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory(ptr addrspace(7) inreg %ptr, <2 x half> %val) #0 {
8033 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8035 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
8036 ; GFX12-NEXT: s_wait_expcnt 0x0
8037 ; GFX12-NEXT: s_wait_samplecnt 0x0
8038 ; GFX12-NEXT: s_wait_bvhcnt 0x0
8039 ; GFX12-NEXT: s_wait_kmcnt 0x0
8040 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
8041 ; GFX12-NEXT: s_wait_storecnt 0x0
8042 ; GFX12-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], null offen offset:1024
8043 ; GFX12-NEXT: s_wait_storecnt 0x0
8044 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
8045 ; GFX12-NEXT: s_setpc_b64 s[30:31]
8047 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8049 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8050 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
8051 ; GFX940-NEXT: buffer_wbl2 sc1
8052 ; GFX940-NEXT: buffer_atomic_pk_add_f16 v0, v1, s[0:3], 0 offen offset:1024
8053 ; GFX940-NEXT: s_waitcnt vmcnt(0)
8054 ; GFX940-NEXT: buffer_inv sc1
8055 ; GFX940-NEXT: s_setpc_b64 s[30:31]
8057 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8059 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8060 ; GFX11-NEXT: v_mov_b32_e32 v1, s16
8061 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
8062 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
8063 ; GFX11-NEXT: v_mov_b32_e32 v3, s4
8064 ; GFX11-NEXT: s_mov_b32 s4, 0
8065 ; GFX11-NEXT: buffer_load_b32 v2, v1, s[0:3], 0 offen offset:1024
8066 ; GFX11-NEXT: .LBB25_1: ; %atomicrmw.start
8067 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
8068 ; GFX11-NEXT: s_waitcnt vmcnt(0)
8069 ; GFX11-NEXT: v_pk_add_f16 v1, v2, v0
8070 ; GFX11-NEXT: v_mov_b32_e32 v5, v2
8071 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
8072 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
8073 ; GFX11-NEXT: v_mov_b32_e32 v4, v1
8074 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v3, s[0:3], 0 offen glc
8075 ; GFX11-NEXT: s_waitcnt vmcnt(0)
8076 ; GFX11-NEXT: buffer_gl1_inv
8077 ; GFX11-NEXT: buffer_gl0_inv
8078 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
8079 ; GFX11-NEXT: v_mov_b32_e32 v2, v4
8080 ; GFX11-NEXT: s_or_b32 s4, vcc_lo, s4
8081 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
8082 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s4
8083 ; GFX11-NEXT: s_cbranch_execnz .LBB25_1
8084 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
8085 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s4
8086 ; GFX11-NEXT: s_setpc_b64 s[30:31]
8088 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8090 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8091 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
8092 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
8093 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
8094 ; GFX10-NEXT: s_mov_b32 s4, 0
8095 ; GFX10-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
8096 ; GFX10-NEXT: .LBB25_1: ; %atomicrmw.start
8097 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
8098 ; GFX10-NEXT: s_waitcnt vmcnt(0)
8099 ; GFX10-NEXT: v_pk_add_f16 v1, v2, v0
8100 ; GFX10-NEXT: v_mov_b32_e32 v5, v2
8101 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
8102 ; GFX10-NEXT: v_mov_b32_e32 v4, v1
8103 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
8104 ; GFX10-NEXT: s_waitcnt vmcnt(0)
8105 ; GFX10-NEXT: buffer_gl1_inv
8106 ; GFX10-NEXT: buffer_gl0_inv
8107 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v2
8108 ; GFX10-NEXT: v_mov_b32_e32 v2, v4
8109 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
8110 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
8111 ; GFX10-NEXT: s_cbranch_execnz .LBB25_1
8112 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
8113 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
8114 ; GFX10-NEXT: s_setpc_b64 s[30:31]
8116 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8118 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8119 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
8120 ; GFX90A-NEXT: buffer_load_dword v3, v1, s[16:19], 0 offen offset:1024
8121 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
8122 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
8123 ; GFX90A-NEXT: v_mov_b32_e32 v1, s6
8124 ; GFX90A-NEXT: .LBB25_1: ; %atomicrmw.start
8125 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
8126 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
8127 ; GFX90A-NEXT: v_pk_add_f16 v2, v3, v0
8128 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[2:3], v[2:3] op_sel:[0,1]
8129 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v1, s[16:19], 0 offen glc
8130 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
8131 ; GFX90A-NEXT: buffer_wbinvl1
8132 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v3
8133 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8134 ; GFX90A-NEXT: v_mov_b32_e32 v3, v4
8135 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
8136 ; GFX90A-NEXT: s_cbranch_execnz .LBB25_1
8137 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
8138 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
8139 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
8141 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8143 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8144 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
8145 ; GFX908-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
8146 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
8147 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
8148 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
8149 ; GFX908-NEXT: .LBB25_1: ; %atomicrmw.start
8150 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
8151 ; GFX908-NEXT: s_waitcnt vmcnt(0)
8152 ; GFX908-NEXT: v_pk_add_f16 v1, v2, v0
8153 ; GFX908-NEXT: v_mov_b32_e32 v5, v2
8154 ; GFX908-NEXT: v_mov_b32_e32 v4, v1
8155 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
8156 ; GFX908-NEXT: s_waitcnt vmcnt(0)
8157 ; GFX908-NEXT: buffer_wbinvl1
8158 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
8159 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8160 ; GFX908-NEXT: v_mov_b32_e32 v2, v4
8161 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
8162 ; GFX908-NEXT: s_cbranch_execnz .LBB25_1
8163 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
8164 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
8165 ; GFX908-NEXT: s_setpc_b64 s[30:31]
8167 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8169 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8170 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
8171 ; GFX8-NEXT: buffer_load_dword v2, v1, s[16:19], 0 offen offset:1024
8172 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
8173 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
8174 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
8175 ; GFX8-NEXT: .LBB25_1: ; %atomicrmw.start
8176 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
8177 ; GFX8-NEXT: s_waitcnt vmcnt(0)
8178 ; 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
8179 ; GFX8-NEXT: v_add_f16_e32 v4, v2, v0
8180 ; GFX8-NEXT: v_or_b32_e32 v1, v4, v1
8181 ; GFX8-NEXT: v_mov_b32_e32 v5, v2
8182 ; GFX8-NEXT: v_mov_b32_e32 v4, v1
8183 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v3, s[16:19], 0 offen glc
8184 ; GFX8-NEXT: s_waitcnt vmcnt(0)
8185 ; GFX8-NEXT: buffer_wbinvl1
8186 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v2
8187 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8188 ; GFX8-NEXT: v_mov_b32_e32 v2, v4
8189 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
8190 ; GFX8-NEXT: s_cbranch_execnz .LBB25_1
8191 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
8192 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
8193 ; GFX8-NEXT: s_setpc_b64 s[30:31]
8195 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8197 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8198 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
8199 ; GFX7-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
8200 ; GFX7-NEXT: v_cvt_f16_f32_e32 v1, v1
8201 ; GFX7-NEXT: v_cvt_f16_f32_e32 v5, v0
8202 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
8203 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
8204 ; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v1
8205 ; GFX7-NEXT: s_waitcnt vmcnt(0)
8206 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v2
8207 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v2
8208 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v1
8209 ; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v5
8210 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
8211 ; GFX7-NEXT: .LBB25_1: ; %atomicrmw.start
8212 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
8213 ; GFX7-NEXT: v_cvt_f16_f32_e32 v4, v4
8214 ; GFX7-NEXT: v_cvt_f16_f32_e32 v3, v3
8215 ; GFX7-NEXT: v_cvt_f32_f16_e32 v5, v4
8216 ; GFX7-NEXT: v_cvt_f32_f16_e32 v6, v3
8217 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v4
8218 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
8219 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
8220 ; GFX7-NEXT: v_cvt_f16_f32_e32 v7, v5
8221 ; GFX7-NEXT: v_cvt_f16_f32_e32 v6, v6
8222 ; GFX7-NEXT: v_or_b32_e32 v5, v3, v4
8223 ; GFX7-NEXT: v_lshlrev_b32_e32 v3, 16, v7
8224 ; GFX7-NEXT: v_or_b32_e32 v4, v6, v3
8225 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
8226 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
8227 ; GFX7-NEXT: buffer_atomic_cmpswap v[6:7], v2, s[16:19], 0 offen glc
8228 ; GFX7-NEXT: s_waitcnt vmcnt(0)
8229 ; GFX7-NEXT: buffer_wbinvl1
8230 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, 16, v6
8231 ; GFX7-NEXT: v_cvt_f32_f16_e32 v3, v6
8232 ; GFX7-NEXT: v_cvt_f32_f16_e32 v4, v4
8233 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
8234 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8235 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
8236 ; GFX7-NEXT: s_cbranch_execnz .LBB25_1
8237 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
8238 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
8239 ; GFX7-NEXT: s_setpc_b64 s[30:31]
8241 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2f16__offset__amdgpu_no_remote_memory:
8243 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8244 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
8245 ; GFX6-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
8246 ; GFX6-NEXT: v_cvt_f16_f32_e32 v1, v1
8247 ; GFX6-NEXT: v_cvt_f16_f32_e32 v5, v0
8248 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
8249 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
8250 ; GFX6-NEXT: v_cvt_f32_f16_e32 v0, v1
8251 ; GFX6-NEXT: s_waitcnt vmcnt(0)
8252 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v2
8253 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v2
8254 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v1
8255 ; GFX6-NEXT: v_cvt_f32_f16_e32 v1, v5
8256 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
8257 ; GFX6-NEXT: .LBB25_1: ; %atomicrmw.start
8258 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
8259 ; GFX6-NEXT: v_cvt_f16_f32_e32 v4, v4
8260 ; GFX6-NEXT: v_cvt_f16_f32_e32 v3, v3
8261 ; GFX6-NEXT: v_cvt_f32_f16_e32 v5, v4
8262 ; GFX6-NEXT: s_waitcnt expcnt(0)
8263 ; GFX6-NEXT: v_cvt_f32_f16_e32 v6, v3
8264 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v4
8265 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
8266 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
8267 ; GFX6-NEXT: v_cvt_f16_f32_e32 v7, v5
8268 ; GFX6-NEXT: v_cvt_f16_f32_e32 v6, v6
8269 ; GFX6-NEXT: v_or_b32_e32 v5, v3, v4
8270 ; GFX6-NEXT: v_lshlrev_b32_e32 v3, 16, v7
8271 ; GFX6-NEXT: v_or_b32_e32 v4, v6, v3
8272 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
8273 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
8274 ; GFX6-NEXT: buffer_atomic_cmpswap v[6:7], v2, s[16:19], 0 offen glc
8275 ; GFX6-NEXT: s_waitcnt vmcnt(0)
8276 ; GFX6-NEXT: buffer_wbinvl1
8277 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, 16, v6
8278 ; GFX6-NEXT: v_cvt_f32_f16_e32 v3, v6
8279 ; GFX6-NEXT: v_cvt_f32_f16_e32 v4, v4
8280 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
8281 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8282 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
8283 ; GFX6-NEXT: s_cbranch_execnz .LBB25_1
8284 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
8285 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
8286 ; GFX6-NEXT: s_waitcnt expcnt(0)
8287 ; GFX6-NEXT: s_setpc_b64 s[30:31]
8288 %gep = getelementptr <2 x half>, ptr addrspace(7) %ptr, i32 256
8289 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x half> %val syncscope("agent") seq_cst, !amdgpu.no.remote.memory !0
8293 ; --------------------------------------------------------------------
8295 ; --------------------------------------------------------------------
8297 define <2 x bfloat> @buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) #0 {
8298 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8300 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
8301 ; GFX12-NEXT: s_wait_expcnt 0x0
8302 ; GFX12-NEXT: s_wait_samplecnt 0x0
8303 ; GFX12-NEXT: s_wait_bvhcnt 0x0
8304 ; GFX12-NEXT: s_wait_kmcnt 0x0
8305 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
8306 ; GFX12-NEXT: s_wait_storecnt 0x0
8307 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
8308 ; GFX12-NEXT: s_wait_loadcnt 0x0
8309 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
8310 ; GFX12-NEXT: s_setpc_b64 s[30:31]
8312 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8314 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8315 ; GFX940-NEXT: v_mov_b32_e32 v1, v0
8316 ; GFX940-NEXT: v_mov_b32_e32 v0, s16
8317 ; GFX940-NEXT: buffer_load_dword v0, v0, s[0:3], 0 offen offset:1024
8318 ; GFX940-NEXT: s_add_i32 s4, s16, 0x400
8319 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
8320 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v1
8321 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
8322 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
8323 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
8324 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
8325 ; GFX940-NEXT: .LBB26_1: ; %atomicrmw.start
8326 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
8327 ; GFX940-NEXT: s_waitcnt vmcnt(0)
8328 ; GFX940-NEXT: v_mov_b32_e32 v7, v0
8329 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v7
8330 ; GFX940-NEXT: v_and_b32_e32 v1, 0xffff0000, v7
8331 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
8332 ; GFX940-NEXT: v_add_f32_e32 v1, v1, v3
8333 ; GFX940-NEXT: v_bfe_u32 v5, v0, 16, 1
8334 ; GFX940-NEXT: v_bfe_u32 v8, v1, 16, 1
8335 ; GFX940-NEXT: v_or_b32_e32 v6, 0x400000, v0
8336 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v1
8337 ; GFX940-NEXT: v_add3_u32 v5, v5, v0, s8
8338 ; GFX940-NEXT: v_add3_u32 v8, v8, v1, s8
8339 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
8340 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
8341 ; GFX940-NEXT: buffer_wbl2 sc1
8342 ; GFX940-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
8343 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v5, v6, s[4:5]
8344 ; GFX940-NEXT: v_perm_b32 v6, v1, v0, s9
8345 ; GFX940-NEXT: v_mov_b64_e32 v[0:1], v[6:7]
8346 ; GFX940-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[0:3], 0 offen sc0
8347 ; GFX940-NEXT: s_waitcnt vmcnt(0)
8348 ; GFX940-NEXT: buffer_inv sc1
8349 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v0, v7
8350 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
8351 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
8352 ; GFX940-NEXT: s_cbranch_execnz .LBB26_1
8353 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
8354 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
8355 ; GFX940-NEXT: s_setpc_b64 s[30:31]
8357 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8359 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8360 ; GFX11-NEXT: v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v0, s16
8361 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
8362 ; GFX11-NEXT: s_mov_b32 s5, 0
8363 ; GFX11-NEXT: v_mov_b32_e32 v4, s4
8364 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
8365 ; GFX11-NEXT: v_lshlrev_b32_e32 v2, 16, v1
8366 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
8367 ; GFX11-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
8368 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
8369 ; GFX11-NEXT: .p2align 6
8370 ; GFX11-NEXT: .LBB26_1: ; %atomicrmw.start
8371 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
8372 ; GFX11-NEXT: s_waitcnt vmcnt(0)
8373 ; GFX11-NEXT: v_mov_b32_e32 v6, v0
8374 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
8375 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
8376 ; GFX11-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
8377 ; GFX11-NEXT: v_add_f32_e32 v1, v1, v3
8378 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
8379 ; GFX11-NEXT: v_bfe_u32 v7, v1, 16, 1
8380 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v1
8381 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
8382 ; GFX11-NEXT: v_add3_u32 v7, v7, v1, 0x7fff
8383 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
8384 ; GFX11-NEXT: v_dual_cndmask_b32 v1, v7, v9 :: v_dual_lshlrev_b32 v0, 16, v6
8385 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
8386 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
8387 ; GFX11-NEXT: v_bfe_u32 v5, v0, 16, 1
8388 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
8389 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
8390 ; GFX11-NEXT: v_add3_u32 v5, v5, v0, 0x7fff
8391 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
8392 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v5, v8, s4
8393 ; GFX11-NEXT: v_perm_b32 v5, v1, v0, 0x7060302
8394 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
8395 ; GFX11-NEXT: v_dual_mov_b32 v0, v5 :: v_dual_mov_b32 v1, v6
8396 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v4, s[0:3], 0 offen glc
8397 ; GFX11-NEXT: s_waitcnt vmcnt(0)
8398 ; GFX11-NEXT: buffer_gl1_inv
8399 ; GFX11-NEXT: buffer_gl0_inv
8400 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v6
8401 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
8402 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
8403 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
8404 ; GFX11-NEXT: s_cbranch_execnz .LBB26_1
8405 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
8406 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
8407 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
8408 ; GFX11-NEXT: s_setpc_b64 s[30:31]
8410 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8412 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8413 ; GFX10-NEXT: v_mov_b32_e32 v1, v0
8414 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
8415 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
8416 ; GFX10-NEXT: s_mov_b32 s5, 0
8417 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
8418 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v1
8419 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
8420 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
8421 ; GFX10-NEXT: .LBB26_1: ; %atomicrmw.start
8422 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
8423 ; GFX10-NEXT: s_waitcnt vmcnt(0)
8424 ; GFX10-NEXT: v_mov_b32_e32 v6, v0
8425 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
8426 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v6
8427 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
8428 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
8429 ; GFX10-NEXT: v_add_f32_e32 v1, v1, v3
8430 ; GFX10-NEXT: v_bfe_u32 v5, v0, 16, 1
8431 ; GFX10-NEXT: v_bfe_u32 v7, v1, 16, 1
8432 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
8433 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v1
8434 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
8435 ; GFX10-NEXT: v_add3_u32 v5, v5, v0, 0x7fff
8436 ; GFX10-NEXT: v_add3_u32 v7, v7, v1, 0x7fff
8437 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
8438 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v7, v9, vcc_lo
8439 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v5, v8, s4
8440 ; GFX10-NEXT: v_perm_b32 v5, v1, v0, 0x7060302
8441 ; GFX10-NEXT: v_mov_b32_e32 v0, v5
8442 ; GFX10-NEXT: v_mov_b32_e32 v1, v6
8443 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
8444 ; GFX10-NEXT: s_waitcnt vmcnt(0)
8445 ; GFX10-NEXT: buffer_gl1_inv
8446 ; GFX10-NEXT: buffer_gl0_inv
8447 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v6
8448 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
8449 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
8450 ; GFX10-NEXT: s_cbranch_execnz .LBB26_1
8451 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
8452 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
8453 ; GFX10-NEXT: s_setpc_b64 s[30:31]
8455 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8457 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8458 ; GFX90A-NEXT: v_mov_b32_e32 v1, v0
8459 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
8460 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
8461 ; GFX90A-NEXT: s_add_i32 s4, s20, 0x400
8462 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
8463 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v1
8464 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
8465 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
8466 ; GFX90A-NEXT: s_mov_b32 s9, 0x7060302
8467 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
8468 ; GFX90A-NEXT: .LBB26_1: ; %atomicrmw.start
8469 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
8470 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
8471 ; GFX90A-NEXT: v_mov_b32_e32 v7, v0
8472 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v7
8473 ; GFX90A-NEXT: v_and_b32_e32 v1, 0xffff0000, v7
8474 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
8475 ; GFX90A-NEXT: v_add_f32_e32 v1, v1, v3
8476 ; GFX90A-NEXT: v_bfe_u32 v5, v0, 16, 1
8477 ; GFX90A-NEXT: v_bfe_u32 v8, v1, 16, 1
8478 ; GFX90A-NEXT: v_or_b32_e32 v6, 0x400000, v0
8479 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v1
8480 ; GFX90A-NEXT: v_add3_u32 v5, v5, v0, s8
8481 ; GFX90A-NEXT: v_add3_u32 v8, v8, v1, s8
8482 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
8483 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
8484 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v5, v6, s[4:5]
8485 ; GFX90A-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
8486 ; GFX90A-NEXT: v_perm_b32 v6, v1, v0, s9
8487 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[6:7], v[6:7] op_sel:[0,1]
8488 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
8489 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
8490 ; GFX90A-NEXT: buffer_wbinvl1
8491 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v7
8492 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
8493 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
8494 ; GFX90A-NEXT: s_cbranch_execnz .LBB26_1
8495 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
8496 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
8497 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
8499 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8501 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8502 ; GFX908-NEXT: v_mov_b32_e32 v1, v0
8503 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
8504 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
8505 ; GFX908-NEXT: s_add_i32 s4, s20, 0x400
8506 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
8507 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v1
8508 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
8509 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
8510 ; GFX908-NEXT: s_mov_b32 s9, 0x7060302
8511 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
8512 ; GFX908-NEXT: .LBB26_1: ; %atomicrmw.start
8513 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
8514 ; GFX908-NEXT: s_waitcnt vmcnt(0)
8515 ; GFX908-NEXT: v_mov_b32_e32 v6, v0
8516 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v6
8517 ; GFX908-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
8518 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
8519 ; GFX908-NEXT: v_add_f32_e32 v1, v1, v3
8520 ; GFX908-NEXT: v_bfe_u32 v5, v0, 16, 1
8521 ; GFX908-NEXT: v_bfe_u32 v8, v1, 16, 1
8522 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
8523 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v1
8524 ; GFX908-NEXT: v_add3_u32 v5, v5, v0, s8
8525 ; GFX908-NEXT: v_add3_u32 v8, v8, v1, s8
8526 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
8527 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
8528 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v5, v7, s[4:5]
8529 ; GFX908-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
8530 ; GFX908-NEXT: v_perm_b32 v5, v1, v0, s9
8531 ; GFX908-NEXT: v_mov_b32_e32 v0, v5
8532 ; GFX908-NEXT: v_mov_b32_e32 v1, v6
8533 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
8534 ; GFX908-NEXT: s_waitcnt vmcnt(0)
8535 ; GFX908-NEXT: buffer_wbinvl1
8536 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v6
8537 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
8538 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
8539 ; GFX908-NEXT: s_cbranch_execnz .LBB26_1
8540 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
8541 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
8542 ; GFX908-NEXT: s_setpc_b64 s[30:31]
8544 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8546 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8547 ; GFX8-NEXT: v_mov_b32_e32 v1, v0
8548 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
8549 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
8550 ; GFX8-NEXT: s_add_i32 s4, s20, 0x400
8551 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
8552 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v1
8553 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
8554 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
8555 ; GFX8-NEXT: .LBB26_1: ; %atomicrmw.start
8556 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
8557 ; GFX8-NEXT: s_waitcnt vmcnt(0)
8558 ; GFX8-NEXT: v_mov_b32_e32 v6, v0
8559 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v6
8560 ; GFX8-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
8561 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
8562 ; GFX8-NEXT: v_add_f32_e32 v1, v1, v3
8563 ; GFX8-NEXT: v_bfe_u32 v5, v0, 16, 1
8564 ; GFX8-NEXT: v_bfe_u32 v8, v1, 16, 1
8565 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, v5, v0
8566 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v1
8567 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, 0x7fff, v5
8568 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
8569 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v1
8570 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
8571 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
8572 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
8573 ; GFX8-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
8574 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v5, v7, s[4:5]
8575 ; GFX8-NEXT: v_lshrrev_b32_e32 v1, 16, v1
8576 ; GFX8-NEXT: v_alignbit_b32 v5, v1, v0, 16
8577 ; GFX8-NEXT: v_mov_b32_e32 v0, v5
8578 ; GFX8-NEXT: v_mov_b32_e32 v1, v6
8579 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
8580 ; GFX8-NEXT: s_waitcnt vmcnt(0)
8581 ; GFX8-NEXT: buffer_wbinvl1
8582 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v6
8583 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
8584 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
8585 ; GFX8-NEXT: s_cbranch_execnz .LBB26_1
8586 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
8587 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
8588 ; GFX8-NEXT: s_setpc_b64 s[30:31]
8590 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8592 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8593 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
8594 ; GFX7-NEXT: buffer_load_dword v4, v2, s[16:19], 0 offen offset:1024
8595 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
8596 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
8597 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
8598 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
8599 ; GFX7-NEXT: v_and_b32_e32 v2, 0xffff0000, v0
8600 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
8601 ; GFX7-NEXT: s_waitcnt vmcnt(0)
8602 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v4
8603 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v4
8604 ; GFX7-NEXT: v_mov_b32_e32 v4, s6
8605 ; GFX7-NEXT: .LBB26_1: ; %atomicrmw.start
8606 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
8607 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
8608 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
8609 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v1
8610 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
8611 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
8612 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v3
8613 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v2
8614 ; GFX7-NEXT: v_alignbit_b32 v1, v1, v0, 16
8615 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v6
8616 ; GFX7-NEXT: v_alignbit_b32 v0, v0, v5, 16
8617 ; GFX7-NEXT: v_mov_b32_e32 v6, v1
8618 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
8619 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
8620 ; GFX7-NEXT: s_waitcnt vmcnt(0)
8621 ; GFX7-NEXT: buffer_wbinvl1
8622 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
8623 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v5
8624 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8625 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v5
8626 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
8627 ; GFX7-NEXT: s_cbranch_execnz .LBB26_1
8628 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
8629 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
8630 ; GFX7-NEXT: s_setpc_b64 s[30:31]
8632 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8634 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8635 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
8636 ; GFX6-NEXT: buffer_load_dword v4, v2, s[16:19], 0 offen offset:1024
8637 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
8638 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
8639 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
8640 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
8641 ; GFX6-NEXT: v_and_b32_e32 v2, 0xffff0000, v0
8642 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
8643 ; GFX6-NEXT: s_waitcnt vmcnt(0)
8644 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v4
8645 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v4
8646 ; GFX6-NEXT: v_mov_b32_e32 v4, s6
8647 ; GFX6-NEXT: .LBB26_1: ; %atomicrmw.start
8648 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
8649 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
8650 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
8651 ; GFX6-NEXT: s_waitcnt expcnt(0)
8652 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v1
8653 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
8654 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v1
8655 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v3
8656 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v2
8657 ; GFX6-NEXT: v_alignbit_b32 v1, v1, v0, 16
8658 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, 16, v6
8659 ; GFX6-NEXT: v_alignbit_b32 v0, v0, v5, 16
8660 ; GFX6-NEXT: v_mov_b32_e32 v6, v1
8661 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
8662 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
8663 ; GFX6-NEXT: s_waitcnt vmcnt(0)
8664 ; GFX6-NEXT: buffer_wbinvl1
8665 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
8666 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v5
8667 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8668 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v5
8669 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
8670 ; GFX6-NEXT: s_cbranch_execnz .LBB26_1
8671 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
8672 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
8673 ; GFX6-NEXT: s_waitcnt expcnt(0)
8674 ; GFX6-NEXT: s_setpc_b64 s[30:31]
8675 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
8676 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
8677 ret <2 x bfloat> %result
8680 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) #0 {
8681 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8683 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
8684 ; GFX12-NEXT: s_wait_expcnt 0x0
8685 ; GFX12-NEXT: s_wait_samplecnt 0x0
8686 ; GFX12-NEXT: s_wait_bvhcnt 0x0
8687 ; GFX12-NEXT: s_wait_kmcnt 0x0
8688 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
8689 ; GFX12-NEXT: s_wait_storecnt 0x0
8690 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024
8691 ; GFX12-NEXT: s_wait_storecnt 0x0
8692 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
8693 ; GFX12-NEXT: s_setpc_b64 s[30:31]
8695 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8697 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8698 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
8699 ; GFX940-NEXT: buffer_load_dword v1, v1, s[0:3], 0 offen offset:1024
8700 ; GFX940-NEXT: s_add_i32 s4, s16, 0x400
8701 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
8702 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v0
8703 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
8704 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
8705 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
8706 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
8707 ; GFX940-NEXT: .LBB27_1: ; %atomicrmw.start
8708 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
8709 ; GFX940-NEXT: s_waitcnt vmcnt(0)
8710 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v1
8711 ; GFX940-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
8712 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
8713 ; GFX940-NEXT: v_add_f32_e32 v5, v5, v3
8714 ; GFX940-NEXT: v_bfe_u32 v6, v0, 16, 1
8715 ; GFX940-NEXT: v_bfe_u32 v8, v5, 16, 1
8716 ; GFX940-NEXT: v_or_b32_e32 v7, 0x400000, v0
8717 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v5
8718 ; GFX940-NEXT: v_add3_u32 v6, v6, v0, s8
8719 ; GFX940-NEXT: v_add3_u32 v8, v8, v5, s8
8720 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
8721 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
8722 ; GFX940-NEXT: buffer_wbl2 sc1
8723 ; GFX940-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
8724 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
8725 ; GFX940-NEXT: v_perm_b32 v0, v5, v0, s9
8726 ; GFX940-NEXT: v_mov_b64_e32 v[6:7], v[0:1]
8727 ; GFX940-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[0:3], 0 offen sc0
8728 ; GFX940-NEXT: s_waitcnt vmcnt(0)
8729 ; GFX940-NEXT: buffer_inv sc1
8730 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
8731 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
8732 ; GFX940-NEXT: v_mov_b32_e32 v1, v6
8733 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
8734 ; GFX940-NEXT: s_cbranch_execnz .LBB27_1
8735 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
8736 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
8737 ; GFX940-NEXT: s_setpc_b64 s[30:31]
8739 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8741 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8742 ; GFX11-NEXT: v_dual_mov_b32 v1, s16 :: v_dual_lshlrev_b32 v2, 16, v0
8743 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
8744 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
8745 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_and_b32 v3, 0xffff0000, v0
8746 ; GFX11-NEXT: buffer_load_b32 v1, v1, s[0:3], 0 offen offset:1024
8747 ; GFX11-NEXT: s_mov_b32 s5, 0
8748 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
8749 ; GFX11-NEXT: .p2align 6
8750 ; GFX11-NEXT: .LBB27_1: ; %atomicrmw.start
8751 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
8752 ; GFX11-NEXT: s_waitcnt vmcnt(0)
8753 ; GFX11-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
8754 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v1
8755 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
8756 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
8757 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v3 :: v_dual_add_f32 v0, v0, v2
8758 ; GFX11-NEXT: v_bfe_u32 v7, v5, 16, 1
8759 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
8760 ; GFX11-NEXT: v_bfe_u32 v6, v0, 16, 1
8761 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
8762 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v5
8763 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
8764 ; GFX11-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
8765 ; GFX11-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
8766 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
8767 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
8768 ; GFX11-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
8769 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
8770 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
8771 ; GFX11-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
8772 ; GFX11-NEXT: v_dual_mov_b32 v6, v1 :: v_dual_mov_b32 v5, v0
8773 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[5:6], v4, s[0:3], 0 offen glc
8774 ; GFX11-NEXT: s_waitcnt vmcnt(0)
8775 ; GFX11-NEXT: buffer_gl1_inv
8776 ; GFX11-NEXT: buffer_gl0_inv
8777 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
8778 ; GFX11-NEXT: v_mov_b32_e32 v1, v5
8779 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
8780 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
8781 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
8782 ; GFX11-NEXT: s_cbranch_execnz .LBB27_1
8783 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
8784 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
8785 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
8786 ; GFX11-NEXT: s_setpc_b64 s[30:31]
8788 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8790 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8791 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
8792 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
8793 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v0
8794 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
8795 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
8796 ; GFX10-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
8797 ; GFX10-NEXT: s_mov_b32 s5, 0
8798 ; GFX10-NEXT: .LBB27_1: ; %atomicrmw.start
8799 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
8800 ; GFX10-NEXT: s_waitcnt vmcnt(0)
8801 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v1
8802 ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
8803 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
8804 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
8805 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v3
8806 ; GFX10-NEXT: v_bfe_u32 v6, v0, 16, 1
8807 ; GFX10-NEXT: v_bfe_u32 v7, v5, 16, 1
8808 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
8809 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v5
8810 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
8811 ; GFX10-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
8812 ; GFX10-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
8813 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
8814 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
8815 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
8816 ; GFX10-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
8817 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
8818 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
8819 ; GFX10-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
8820 ; GFX10-NEXT: s_waitcnt vmcnt(0)
8821 ; GFX10-NEXT: buffer_gl1_inv
8822 ; GFX10-NEXT: buffer_gl0_inv
8823 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
8824 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
8825 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
8826 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
8827 ; GFX10-NEXT: s_cbranch_execnz .LBB27_1
8828 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
8829 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
8830 ; GFX10-NEXT: s_setpc_b64 s[30:31]
8832 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8834 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8835 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
8836 ; GFX90A-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
8837 ; GFX90A-NEXT: s_add_i32 s4, s20, 0x400
8838 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
8839 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v0
8840 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
8841 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
8842 ; GFX90A-NEXT: s_mov_b32 s9, 0x7060302
8843 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
8844 ; GFX90A-NEXT: .LBB27_1: ; %atomicrmw.start
8845 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
8846 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
8847 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v1
8848 ; GFX90A-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
8849 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
8850 ; GFX90A-NEXT: v_add_f32_e32 v5, v5, v3
8851 ; GFX90A-NEXT: v_bfe_u32 v6, v0, 16, 1
8852 ; GFX90A-NEXT: v_bfe_u32 v8, v5, 16, 1
8853 ; GFX90A-NEXT: v_or_b32_e32 v7, 0x400000, v0
8854 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v5
8855 ; GFX90A-NEXT: v_add3_u32 v6, v6, v0, s8
8856 ; GFX90A-NEXT: v_add3_u32 v8, v8, v5, s8
8857 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
8858 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
8859 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
8860 ; GFX90A-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
8861 ; GFX90A-NEXT: v_perm_b32 v0, v5, v0, s9
8862 ; GFX90A-NEXT: v_pk_mov_b32 v[6:7], v[0:1], v[0:1] op_sel:[0,1]
8863 ; GFX90A-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[16:19], 0 offen glc
8864 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
8865 ; GFX90A-NEXT: buffer_wbinvl1
8866 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
8867 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
8868 ; GFX90A-NEXT: v_mov_b32_e32 v1, v6
8869 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
8870 ; GFX90A-NEXT: s_cbranch_execnz .LBB27_1
8871 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
8872 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
8873 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
8875 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8877 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8878 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
8879 ; GFX908-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
8880 ; GFX908-NEXT: s_add_i32 s4, s20, 0x400
8881 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
8882 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v0
8883 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
8884 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
8885 ; GFX908-NEXT: s_mov_b32 s9, 0x7060302
8886 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
8887 ; GFX908-NEXT: .LBB27_1: ; %atomicrmw.start
8888 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
8889 ; GFX908-NEXT: s_waitcnt vmcnt(0)
8890 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v1
8891 ; GFX908-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
8892 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
8893 ; GFX908-NEXT: v_add_f32_e32 v5, v5, v3
8894 ; GFX908-NEXT: v_bfe_u32 v6, v0, 16, 1
8895 ; GFX908-NEXT: v_bfe_u32 v8, v5, 16, 1
8896 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
8897 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v5
8898 ; GFX908-NEXT: v_add3_u32 v6, v6, v0, s8
8899 ; GFX908-NEXT: v_add3_u32 v8, v8, v5, s8
8900 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
8901 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
8902 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
8903 ; GFX908-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
8904 ; GFX908-NEXT: v_perm_b32 v0, v5, v0, s9
8905 ; GFX908-NEXT: v_mov_b32_e32 v6, v1
8906 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
8907 ; GFX908-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
8908 ; GFX908-NEXT: s_waitcnt vmcnt(0)
8909 ; GFX908-NEXT: buffer_wbinvl1
8910 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
8911 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
8912 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
8913 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
8914 ; GFX908-NEXT: s_cbranch_execnz .LBB27_1
8915 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
8916 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
8917 ; GFX908-NEXT: s_setpc_b64 s[30:31]
8919 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8921 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8922 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
8923 ; GFX8-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
8924 ; GFX8-NEXT: s_add_i32 s4, s20, 0x400
8925 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
8926 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v0
8927 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
8928 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
8929 ; GFX8-NEXT: .LBB27_1: ; %atomicrmw.start
8930 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
8931 ; GFX8-NEXT: s_waitcnt vmcnt(0)
8932 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v1
8933 ; GFX8-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
8934 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
8935 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v3
8936 ; GFX8-NEXT: v_bfe_u32 v6, v0, 16, 1
8937 ; GFX8-NEXT: v_bfe_u32 v8, v5, 16, 1
8938 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v0
8939 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v5
8940 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
8941 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
8942 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v5
8943 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
8944 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
8945 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
8946 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
8947 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
8948 ; GFX8-NEXT: v_lshrrev_b32_e32 v5, 16, v5
8949 ; GFX8-NEXT: v_alignbit_b32 v0, v5, v0, 16
8950 ; GFX8-NEXT: v_mov_b32_e32 v6, v1
8951 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
8952 ; GFX8-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
8953 ; GFX8-NEXT: s_waitcnt vmcnt(0)
8954 ; GFX8-NEXT: buffer_wbinvl1
8955 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
8956 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
8957 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
8958 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
8959 ; GFX8-NEXT: s_cbranch_execnz .LBB27_1
8960 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
8961 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
8962 ; GFX8-NEXT: s_setpc_b64 s[30:31]
8964 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
8966 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8967 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
8968 ; GFX7-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
8969 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
8970 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
8971 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
8972 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
8973 ; GFX7-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
8974 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
8975 ; GFX7-NEXT: s_waitcnt vmcnt(0)
8976 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
8977 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v2
8978 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
8979 ; GFX7-NEXT: .LBB27_1: ; %atomicrmw.start
8980 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
8981 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
8982 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v4
8983 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
8984 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
8985 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
8986 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
8987 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
8988 ; GFX7-NEXT: v_alignbit_b32 v4, v3, v4, 16
8989 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v6
8990 ; GFX7-NEXT: v_alignbit_b32 v3, v3, v5, 16
8991 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
8992 ; GFX7-NEXT: v_mov_b32_e32 v5, v3
8993 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[16:19], 0 offen glc
8994 ; GFX7-NEXT: s_waitcnt vmcnt(0)
8995 ; GFX7-NEXT: buffer_wbinvl1
8996 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
8997 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
8998 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
8999 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v5
9000 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
9001 ; GFX7-NEXT: s_cbranch_execnz .LBB27_1
9002 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
9003 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
9004 ; GFX7-NEXT: s_setpc_b64 s[30:31]
9006 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory:
9008 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9009 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
9010 ; GFX6-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
9011 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
9012 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
9013 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
9014 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
9015 ; GFX6-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
9016 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
9017 ; GFX6-NEXT: s_waitcnt vmcnt(0)
9018 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
9019 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v2
9020 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
9021 ; GFX6-NEXT: .LBB27_1: ; %atomicrmw.start
9022 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
9023 ; GFX6-NEXT: v_mul_f32_e32 v3, 1.0, v3
9024 ; GFX6-NEXT: v_mul_f32_e32 v4, 1.0, v4
9025 ; GFX6-NEXT: s_waitcnt expcnt(0)
9026 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
9027 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
9028 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v3
9029 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
9030 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
9031 ; GFX6-NEXT: v_alignbit_b32 v4, v3, v4, 16
9032 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v6
9033 ; GFX6-NEXT: v_alignbit_b32 v3, v3, v5, 16
9034 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
9035 ; GFX6-NEXT: v_mov_b32_e32 v5, v3
9036 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[16:19], 0 offen glc
9037 ; GFX6-NEXT: s_waitcnt vmcnt(0)
9038 ; GFX6-NEXT: buffer_wbinvl1
9039 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
9040 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
9041 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
9042 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v5
9043 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
9044 ; GFX6-NEXT: s_cbranch_execnz .LBB27_1
9045 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
9046 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
9047 ; GFX6-NEXT: s_waitcnt expcnt(0)
9048 ; GFX6-NEXT: s_setpc_b64 s[30:31]
9049 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
9050 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
9054 define <2 x bfloat> @buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory(ptr addrspace(7) %ptr, <2 x bfloat> %val) #0 {
9055 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9057 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
9058 ; GFX12-NEXT: s_wait_expcnt 0x0
9059 ; GFX12-NEXT: s_wait_samplecnt 0x0
9060 ; GFX12-NEXT: s_wait_bvhcnt 0x0
9061 ; GFX12-NEXT: s_wait_kmcnt 0x0
9062 ; GFX12-NEXT: s_mov_b32 s1, exec_lo
9063 ; GFX12-NEXT: s_wait_storecnt 0x0
9064 ; GFX12-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9065 ; GFX12-NEXT: v_readfirstlane_b32 s4, v0
9066 ; GFX12-NEXT: v_readfirstlane_b32 s5, v1
9067 ; GFX12-NEXT: v_readfirstlane_b32 s6, v2
9068 ; GFX12-NEXT: v_readfirstlane_b32 s7, v3
9069 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
9070 ; GFX12-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
9071 ; GFX12-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
9072 ; GFX12-NEXT: s_wait_alu 0xfffe
9073 ; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
9074 ; GFX12-NEXT: s_and_b32 s0, vcc_lo, s0
9075 ; GFX12-NEXT: s_wait_alu 0xfffe
9076 ; GFX12-NEXT: s_and_saveexec_b32 s0, s0
9077 ; GFX12-NEXT: s_wait_loadcnt 0x0
9078 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v5, v4, s[4:7], null offen offset:1024 th:TH_ATOMIC_RETURN
9079 ; GFX12-NEXT: ; implicit-def: $vgpr0_vgpr1_vgpr2_vgpr3
9080 ; GFX12-NEXT: ; implicit-def: $vgpr4
9081 ; GFX12-NEXT: s_wait_alu 0xfffe
9082 ; GFX12-NEXT: s_xor_b32 exec_lo, exec_lo, s0
9083 ; GFX12-NEXT: s_cbranch_execnz .LBB28_1
9084 ; GFX12-NEXT: ; %bb.2:
9085 ; GFX12-NEXT: s_mov_b32 exec_lo, s1
9086 ; GFX12-NEXT: s_wait_loadcnt 0x0
9087 ; GFX12-NEXT: v_mov_b32_e32 v0, v5
9088 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
9089 ; GFX12-NEXT: s_wait_alu 0xfffe
9090 ; GFX12-NEXT: s_setpc_b64 s[30:31]
9092 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9094 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9095 ; GFX940-NEXT: v_add_u32_e32 v8, 0x400, v4
9096 ; GFX940-NEXT: s_mov_b64 s[2:3], exec
9097 ; GFX940-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9098 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
9099 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
9100 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
9101 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
9102 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
9103 ; GFX940-NEXT: s_nop 0
9104 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
9105 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
9106 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
9107 ; GFX940-NEXT: buffer_load_dword v7, v4, s[4:7], 0 offen offset:1024
9108 ; GFX940-NEXT: ; implicit-def: $vgpr4
9109 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
9110 ; GFX940-NEXT: s_cbranch_execnz .LBB28_1
9111 ; GFX940-NEXT: ; %bb.2:
9112 ; GFX940-NEXT: s_mov_b64 exec, s[2:3]
9113 ; GFX940-NEXT: s_mov_b64 s[2:3], 0
9114 ; GFX940-NEXT: v_lshlrev_b32_e32 v9, 16, v5
9115 ; GFX940-NEXT: s_movk_i32 s10, 0x7fff
9116 ; GFX940-NEXT: v_and_b32_e32 v10, 0xffff0000, v5
9117 ; GFX940-NEXT: s_mov_b32 s11, 0x7060302
9118 ; GFX940-NEXT: .LBB28_3: ; %atomicrmw.start
9119 ; GFX940-NEXT: ; =>This Loop Header: Depth=1
9120 ; GFX940-NEXT: ; Child Loop BB28_4 Depth 2
9121 ; GFX940-NEXT: s_waitcnt vmcnt(0)
9122 ; GFX940-NEXT: v_lshlrev_b32_e32 v4, 16, v7
9123 ; GFX940-NEXT: v_add_f32_e32 v4, v4, v9
9124 ; GFX940-NEXT: v_bfe_u32 v5, v4, 16, 1
9125 ; GFX940-NEXT: v_add3_u32 v5, v5, v4, s10
9126 ; GFX940-NEXT: v_or_b32_e32 v6, 0x400000, v4
9127 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
9128 ; GFX940-NEXT: s_mov_b64 s[8:9], exec
9129 ; GFX940-NEXT: buffer_wbl2 sc1
9130 ; GFX940-NEXT: v_cndmask_b32_e32 v4, v5, v6, vcc
9131 ; GFX940-NEXT: v_and_b32_e32 v5, 0xffff0000, v7
9132 ; GFX940-NEXT: v_add_f32_e32 v5, v5, v10
9133 ; GFX940-NEXT: v_bfe_u32 v6, v5, 16, 1
9134 ; GFX940-NEXT: v_add3_u32 v6, v6, v5, s10
9135 ; GFX940-NEXT: v_or_b32_e32 v11, 0x400000, v5
9136 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
9137 ; GFX940-NEXT: s_nop 1
9138 ; GFX940-NEXT: v_cndmask_b32_e32 v5, v6, v11, vcc
9139 ; GFX940-NEXT: v_perm_b32 v6, v5, v4, s11
9140 ; GFX940-NEXT: v_mov_b64_e32 v[4:5], v[6:7]
9141 ; GFX940-NEXT: .LBB28_4: ; Parent Loop BB28_3 Depth=1
9142 ; GFX940-NEXT: ; => This Inner Loop Header: Depth=2
9143 ; GFX940-NEXT: v_readfirstlane_b32 s4, v0
9144 ; GFX940-NEXT: v_readfirstlane_b32 s5, v1
9145 ; GFX940-NEXT: v_readfirstlane_b32 s6, v2
9146 ; GFX940-NEXT: v_readfirstlane_b32 s7, v3
9147 ; GFX940-NEXT: v_cmp_eq_u64_e32 vcc, s[4:5], v[0:1]
9148 ; GFX940-NEXT: s_nop 0
9149 ; GFX940-NEXT: v_cmp_eq_u64_e64 s[0:1], s[6:7], v[2:3]
9150 ; GFX940-NEXT: s_and_b64 s[0:1], vcc, s[0:1]
9151 ; GFX940-NEXT: s_and_saveexec_b64 s[0:1], s[0:1]
9152 ; GFX940-NEXT: s_waitcnt vmcnt(0)
9153 ; GFX940-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[4:7], 0 offen sc0
9154 ; GFX940-NEXT: s_xor_b64 exec, exec, s[0:1]
9155 ; GFX940-NEXT: s_cbranch_execnz .LBB28_4
9156 ; GFX940-NEXT: ; %bb.5: ; in Loop: Header=BB28_3 Depth=1
9157 ; GFX940-NEXT: s_mov_b64 exec, s[8:9]
9158 ; GFX940-NEXT: s_waitcnt vmcnt(0)
9159 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v4, v7
9160 ; GFX940-NEXT: s_or_b64 s[2:3], vcc, s[2:3]
9161 ; GFX940-NEXT: v_mov_b32_e32 v7, v4
9162 ; GFX940-NEXT: buffer_inv sc1
9163 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[2:3]
9164 ; GFX940-NEXT: s_cbranch_execnz .LBB28_3
9165 ; GFX940-NEXT: ; %bb.6: ; %atomicrmw.end
9166 ; GFX940-NEXT: s_or_b64 exec, exec, s[2:3]
9167 ; GFX940-NEXT: v_mov_b32_e32 v0, v4
9168 ; GFX940-NEXT: s_setpc_b64 s[30:31]
9170 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9172 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9173 ; GFX11-NEXT: v_add_nc_u32_e32 v7, 0x400, v4
9174 ; GFX11-NEXT: s_mov_b32 s1, 0
9175 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
9176 ; GFX11-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9177 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
9178 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
9179 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
9180 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
9181 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
9182 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
9183 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
9184 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
9185 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
9186 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
9187 ; GFX11-NEXT: buffer_load_b32 v6, v4, s[4:7], 0 offen offset:1024
9188 ; GFX11-NEXT: ; implicit-def: $vgpr4
9189 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
9190 ; GFX11-NEXT: s_cbranch_execnz .LBB28_1
9191 ; GFX11-NEXT: ; %bb.2:
9192 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
9193 ; GFX11-NEXT: v_lshlrev_b32_e32 v8, 16, v5
9194 ; GFX11-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
9195 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
9196 ; GFX11-NEXT: .p2align 6
9197 ; GFX11-NEXT: .LBB28_3: ; %atomicrmw.start
9198 ; GFX11-NEXT: ; =>This Loop Header: Depth=1
9199 ; GFX11-NEXT: ; Child Loop BB28_4 Depth 2
9200 ; GFX11-NEXT: s_waitcnt vmcnt(0)
9201 ; GFX11-NEXT: v_and_b32_e32 v5, 0xffff0000, v6
9202 ; GFX11-NEXT: v_lshlrev_b32_e32 v4, 16, v6
9203 ; GFX11-NEXT: s_mov_b32 s2, exec_lo
9204 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
9205 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
9206 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v9 :: v_dual_add_f32 v4, v4, v8
9207 ; GFX11-NEXT: v_bfe_u32 v11, v5, 16, 1
9208 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
9209 ; GFX11-NEXT: v_bfe_u32 v10, v4, 16, 1
9210 ; GFX11-NEXT: v_or_b32_e32 v12, 0x400000, v4
9211 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
9212 ; GFX11-NEXT: v_or_b32_e32 v13, 0x400000, v5
9213 ; GFX11-NEXT: v_add3_u32 v11, v11, v5, 0x7fff
9214 ; GFX11-NEXT: v_add3_u32 v10, v10, v4, 0x7fff
9215 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_4)
9216 ; GFX11-NEXT: v_cndmask_b32_e32 v4, v10, v12, vcc_lo
9217 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
9218 ; GFX11-NEXT: v_cndmask_b32_e32 v5, v11, v13, vcc_lo
9219 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
9220 ; GFX11-NEXT: v_perm_b32 v5, v5, v4, 0x7060302
9221 ; GFX11-NEXT: v_mov_b32_e32 v4, v5
9222 ; GFX11-NEXT: v_mov_b32_e32 v5, v6
9223 ; GFX11-NEXT: .LBB28_4: ; Parent Loop BB28_3 Depth=1
9224 ; GFX11-NEXT: ; => This Inner Loop Header: Depth=2
9225 ; GFX11-NEXT: v_readfirstlane_b32 s4, v0
9226 ; GFX11-NEXT: v_readfirstlane_b32 s5, v1
9227 ; GFX11-NEXT: v_readfirstlane_b32 s6, v2
9228 ; GFX11-NEXT: v_readfirstlane_b32 s7, v3
9229 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
9230 ; GFX11-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[4:5], v[0:1]
9231 ; GFX11-NEXT: v_cmp_eq_u64_e64 s0, s[6:7], v[2:3]
9232 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
9233 ; GFX11-NEXT: s_and_b32 s0, vcc_lo, s0
9234 ; GFX11-NEXT: s_and_saveexec_b32 s0, s0
9235 ; GFX11-NEXT: s_waitcnt vmcnt(0)
9236 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[4:5], v7, s[4:7], 0 offen glc
9237 ; GFX11-NEXT: s_xor_b32 exec_lo, exec_lo, s0
9238 ; GFX11-NEXT: s_cbranch_execnz .LBB28_4
9239 ; GFX11-NEXT: ; %bb.5: ; in Loop: Header=BB28_3 Depth=1
9240 ; GFX11-NEXT: s_mov_b32 exec_lo, s2
9241 ; GFX11-NEXT: s_waitcnt vmcnt(0)
9242 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
9243 ; GFX11-NEXT: v_mov_b32_e32 v6, v4
9244 ; GFX11-NEXT: buffer_gl1_inv
9245 ; GFX11-NEXT: buffer_gl0_inv
9246 ; GFX11-NEXT: s_or_b32 s1, vcc_lo, s1
9247 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
9248 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s1
9249 ; GFX11-NEXT: s_cbranch_execnz .LBB28_3
9250 ; GFX11-NEXT: ; %bb.6: ; %atomicrmw.end
9251 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
9252 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s1
9253 ; GFX11-NEXT: v_mov_b32_e32 v0, v4
9254 ; GFX11-NEXT: s_setpc_b64 s[30:31]
9256 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9258 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9259 ; GFX10-NEXT: v_add_nc_u32_e32 v7, 0x400, v4
9260 ; GFX10-NEXT: s_mov_b32 s5, 0
9261 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
9262 ; GFX10-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9263 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
9264 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
9265 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
9266 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
9267 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
9268 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
9269 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
9270 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
9271 ; GFX10-NEXT: buffer_load_dword v6, v4, s[8:11], 0 offen offset:1024
9272 ; GFX10-NEXT: ; implicit-def: $vgpr4
9273 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
9274 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
9275 ; GFX10-NEXT: s_cbranch_execnz .LBB28_1
9276 ; GFX10-NEXT: ; %bb.2:
9277 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
9278 ; GFX10-NEXT: v_lshlrev_b32_e32 v8, 16, v5
9279 ; GFX10-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
9280 ; GFX10-NEXT: .LBB28_3: ; %atomicrmw.start
9281 ; GFX10-NEXT: ; =>This Loop Header: Depth=1
9282 ; GFX10-NEXT: ; Child Loop BB28_4 Depth 2
9283 ; GFX10-NEXT: s_waitcnt vmcnt(0)
9284 ; GFX10-NEXT: v_lshlrev_b32_e32 v4, 16, v6
9285 ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff0000, v6
9286 ; GFX10-NEXT: s_mov_b32 s6, exec_lo
9287 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
9288 ; GFX10-NEXT: v_add_f32_e32 v4, v4, v8
9289 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v9
9290 ; GFX10-NEXT: v_bfe_u32 v10, v4, 16, 1
9291 ; GFX10-NEXT: v_bfe_u32 v11, v5, 16, 1
9292 ; GFX10-NEXT: v_or_b32_e32 v12, 0x400000, v4
9293 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v4, v4
9294 ; GFX10-NEXT: v_or_b32_e32 v13, 0x400000, v5
9295 ; GFX10-NEXT: v_add3_u32 v10, v10, v4, 0x7fff
9296 ; GFX10-NEXT: v_add3_u32 v11, v11, v5, 0x7fff
9297 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v10, v12, vcc_lo
9298 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
9299 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v11, v13, vcc_lo
9300 ; GFX10-NEXT: v_perm_b32 v5, v5, v4, 0x7060302
9301 ; GFX10-NEXT: v_mov_b32_e32 v4, v5
9302 ; GFX10-NEXT: v_mov_b32_e32 v5, v6
9303 ; GFX10-NEXT: .LBB28_4: ; Parent Loop BB28_3 Depth=1
9304 ; GFX10-NEXT: ; => This Inner Loop Header: Depth=2
9305 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
9306 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
9307 ; GFX10-NEXT: v_readfirstlane_b32 s10, v2
9308 ; GFX10-NEXT: v_readfirstlane_b32 s11, v3
9309 ; GFX10-NEXT: v_cmp_eq_u64_e32 vcc_lo, s[8:9], v[0:1]
9310 ; GFX10-NEXT: v_cmp_eq_u64_e64 s4, s[10:11], v[2:3]
9311 ; GFX10-NEXT: s_and_b32 s4, vcc_lo, s4
9312 ; GFX10-NEXT: s_and_saveexec_b32 s4, s4
9313 ; GFX10-NEXT: s_waitcnt vmcnt(0)
9314 ; GFX10-NEXT: buffer_atomic_cmpswap v[4:5], v7, s[8:11], 0 offen glc
9315 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
9316 ; GFX10-NEXT: s_xor_b32 exec_lo, exec_lo, s4
9317 ; GFX10-NEXT: s_cbranch_execnz .LBB28_4
9318 ; GFX10-NEXT: ; %bb.5: ; in Loop: Header=BB28_3 Depth=1
9319 ; GFX10-NEXT: s_mov_b32 exec_lo, s6
9320 ; GFX10-NEXT: s_waitcnt vmcnt(0)
9321 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v4, v6
9322 ; GFX10-NEXT: v_mov_b32_e32 v6, v4
9323 ; GFX10-NEXT: buffer_gl1_inv
9324 ; GFX10-NEXT: buffer_gl0_inv
9325 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
9326 ; GFX10-NEXT: s_waitcnt_depctr 0xffe3
9327 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
9328 ; GFX10-NEXT: s_cbranch_execnz .LBB28_3
9329 ; GFX10-NEXT: ; %bb.6: ; %atomicrmw.end
9330 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
9331 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
9332 ; GFX10-NEXT: s_setpc_b64 s[30:31]
9334 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9336 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9337 ; GFX90A-NEXT: v_add_u32_e32 v8, 0x400, v4
9338 ; GFX90A-NEXT: s_mov_b64 s[6:7], exec
9339 ; GFX90A-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9340 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
9341 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
9342 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
9343 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
9344 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9345 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9346 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9347 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9348 ; GFX90A-NEXT: s_nop 0
9349 ; GFX90A-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
9350 ; GFX90A-NEXT: ; implicit-def: $vgpr4
9351 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
9352 ; GFX90A-NEXT: s_cbranch_execnz .LBB28_1
9353 ; GFX90A-NEXT: ; %bb.2:
9354 ; GFX90A-NEXT: s_mov_b64 exec, s[6:7]
9355 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
9356 ; GFX90A-NEXT: v_lshlrev_b32_e32 v9, 16, v5
9357 ; GFX90A-NEXT: s_movk_i32 s14, 0x7fff
9358 ; GFX90A-NEXT: v_and_b32_e32 v10, 0xffff0000, v5
9359 ; GFX90A-NEXT: s_mov_b32 s15, 0x7060302
9360 ; GFX90A-NEXT: .LBB28_3: ; %atomicrmw.start
9361 ; GFX90A-NEXT: ; =>This Loop Header: Depth=1
9362 ; GFX90A-NEXT: ; Child Loop BB28_4 Depth 2
9363 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
9364 ; GFX90A-NEXT: v_lshlrev_b32_e32 v4, 16, v7
9365 ; GFX90A-NEXT: v_add_f32_e32 v4, v4, v9
9366 ; GFX90A-NEXT: v_bfe_u32 v5, v4, 16, 1
9367 ; GFX90A-NEXT: v_add3_u32 v5, v5, v4, s14
9368 ; GFX90A-NEXT: v_or_b32_e32 v6, 0x400000, v4
9369 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
9370 ; GFX90A-NEXT: v_cndmask_b32_e32 v4, v5, v6, vcc
9371 ; GFX90A-NEXT: v_and_b32_e32 v5, 0xffff0000, v7
9372 ; GFX90A-NEXT: v_add_f32_e32 v5, v5, v10
9373 ; GFX90A-NEXT: v_bfe_u32 v6, v5, 16, 1
9374 ; GFX90A-NEXT: v_add3_u32 v6, v6, v5, s14
9375 ; GFX90A-NEXT: v_or_b32_e32 v11, 0x400000, v5
9376 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
9377 ; GFX90A-NEXT: v_cndmask_b32_e32 v5, v6, v11, vcc
9378 ; GFX90A-NEXT: v_perm_b32 v6, v5, v4, s15
9379 ; GFX90A-NEXT: s_mov_b64 s[12:13], exec
9380 ; GFX90A-NEXT: v_pk_mov_b32 v[4:5], v[6:7], v[6:7] op_sel:[0,1]
9381 ; GFX90A-NEXT: .LBB28_4: ; Parent Loop BB28_3 Depth=1
9382 ; GFX90A-NEXT: ; => This Inner Loop Header: Depth=2
9383 ; GFX90A-NEXT: v_readfirstlane_b32 s8, v0
9384 ; GFX90A-NEXT: v_readfirstlane_b32 s9, v1
9385 ; GFX90A-NEXT: v_readfirstlane_b32 s10, v2
9386 ; GFX90A-NEXT: v_readfirstlane_b32 s11, v3
9387 ; GFX90A-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9388 ; GFX90A-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9389 ; GFX90A-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9390 ; GFX90A-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9391 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
9392 ; GFX90A-NEXT: buffer_atomic_cmpswap v[4:5], v8, s[8:11], 0 offen glc
9393 ; GFX90A-NEXT: s_xor_b64 exec, exec, s[4:5]
9394 ; GFX90A-NEXT: s_cbranch_execnz .LBB28_4
9395 ; GFX90A-NEXT: ; %bb.5: ; in Loop: Header=BB28_3 Depth=1
9396 ; GFX90A-NEXT: s_mov_b64 exec, s[12:13]
9397 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
9398 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v4, v7
9399 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
9400 ; GFX90A-NEXT: v_mov_b32_e32 v7, v4
9401 ; GFX90A-NEXT: buffer_wbinvl1
9402 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
9403 ; GFX90A-NEXT: s_cbranch_execnz .LBB28_3
9404 ; GFX90A-NEXT: ; %bb.6: ; %atomicrmw.end
9405 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
9406 ; GFX90A-NEXT: v_mov_b32_e32 v0, v4
9407 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
9409 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9411 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9412 ; GFX908-NEXT: v_add_u32_e32 v7, 0x400, v4
9413 ; GFX908-NEXT: s_mov_b64 s[6:7], exec
9414 ; GFX908-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9415 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
9416 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
9417 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
9418 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
9419 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9420 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9421 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9422 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9423 ; GFX908-NEXT: s_nop 0
9424 ; GFX908-NEXT: buffer_load_dword v6, v4, s[8:11], 0 offen offset:1024
9425 ; GFX908-NEXT: ; implicit-def: $vgpr4
9426 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
9427 ; GFX908-NEXT: s_cbranch_execnz .LBB28_1
9428 ; GFX908-NEXT: ; %bb.2:
9429 ; GFX908-NEXT: s_mov_b64 exec, s[6:7]
9430 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
9431 ; GFX908-NEXT: v_lshlrev_b32_e32 v8, 16, v5
9432 ; GFX908-NEXT: s_movk_i32 s14, 0x7fff
9433 ; GFX908-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
9434 ; GFX908-NEXT: s_mov_b32 s15, 0x7060302
9435 ; GFX908-NEXT: .LBB28_3: ; %atomicrmw.start
9436 ; GFX908-NEXT: ; =>This Loop Header: Depth=1
9437 ; GFX908-NEXT: ; Child Loop BB28_4 Depth 2
9438 ; GFX908-NEXT: s_waitcnt vmcnt(0)
9439 ; GFX908-NEXT: v_lshlrev_b32_e32 v4, 16, v6
9440 ; GFX908-NEXT: v_add_f32_e32 v4, v4, v8
9441 ; GFX908-NEXT: v_bfe_u32 v5, v4, 16, 1
9442 ; GFX908-NEXT: v_add3_u32 v5, v5, v4, s14
9443 ; GFX908-NEXT: v_or_b32_e32 v10, 0x400000, v4
9444 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
9445 ; GFX908-NEXT: v_cndmask_b32_e32 v4, v5, v10, vcc
9446 ; GFX908-NEXT: v_and_b32_e32 v5, 0xffff0000, v6
9447 ; GFX908-NEXT: v_add_f32_e32 v5, v5, v9
9448 ; GFX908-NEXT: v_bfe_u32 v10, v5, 16, 1
9449 ; GFX908-NEXT: v_add3_u32 v10, v10, v5, s14
9450 ; GFX908-NEXT: v_or_b32_e32 v11, 0x400000, v5
9451 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
9452 ; GFX908-NEXT: v_cndmask_b32_e32 v5, v10, v11, vcc
9453 ; GFX908-NEXT: v_perm_b32 v5, v5, v4, s15
9454 ; GFX908-NEXT: v_mov_b32_e32 v4, v5
9455 ; GFX908-NEXT: s_mov_b64 s[12:13], exec
9456 ; GFX908-NEXT: v_mov_b32_e32 v5, v6
9457 ; GFX908-NEXT: .LBB28_4: ; Parent Loop BB28_3 Depth=1
9458 ; GFX908-NEXT: ; => This Inner Loop Header: Depth=2
9459 ; GFX908-NEXT: v_readfirstlane_b32 s8, v0
9460 ; GFX908-NEXT: v_readfirstlane_b32 s9, v1
9461 ; GFX908-NEXT: v_readfirstlane_b32 s10, v2
9462 ; GFX908-NEXT: v_readfirstlane_b32 s11, v3
9463 ; GFX908-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9464 ; GFX908-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9465 ; GFX908-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9466 ; GFX908-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9467 ; GFX908-NEXT: s_waitcnt vmcnt(0)
9468 ; GFX908-NEXT: buffer_atomic_cmpswap v[4:5], v7, s[8:11], 0 offen glc
9469 ; GFX908-NEXT: s_xor_b64 exec, exec, s[4:5]
9470 ; GFX908-NEXT: s_cbranch_execnz .LBB28_4
9471 ; GFX908-NEXT: ; %bb.5: ; in Loop: Header=BB28_3 Depth=1
9472 ; GFX908-NEXT: s_mov_b64 exec, s[12:13]
9473 ; GFX908-NEXT: s_waitcnt vmcnt(0)
9474 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
9475 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
9476 ; GFX908-NEXT: v_mov_b32_e32 v6, v4
9477 ; GFX908-NEXT: buffer_wbinvl1
9478 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
9479 ; GFX908-NEXT: s_cbranch_execnz .LBB28_3
9480 ; GFX908-NEXT: ; %bb.6: ; %atomicrmw.end
9481 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
9482 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
9483 ; GFX908-NEXT: s_setpc_b64 s[30:31]
9485 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9487 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9488 ; GFX8-NEXT: v_add_u32_e32 v7, vcc, 0x400, v4
9489 ; GFX8-NEXT: s_mov_b64 s[6:7], exec
9490 ; GFX8-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9491 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
9492 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
9493 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
9494 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
9495 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9496 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9497 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9498 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9499 ; GFX8-NEXT: s_nop 0
9500 ; GFX8-NEXT: buffer_load_dword v6, v4, s[8:11], 0 offen offset:1024
9501 ; GFX8-NEXT: ; implicit-def: $vgpr4
9502 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
9503 ; GFX8-NEXT: s_cbranch_execnz .LBB28_1
9504 ; GFX8-NEXT: ; %bb.2:
9505 ; GFX8-NEXT: s_mov_b64 exec, s[6:7]
9506 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
9507 ; GFX8-NEXT: v_lshlrev_b32_e32 v8, 16, v5
9508 ; GFX8-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
9509 ; GFX8-NEXT: .LBB28_3: ; %atomicrmw.start
9510 ; GFX8-NEXT: ; =>This Loop Header: Depth=1
9511 ; GFX8-NEXT: ; Child Loop BB28_4 Depth 2
9512 ; GFX8-NEXT: s_waitcnt vmcnt(0)
9513 ; GFX8-NEXT: v_lshlrev_b32_e32 v4, 16, v6
9514 ; GFX8-NEXT: v_add_f32_e32 v4, v4, v8
9515 ; GFX8-NEXT: v_bfe_u32 v5, v4, 16, 1
9516 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, v5, v4
9517 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, 0x7fff, v5
9518 ; GFX8-NEXT: v_or_b32_e32 v10, 0x400000, v4
9519 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v4, v4
9520 ; GFX8-NEXT: v_cndmask_b32_e32 v4, v5, v10, vcc
9521 ; GFX8-NEXT: v_and_b32_e32 v5, 0xffff0000, v6
9522 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v9
9523 ; GFX8-NEXT: v_bfe_u32 v10, v5, 16, 1
9524 ; GFX8-NEXT: v_add_u32_e32 v10, vcc, v10, v5
9525 ; GFX8-NEXT: v_add_u32_e32 v10, vcc, 0x7fff, v10
9526 ; GFX8-NEXT: v_or_b32_e32 v11, 0x400000, v5
9527 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
9528 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v10, v11, vcc
9529 ; GFX8-NEXT: v_lshrrev_b32_e32 v5, 16, v5
9530 ; GFX8-NEXT: v_alignbit_b32 v5, v5, v4, 16
9531 ; GFX8-NEXT: v_mov_b32_e32 v4, v5
9532 ; GFX8-NEXT: s_mov_b64 s[12:13], exec
9533 ; GFX8-NEXT: v_mov_b32_e32 v5, v6
9534 ; GFX8-NEXT: .LBB28_4: ; Parent Loop BB28_3 Depth=1
9535 ; GFX8-NEXT: ; => This Inner Loop Header: Depth=2
9536 ; GFX8-NEXT: v_readfirstlane_b32 s8, v0
9537 ; GFX8-NEXT: v_readfirstlane_b32 s9, v1
9538 ; GFX8-NEXT: v_readfirstlane_b32 s10, v2
9539 ; GFX8-NEXT: v_readfirstlane_b32 s11, v3
9540 ; GFX8-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9541 ; GFX8-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9542 ; GFX8-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9543 ; GFX8-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9544 ; GFX8-NEXT: s_waitcnt vmcnt(0)
9545 ; GFX8-NEXT: buffer_atomic_cmpswap v[4:5], v7, s[8:11], 0 offen glc
9546 ; GFX8-NEXT: s_xor_b64 exec, exec, s[4:5]
9547 ; GFX8-NEXT: s_cbranch_execnz .LBB28_4
9548 ; GFX8-NEXT: ; %bb.5: ; in Loop: Header=BB28_3 Depth=1
9549 ; GFX8-NEXT: s_mov_b64 exec, s[12:13]
9550 ; GFX8-NEXT: s_waitcnt vmcnt(0)
9551 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v4, v6
9552 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
9553 ; GFX8-NEXT: v_mov_b32_e32 v6, v4
9554 ; GFX8-NEXT: buffer_wbinvl1
9555 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
9556 ; GFX8-NEXT: s_cbranch_execnz .LBB28_3
9557 ; GFX8-NEXT: ; %bb.6: ; %atomicrmw.end
9558 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
9559 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
9560 ; GFX8-NEXT: s_setpc_b64 s[30:31]
9562 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9564 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9565 ; GFX7-NEXT: v_add_i32_e32 v8, vcc, 0x400, v4
9566 ; GFX7-NEXT: s_mov_b64 s[6:7], exec
9567 ; GFX7-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9568 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
9569 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
9570 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
9571 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
9572 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9573 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9574 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9575 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9576 ; GFX7-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
9577 ; GFX7-NEXT: ; implicit-def: $vgpr4
9578 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
9579 ; GFX7-NEXT: s_cbranch_execnz .LBB28_1
9580 ; GFX7-NEXT: ; %bb.2:
9581 ; GFX7-NEXT: s_mov_b64 exec, s[6:7]
9582 ; GFX7-NEXT: v_mul_f32_e32 v5, 1.0, v5
9583 ; GFX7-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
9584 ; GFX7-NEXT: v_mul_f32_e32 v5, 1.0, v6
9585 ; GFX7-NEXT: s_waitcnt vmcnt(0)
9586 ; GFX7-NEXT: v_and_b32_e32 v4, 0xffff0000, v7
9587 ; GFX7-NEXT: v_lshlrev_b32_e32 v7, 16, v7
9588 ; GFX7-NEXT: s_mov_b64 s[6:7], 0
9589 ; GFX7-NEXT: v_and_b32_e32 v10, 0xffff0000, v5
9590 ; GFX7-NEXT: .LBB28_3: ; %atomicrmw.start
9591 ; GFX7-NEXT: ; =>This Loop Header: Depth=1
9592 ; GFX7-NEXT: ; Child Loop BB28_4 Depth 2
9593 ; GFX7-NEXT: v_mul_f32_e32 v5, 1.0, v7
9594 ; GFX7-NEXT: v_mul_f32_e32 v7, 1.0, v4
9595 ; GFX7-NEXT: v_and_b32_e32 v4, 0xffff0000, v7
9596 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v5
9597 ; GFX7-NEXT: v_add_f32_e32 v4, v4, v10
9598 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v9
9599 ; GFX7-NEXT: v_lshrrev_b32_e32 v4, 16, v4
9600 ; GFX7-NEXT: v_alignbit_b32 v4, v4, v6, 16
9601 ; GFX7-NEXT: v_lshrrev_b32_e32 v6, 16, v7
9602 ; GFX7-NEXT: v_alignbit_b32 v5, v6, v5, 16
9603 ; GFX7-NEXT: v_mov_b32_e32 v7, v5
9604 ; GFX7-NEXT: s_mov_b64 s[12:13], exec
9605 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
9606 ; GFX7-NEXT: .LBB28_4: ; Parent Loop BB28_3 Depth=1
9607 ; GFX7-NEXT: ; => This Inner Loop Header: Depth=2
9608 ; GFX7-NEXT: v_readfirstlane_b32 s8, v0
9609 ; GFX7-NEXT: v_readfirstlane_b32 s9, v1
9610 ; GFX7-NEXT: v_readfirstlane_b32 s10, v2
9611 ; GFX7-NEXT: v_readfirstlane_b32 s11, v3
9612 ; GFX7-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9613 ; GFX7-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9614 ; GFX7-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9615 ; GFX7-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9616 ; GFX7-NEXT: s_waitcnt vmcnt(0)
9617 ; GFX7-NEXT: buffer_atomic_cmpswap v[6:7], v8, s[8:11], 0 offen glc
9618 ; GFX7-NEXT: s_xor_b64 exec, exec, s[4:5]
9619 ; GFX7-NEXT: s_cbranch_execnz .LBB28_4
9620 ; GFX7-NEXT: ; %bb.5: ; in Loop: Header=BB28_3 Depth=1
9621 ; GFX7-NEXT: s_mov_b64 exec, s[12:13]
9622 ; GFX7-NEXT: s_waitcnt vmcnt(0)
9623 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
9624 ; GFX7-NEXT: v_and_b32_e32 v4, 0xffff0000, v6
9625 ; GFX7-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
9626 ; GFX7-NEXT: v_lshlrev_b32_e32 v7, 16, v6
9627 ; GFX7-NEXT: buffer_wbinvl1
9628 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[6:7]
9629 ; GFX7-NEXT: s_cbranch_execnz .LBB28_3
9630 ; GFX7-NEXT: ; %bb.6: ; %atomicrmw.end
9631 ; GFX7-NEXT: s_or_b64 exec, exec, s[6:7]
9632 ; GFX7-NEXT: v_mov_b32_e32 v0, v7
9633 ; GFX7-NEXT: v_mov_b32_e32 v1, v4
9634 ; GFX7-NEXT: s_setpc_b64 s[30:31]
9636 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__waterfall__amdgpu_no_fine_grained_memory:
9638 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9639 ; GFX6-NEXT: v_add_i32_e32 v8, vcc, 0x400, v4
9640 ; GFX6-NEXT: s_mov_b64 s[6:7], exec
9641 ; GFX6-NEXT: .LBB28_1: ; =>This Inner Loop Header: Depth=1
9642 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
9643 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
9644 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
9645 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
9646 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9647 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9648 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9649 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9650 ; GFX6-NEXT: buffer_load_dword v7, v4, s[8:11], 0 offen offset:1024
9651 ; GFX6-NEXT: ; implicit-def: $vgpr4
9652 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
9653 ; GFX6-NEXT: s_cbranch_execnz .LBB28_1
9654 ; GFX6-NEXT: ; %bb.2:
9655 ; GFX6-NEXT: s_mov_b64 exec, s[6:7]
9656 ; GFX6-NEXT: v_mul_f32_e32 v5, 1.0, v5
9657 ; GFX6-NEXT: v_and_b32_e32 v9, 0xffff0000, v5
9658 ; GFX6-NEXT: v_mul_f32_e32 v5, 1.0, v6
9659 ; GFX6-NEXT: s_waitcnt vmcnt(0)
9660 ; GFX6-NEXT: v_and_b32_e32 v4, 0xffff0000, v7
9661 ; GFX6-NEXT: v_lshlrev_b32_e32 v7, 16, v7
9662 ; GFX6-NEXT: s_mov_b64 s[6:7], 0
9663 ; GFX6-NEXT: v_and_b32_e32 v10, 0xffff0000, v5
9664 ; GFX6-NEXT: .LBB28_3: ; %atomicrmw.start
9665 ; GFX6-NEXT: ; =>This Loop Header: Depth=1
9666 ; GFX6-NEXT: ; Child Loop BB28_4 Depth 2
9667 ; GFX6-NEXT: v_mul_f32_e32 v5, 1.0, v7
9668 ; GFX6-NEXT: v_mul_f32_e32 v7, 1.0, v4
9669 ; GFX6-NEXT: v_and_b32_e32 v4, 0xffff0000, v7
9670 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v5
9671 ; GFX6-NEXT: v_add_f32_e32 v4, v4, v10
9672 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v9
9673 ; GFX6-NEXT: v_lshrrev_b32_e32 v4, 16, v4
9674 ; GFX6-NEXT: v_alignbit_b32 v4, v4, v6, 16
9675 ; GFX6-NEXT: v_lshrrev_b32_e32 v6, 16, v7
9676 ; GFX6-NEXT: v_alignbit_b32 v5, v6, v5, 16
9677 ; GFX6-NEXT: v_mov_b32_e32 v7, v5
9678 ; GFX6-NEXT: s_mov_b64 s[12:13], exec
9679 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
9680 ; GFX6-NEXT: .LBB28_4: ; Parent Loop BB28_3 Depth=1
9681 ; GFX6-NEXT: ; => This Inner Loop Header: Depth=2
9682 ; GFX6-NEXT: v_readfirstlane_b32 s8, v0
9683 ; GFX6-NEXT: v_readfirstlane_b32 s9, v1
9684 ; GFX6-NEXT: v_readfirstlane_b32 s10, v2
9685 ; GFX6-NEXT: v_readfirstlane_b32 s11, v3
9686 ; GFX6-NEXT: v_cmp_eq_u64_e32 vcc, s[8:9], v[0:1]
9687 ; GFX6-NEXT: v_cmp_eq_u64_e64 s[4:5], s[10:11], v[2:3]
9688 ; GFX6-NEXT: s_and_b64 s[4:5], vcc, s[4:5]
9689 ; GFX6-NEXT: s_and_saveexec_b64 s[4:5], s[4:5]
9690 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0)
9691 ; GFX6-NEXT: buffer_atomic_cmpswap v[6:7], v8, s[8:11], 0 offen glc
9692 ; GFX6-NEXT: s_xor_b64 exec, exec, s[4:5]
9693 ; GFX6-NEXT: s_cbranch_execnz .LBB28_4
9694 ; GFX6-NEXT: ; %bb.5: ; in Loop: Header=BB28_3 Depth=1
9695 ; GFX6-NEXT: s_mov_b64 exec, s[12:13]
9696 ; GFX6-NEXT: s_waitcnt vmcnt(0)
9697 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v6, v5
9698 ; GFX6-NEXT: v_and_b32_e32 v4, 0xffff0000, v6
9699 ; GFX6-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
9700 ; GFX6-NEXT: s_waitcnt expcnt(0)
9701 ; GFX6-NEXT: v_lshlrev_b32_e32 v7, 16, v6
9702 ; GFX6-NEXT: buffer_wbinvl1
9703 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[6:7]
9704 ; GFX6-NEXT: s_cbranch_execnz .LBB28_3
9705 ; GFX6-NEXT: ; %bb.6: ; %atomicrmw.end
9706 ; GFX6-NEXT: s_or_b64 exec, exec, s[6:7]
9707 ; GFX6-NEXT: v_mov_b32_e32 v0, v7
9708 ; GFX6-NEXT: v_mov_b32_e32 v1, v4
9709 ; GFX6-NEXT: s_setpc_b64 s[30:31]
9710 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
9711 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0
9712 ret <2 x bfloat> %result
9715 define <2 x bfloat> @buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) {
9716 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
9718 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
9719 ; GFX12-NEXT: s_wait_expcnt 0x0
9720 ; GFX12-NEXT: s_wait_samplecnt 0x0
9721 ; GFX12-NEXT: s_wait_bvhcnt 0x0
9722 ; GFX12-NEXT: s_wait_kmcnt 0x0
9723 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
9724 ; GFX12-NEXT: s_wait_storecnt 0x0
9725 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
9726 ; GFX12-NEXT: s_wait_loadcnt 0x0
9727 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
9728 ; GFX12-NEXT: s_setpc_b64 s[30:31]
9730 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
9732 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9733 ; GFX940-NEXT: v_mov_b32_e32 v1, v0
9734 ; GFX940-NEXT: v_mov_b32_e32 v0, s16
9735 ; GFX940-NEXT: buffer_load_dword v0, v0, s[0:3], 0 offen offset:1024
9736 ; GFX940-NEXT: s_add_i32 s4, s16, 0x400
9737 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
9738 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v1
9739 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
9740 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
9741 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
9742 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
9743 ; GFX940-NEXT: .LBB29_1: ; %atomicrmw.start
9744 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
9745 ; GFX940-NEXT: s_waitcnt vmcnt(0)
9746 ; GFX940-NEXT: v_mov_b32_e32 v7, v0
9747 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v7
9748 ; GFX940-NEXT: v_and_b32_e32 v1, 0xffff0000, v7
9749 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
9750 ; GFX940-NEXT: v_add_f32_e32 v1, v1, v3
9751 ; GFX940-NEXT: v_bfe_u32 v5, v0, 16, 1
9752 ; GFX940-NEXT: v_bfe_u32 v8, v1, 16, 1
9753 ; GFX940-NEXT: v_or_b32_e32 v6, 0x400000, v0
9754 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v1
9755 ; GFX940-NEXT: v_add3_u32 v5, v5, v0, s8
9756 ; GFX940-NEXT: v_add3_u32 v8, v8, v1, s8
9757 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
9758 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
9759 ; GFX940-NEXT: buffer_wbl2 sc1
9760 ; GFX940-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
9761 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v5, v6, s[4:5]
9762 ; GFX940-NEXT: v_perm_b32 v6, v1, v0, s9
9763 ; GFX940-NEXT: v_mov_b64_e32 v[0:1], v[6:7]
9764 ; GFX940-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[0:3], 0 offen sc0
9765 ; GFX940-NEXT: s_waitcnt vmcnt(0)
9766 ; GFX940-NEXT: buffer_inv sc1
9767 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v0, v7
9768 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
9769 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
9770 ; GFX940-NEXT: s_cbranch_execnz .LBB29_1
9771 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
9772 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
9773 ; GFX940-NEXT: s_setpc_b64 s[30:31]
9775 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
9777 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9778 ; GFX11-NEXT: v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v0, s16
9779 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
9780 ; GFX11-NEXT: s_mov_b32 s5, 0
9781 ; GFX11-NEXT: v_mov_b32_e32 v4, s4
9782 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
9783 ; GFX11-NEXT: v_lshlrev_b32_e32 v2, 16, v1
9784 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
9785 ; GFX11-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
9786 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
9787 ; GFX11-NEXT: .p2align 6
9788 ; GFX11-NEXT: .LBB29_1: ; %atomicrmw.start
9789 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
9790 ; GFX11-NEXT: s_waitcnt vmcnt(0)
9791 ; GFX11-NEXT: v_mov_b32_e32 v6, v0
9792 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
9793 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
9794 ; GFX11-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
9795 ; GFX11-NEXT: v_add_f32_e32 v1, v1, v3
9796 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
9797 ; GFX11-NEXT: v_bfe_u32 v7, v1, 16, 1
9798 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v1
9799 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
9800 ; GFX11-NEXT: v_add3_u32 v7, v7, v1, 0x7fff
9801 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
9802 ; GFX11-NEXT: v_dual_cndmask_b32 v1, v7, v9 :: v_dual_lshlrev_b32 v0, 16, v6
9803 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
9804 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
9805 ; GFX11-NEXT: v_bfe_u32 v5, v0, 16, 1
9806 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
9807 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
9808 ; GFX11-NEXT: v_add3_u32 v5, v5, v0, 0x7fff
9809 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
9810 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v5, v8, s4
9811 ; GFX11-NEXT: v_perm_b32 v5, v1, v0, 0x7060302
9812 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
9813 ; GFX11-NEXT: v_dual_mov_b32 v0, v5 :: v_dual_mov_b32 v1, v6
9814 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v4, s[0:3], 0 offen glc
9815 ; GFX11-NEXT: s_waitcnt vmcnt(0)
9816 ; GFX11-NEXT: buffer_gl1_inv
9817 ; GFX11-NEXT: buffer_gl0_inv
9818 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v6
9819 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
9820 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
9821 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
9822 ; GFX11-NEXT: s_cbranch_execnz .LBB29_1
9823 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
9824 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
9825 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
9826 ; GFX11-NEXT: s_setpc_b64 s[30:31]
9828 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
9830 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9831 ; GFX10-NEXT: v_mov_b32_e32 v1, v0
9832 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
9833 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
9834 ; GFX10-NEXT: s_mov_b32 s5, 0
9835 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
9836 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v1
9837 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
9838 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
9839 ; GFX10-NEXT: .LBB29_1: ; %atomicrmw.start
9840 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
9841 ; GFX10-NEXT: s_waitcnt vmcnt(0)
9842 ; GFX10-NEXT: v_mov_b32_e32 v6, v0
9843 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
9844 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v6
9845 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
9846 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
9847 ; GFX10-NEXT: v_add_f32_e32 v1, v1, v3
9848 ; GFX10-NEXT: v_bfe_u32 v5, v0, 16, 1
9849 ; GFX10-NEXT: v_bfe_u32 v7, v1, 16, 1
9850 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
9851 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v1
9852 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
9853 ; GFX10-NEXT: v_add3_u32 v5, v5, v0, 0x7fff
9854 ; GFX10-NEXT: v_add3_u32 v7, v7, v1, 0x7fff
9855 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
9856 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v7, v9, vcc_lo
9857 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v5, v8, s4
9858 ; GFX10-NEXT: v_perm_b32 v5, v1, v0, 0x7060302
9859 ; GFX10-NEXT: v_mov_b32_e32 v0, v5
9860 ; GFX10-NEXT: v_mov_b32_e32 v1, v6
9861 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
9862 ; GFX10-NEXT: s_waitcnt vmcnt(0)
9863 ; GFX10-NEXT: buffer_gl1_inv
9864 ; GFX10-NEXT: buffer_gl0_inv
9865 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v6
9866 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
9867 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
9868 ; GFX10-NEXT: s_cbranch_execnz .LBB29_1
9869 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
9870 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
9871 ; GFX10-NEXT: s_setpc_b64 s[30:31]
9873 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
9875 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9876 ; GFX90A-NEXT: v_mov_b32_e32 v1, v0
9877 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
9878 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
9879 ; GFX90A-NEXT: s_add_i32 s4, s20, 0x400
9880 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
9881 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v1
9882 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
9883 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
9884 ; GFX90A-NEXT: s_mov_b32 s9, 0x7060302
9885 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
9886 ; GFX90A-NEXT: .LBB29_1: ; %atomicrmw.start
9887 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
9888 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
9889 ; GFX90A-NEXT: v_mov_b32_e32 v7, v0
9890 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v7
9891 ; GFX90A-NEXT: v_and_b32_e32 v1, 0xffff0000, v7
9892 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
9893 ; GFX90A-NEXT: v_add_f32_e32 v1, v1, v3
9894 ; GFX90A-NEXT: v_bfe_u32 v5, v0, 16, 1
9895 ; GFX90A-NEXT: v_bfe_u32 v8, v1, 16, 1
9896 ; GFX90A-NEXT: v_or_b32_e32 v6, 0x400000, v0
9897 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v1
9898 ; GFX90A-NEXT: v_add3_u32 v5, v5, v0, s8
9899 ; GFX90A-NEXT: v_add3_u32 v8, v8, v1, s8
9900 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
9901 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
9902 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v5, v6, s[4:5]
9903 ; GFX90A-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
9904 ; GFX90A-NEXT: v_perm_b32 v6, v1, v0, s9
9905 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[6:7], v[6:7] op_sel:[0,1]
9906 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
9907 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
9908 ; GFX90A-NEXT: buffer_wbinvl1
9909 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v7
9910 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
9911 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
9912 ; GFX90A-NEXT: s_cbranch_execnz .LBB29_1
9913 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
9914 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
9915 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
9917 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
9919 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9920 ; GFX908-NEXT: v_mov_b32_e32 v1, v0
9921 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
9922 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
9923 ; GFX908-NEXT: s_add_i32 s4, s20, 0x400
9924 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
9925 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v1
9926 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
9927 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
9928 ; GFX908-NEXT: s_mov_b32 s9, 0x7060302
9929 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
9930 ; GFX908-NEXT: .LBB29_1: ; %atomicrmw.start
9931 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
9932 ; GFX908-NEXT: s_waitcnt vmcnt(0)
9933 ; GFX908-NEXT: v_mov_b32_e32 v6, v0
9934 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v6
9935 ; GFX908-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
9936 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
9937 ; GFX908-NEXT: v_add_f32_e32 v1, v1, v3
9938 ; GFX908-NEXT: v_bfe_u32 v5, v0, 16, 1
9939 ; GFX908-NEXT: v_bfe_u32 v8, v1, 16, 1
9940 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
9941 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v1
9942 ; GFX908-NEXT: v_add3_u32 v5, v5, v0, s8
9943 ; GFX908-NEXT: v_add3_u32 v8, v8, v1, s8
9944 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
9945 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
9946 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v5, v7, s[4:5]
9947 ; GFX908-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
9948 ; GFX908-NEXT: v_perm_b32 v5, v1, v0, s9
9949 ; GFX908-NEXT: v_mov_b32_e32 v0, v5
9950 ; GFX908-NEXT: v_mov_b32_e32 v1, v6
9951 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
9952 ; GFX908-NEXT: s_waitcnt vmcnt(0)
9953 ; GFX908-NEXT: buffer_wbinvl1
9954 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v6
9955 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
9956 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
9957 ; GFX908-NEXT: s_cbranch_execnz .LBB29_1
9958 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
9959 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
9960 ; GFX908-NEXT: s_setpc_b64 s[30:31]
9962 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
9964 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9965 ; GFX8-NEXT: v_mov_b32_e32 v1, v0
9966 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
9967 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
9968 ; GFX8-NEXT: s_add_i32 s4, s20, 0x400
9969 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
9970 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v1
9971 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
9972 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
9973 ; GFX8-NEXT: .LBB29_1: ; %atomicrmw.start
9974 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
9975 ; GFX8-NEXT: s_waitcnt vmcnt(0)
9976 ; GFX8-NEXT: v_mov_b32_e32 v6, v0
9977 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v6
9978 ; GFX8-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
9979 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
9980 ; GFX8-NEXT: v_add_f32_e32 v1, v1, v3
9981 ; GFX8-NEXT: v_bfe_u32 v5, v0, 16, 1
9982 ; GFX8-NEXT: v_bfe_u32 v8, v1, 16, 1
9983 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, v5, v0
9984 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v1
9985 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, 0x7fff, v5
9986 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
9987 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v1
9988 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
9989 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
9990 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
9991 ; GFX8-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
9992 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v5, v7, s[4:5]
9993 ; GFX8-NEXT: v_lshrrev_b32_e32 v1, 16, v1
9994 ; GFX8-NEXT: v_alignbit_b32 v5, v1, v0, 16
9995 ; GFX8-NEXT: v_mov_b32_e32 v0, v5
9996 ; GFX8-NEXT: v_mov_b32_e32 v1, v6
9997 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
9998 ; GFX8-NEXT: s_waitcnt vmcnt(0)
9999 ; GFX8-NEXT: buffer_wbinvl1
10000 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v6
10001 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10002 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
10003 ; GFX8-NEXT: s_cbranch_execnz .LBB29_1
10004 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
10005 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
10006 ; GFX8-NEXT: s_setpc_b64 s[30:31]
10008 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
10010 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10011 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
10012 ; GFX7-NEXT: buffer_load_dword v4, v2, s[16:19], 0 offen offset:1024
10013 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
10014 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
10015 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
10016 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
10017 ; GFX7-NEXT: v_and_b32_e32 v2, 0xffff0000, v0
10018 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10019 ; GFX7-NEXT: s_waitcnt vmcnt(0)
10020 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v4
10021 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v4
10022 ; GFX7-NEXT: v_mov_b32_e32 v4, s6
10023 ; GFX7-NEXT: .LBB29_1: ; %atomicrmw.start
10024 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
10025 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
10026 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
10027 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v1
10028 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
10029 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
10030 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v3
10031 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v2
10032 ; GFX7-NEXT: v_alignbit_b32 v1, v1, v0, 16
10033 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v6
10034 ; GFX7-NEXT: v_alignbit_b32 v0, v0, v5, 16
10035 ; GFX7-NEXT: v_mov_b32_e32 v6, v1
10036 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
10037 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
10038 ; GFX7-NEXT: s_waitcnt vmcnt(0)
10039 ; GFX7-NEXT: buffer_wbinvl1
10040 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
10041 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v5
10042 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
10043 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v5
10044 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
10045 ; GFX7-NEXT: s_cbranch_execnz .LBB29_1
10046 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
10047 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
10048 ; GFX7-NEXT: s_setpc_b64 s[30:31]
10050 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset:
10052 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10053 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
10054 ; GFX6-NEXT: buffer_load_dword v4, v2, s[16:19], 0 offen offset:1024
10055 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
10056 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
10057 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
10058 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
10059 ; GFX6-NEXT: v_and_b32_e32 v2, 0xffff0000, v0
10060 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10061 ; GFX6-NEXT: s_waitcnt vmcnt(0)
10062 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v4
10063 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v4
10064 ; GFX6-NEXT: v_mov_b32_e32 v4, s6
10065 ; GFX6-NEXT: .LBB29_1: ; %atomicrmw.start
10066 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
10067 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
10068 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
10069 ; GFX6-NEXT: s_waitcnt expcnt(0)
10070 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v1
10071 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
10072 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v1
10073 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v3
10074 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v2
10075 ; GFX6-NEXT: v_alignbit_b32 v1, v1, v0, 16
10076 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, 16, v6
10077 ; GFX6-NEXT: v_alignbit_b32 v0, v0, v5, 16
10078 ; GFX6-NEXT: v_mov_b32_e32 v6, v1
10079 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
10080 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
10081 ; GFX6-NEXT: s_waitcnt vmcnt(0)
10082 ; GFX6-NEXT: buffer_wbinvl1
10083 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
10084 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v5
10085 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
10086 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v5
10087 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
10088 ; GFX6-NEXT: s_cbranch_execnz .LBB29_1
10089 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
10090 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
10091 ; GFX6-NEXT: s_waitcnt expcnt(0)
10092 ; GFX6-NEXT: s_setpc_b64 s[30:31]
10093 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
10094 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst
10095 ret <2 x bfloat> %result
10098 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) {
10099 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10101 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
10102 ; GFX12-NEXT: s_wait_expcnt 0x0
10103 ; GFX12-NEXT: s_wait_samplecnt 0x0
10104 ; GFX12-NEXT: s_wait_bvhcnt 0x0
10105 ; GFX12-NEXT: s_wait_kmcnt 0x0
10106 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
10107 ; GFX12-NEXT: s_wait_storecnt 0x0
10108 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024
10109 ; GFX12-NEXT: s_wait_storecnt 0x0
10110 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
10111 ; GFX12-NEXT: s_setpc_b64 s[30:31]
10113 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10115 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10116 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
10117 ; GFX940-NEXT: buffer_load_dword v1, v1, s[0:3], 0 offen offset:1024
10118 ; GFX940-NEXT: s_add_i32 s4, s16, 0x400
10119 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
10120 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v0
10121 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
10122 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
10123 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
10124 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
10125 ; GFX940-NEXT: .LBB30_1: ; %atomicrmw.start
10126 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
10127 ; GFX940-NEXT: s_waitcnt vmcnt(0)
10128 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10129 ; GFX940-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10130 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
10131 ; GFX940-NEXT: v_add_f32_e32 v5, v5, v3
10132 ; GFX940-NEXT: v_bfe_u32 v6, v0, 16, 1
10133 ; GFX940-NEXT: v_bfe_u32 v8, v5, 16, 1
10134 ; GFX940-NEXT: v_or_b32_e32 v7, 0x400000, v0
10135 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v5
10136 ; GFX940-NEXT: v_add3_u32 v6, v6, v0, s8
10137 ; GFX940-NEXT: v_add3_u32 v8, v8, v5, s8
10138 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
10139 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10140 ; GFX940-NEXT: buffer_wbl2 sc1
10141 ; GFX940-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
10142 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
10143 ; GFX940-NEXT: v_perm_b32 v0, v5, v0, s9
10144 ; GFX940-NEXT: v_mov_b64_e32 v[6:7], v[0:1]
10145 ; GFX940-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[0:3], 0 offen sc0
10146 ; GFX940-NEXT: s_waitcnt vmcnt(0)
10147 ; GFX940-NEXT: buffer_inv sc1
10148 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
10149 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10150 ; GFX940-NEXT: v_mov_b32_e32 v1, v6
10151 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
10152 ; GFX940-NEXT: s_cbranch_execnz .LBB30_1
10153 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
10154 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
10155 ; GFX940-NEXT: s_setpc_b64 s[30:31]
10157 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10159 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10160 ; GFX11-NEXT: v_dual_mov_b32 v1, s16 :: v_dual_lshlrev_b32 v2, 16, v0
10161 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
10162 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
10163 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_and_b32 v3, 0xffff0000, v0
10164 ; GFX11-NEXT: buffer_load_b32 v1, v1, s[0:3], 0 offen offset:1024
10165 ; GFX11-NEXT: s_mov_b32 s5, 0
10166 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
10167 ; GFX11-NEXT: .p2align 6
10168 ; GFX11-NEXT: .LBB30_1: ; %atomicrmw.start
10169 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
10170 ; GFX11-NEXT: s_waitcnt vmcnt(0)
10171 ; GFX11-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10172 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10173 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
10174 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
10175 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v3 :: v_dual_add_f32 v0, v0, v2
10176 ; GFX11-NEXT: v_bfe_u32 v7, v5, 16, 1
10177 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
10178 ; GFX11-NEXT: v_bfe_u32 v6, v0, 16, 1
10179 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
10180 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v5
10181 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
10182 ; GFX11-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
10183 ; GFX11-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
10184 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
10185 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
10186 ; GFX11-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
10187 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
10188 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
10189 ; GFX11-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
10190 ; GFX11-NEXT: v_dual_mov_b32 v6, v1 :: v_dual_mov_b32 v5, v0
10191 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[5:6], v4, s[0:3], 0 offen glc
10192 ; GFX11-NEXT: s_waitcnt vmcnt(0)
10193 ; GFX11-NEXT: buffer_gl1_inv
10194 ; GFX11-NEXT: buffer_gl0_inv
10195 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
10196 ; GFX11-NEXT: v_mov_b32_e32 v1, v5
10197 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
10198 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
10199 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
10200 ; GFX11-NEXT: s_cbranch_execnz .LBB30_1
10201 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
10202 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
10203 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
10204 ; GFX11-NEXT: s_setpc_b64 s[30:31]
10206 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10208 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10209 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
10210 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
10211 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v0
10212 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
10213 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
10214 ; GFX10-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
10215 ; GFX10-NEXT: s_mov_b32 s5, 0
10216 ; GFX10-NEXT: .LBB30_1: ; %atomicrmw.start
10217 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
10218 ; GFX10-NEXT: s_waitcnt vmcnt(0)
10219 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10220 ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10221 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
10222 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
10223 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v3
10224 ; GFX10-NEXT: v_bfe_u32 v6, v0, 16, 1
10225 ; GFX10-NEXT: v_bfe_u32 v7, v5, 16, 1
10226 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
10227 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v5
10228 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
10229 ; GFX10-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
10230 ; GFX10-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
10231 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
10232 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
10233 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
10234 ; GFX10-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
10235 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
10236 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
10237 ; GFX10-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
10238 ; GFX10-NEXT: s_waitcnt vmcnt(0)
10239 ; GFX10-NEXT: buffer_gl1_inv
10240 ; GFX10-NEXT: buffer_gl0_inv
10241 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
10242 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
10243 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
10244 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
10245 ; GFX10-NEXT: s_cbranch_execnz .LBB30_1
10246 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
10247 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
10248 ; GFX10-NEXT: s_setpc_b64 s[30:31]
10250 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10252 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10253 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
10254 ; GFX90A-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
10255 ; GFX90A-NEXT: s_add_i32 s4, s20, 0x400
10256 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
10257 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v0
10258 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
10259 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
10260 ; GFX90A-NEXT: s_mov_b32 s9, 0x7060302
10261 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
10262 ; GFX90A-NEXT: .LBB30_1: ; %atomicrmw.start
10263 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
10264 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
10265 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10266 ; GFX90A-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10267 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
10268 ; GFX90A-NEXT: v_add_f32_e32 v5, v5, v3
10269 ; GFX90A-NEXT: v_bfe_u32 v6, v0, 16, 1
10270 ; GFX90A-NEXT: v_bfe_u32 v8, v5, 16, 1
10271 ; GFX90A-NEXT: v_or_b32_e32 v7, 0x400000, v0
10272 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v5
10273 ; GFX90A-NEXT: v_add3_u32 v6, v6, v0, s8
10274 ; GFX90A-NEXT: v_add3_u32 v8, v8, v5, s8
10275 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
10276 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10277 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
10278 ; GFX90A-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
10279 ; GFX90A-NEXT: v_perm_b32 v0, v5, v0, s9
10280 ; GFX90A-NEXT: v_pk_mov_b32 v[6:7], v[0:1], v[0:1] op_sel:[0,1]
10281 ; GFX90A-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[16:19], 0 offen glc
10282 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
10283 ; GFX90A-NEXT: buffer_wbinvl1
10284 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
10285 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10286 ; GFX90A-NEXT: v_mov_b32_e32 v1, v6
10287 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
10288 ; GFX90A-NEXT: s_cbranch_execnz .LBB30_1
10289 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
10290 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
10291 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
10293 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10295 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10296 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
10297 ; GFX908-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
10298 ; GFX908-NEXT: s_add_i32 s4, s20, 0x400
10299 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
10300 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v0
10301 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
10302 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
10303 ; GFX908-NEXT: s_mov_b32 s9, 0x7060302
10304 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
10305 ; GFX908-NEXT: .LBB30_1: ; %atomicrmw.start
10306 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
10307 ; GFX908-NEXT: s_waitcnt vmcnt(0)
10308 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10309 ; GFX908-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10310 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
10311 ; GFX908-NEXT: v_add_f32_e32 v5, v5, v3
10312 ; GFX908-NEXT: v_bfe_u32 v6, v0, 16, 1
10313 ; GFX908-NEXT: v_bfe_u32 v8, v5, 16, 1
10314 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
10315 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v5
10316 ; GFX908-NEXT: v_add3_u32 v6, v6, v0, s8
10317 ; GFX908-NEXT: v_add3_u32 v8, v8, v5, s8
10318 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
10319 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10320 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
10321 ; GFX908-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
10322 ; GFX908-NEXT: v_perm_b32 v0, v5, v0, s9
10323 ; GFX908-NEXT: v_mov_b32_e32 v6, v1
10324 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
10325 ; GFX908-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
10326 ; GFX908-NEXT: s_waitcnt vmcnt(0)
10327 ; GFX908-NEXT: buffer_wbinvl1
10328 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
10329 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10330 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
10331 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
10332 ; GFX908-NEXT: s_cbranch_execnz .LBB30_1
10333 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
10334 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
10335 ; GFX908-NEXT: s_setpc_b64 s[30:31]
10337 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10339 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10340 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
10341 ; GFX8-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
10342 ; GFX8-NEXT: s_add_i32 s4, s20, 0x400
10343 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
10344 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v0
10345 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
10346 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
10347 ; GFX8-NEXT: .LBB30_1: ; %atomicrmw.start
10348 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
10349 ; GFX8-NEXT: s_waitcnt vmcnt(0)
10350 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10351 ; GFX8-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10352 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
10353 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v3
10354 ; GFX8-NEXT: v_bfe_u32 v6, v0, 16, 1
10355 ; GFX8-NEXT: v_bfe_u32 v8, v5, 16, 1
10356 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v0
10357 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v5
10358 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
10359 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
10360 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v5
10361 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
10362 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
10363 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10364 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
10365 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
10366 ; GFX8-NEXT: v_lshrrev_b32_e32 v5, 16, v5
10367 ; GFX8-NEXT: v_alignbit_b32 v0, v5, v0, 16
10368 ; GFX8-NEXT: v_mov_b32_e32 v6, v1
10369 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
10370 ; GFX8-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
10371 ; GFX8-NEXT: s_waitcnt vmcnt(0)
10372 ; GFX8-NEXT: buffer_wbinvl1
10373 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
10374 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10375 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
10376 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
10377 ; GFX8-NEXT: s_cbranch_execnz .LBB30_1
10378 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
10379 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
10380 ; GFX8-NEXT: s_setpc_b64 s[30:31]
10382 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10384 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10385 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
10386 ; GFX7-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
10387 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
10388 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
10389 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
10390 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
10391 ; GFX7-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
10392 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
10393 ; GFX7-NEXT: s_waitcnt vmcnt(0)
10394 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
10395 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v2
10396 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
10397 ; GFX7-NEXT: .LBB30_1: ; %atomicrmw.start
10398 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
10399 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
10400 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v4
10401 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
10402 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
10403 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
10404 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
10405 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
10406 ; GFX7-NEXT: v_alignbit_b32 v4, v3, v4, 16
10407 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v6
10408 ; GFX7-NEXT: v_alignbit_b32 v3, v3, v5, 16
10409 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
10410 ; GFX7-NEXT: v_mov_b32_e32 v5, v3
10411 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[16:19], 0 offen glc
10412 ; GFX7-NEXT: s_waitcnt vmcnt(0)
10413 ; GFX7-NEXT: buffer_wbinvl1
10414 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
10415 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
10416 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
10417 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v5
10418 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
10419 ; GFX7-NEXT: s_cbranch_execnz .LBB30_1
10420 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
10421 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
10422 ; GFX7-NEXT: s_setpc_b64 s[30:31]
10424 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset:
10426 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10427 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
10428 ; GFX6-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
10429 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
10430 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
10431 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
10432 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
10433 ; GFX6-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
10434 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
10435 ; GFX6-NEXT: s_waitcnt vmcnt(0)
10436 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
10437 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v2
10438 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
10439 ; GFX6-NEXT: .LBB30_1: ; %atomicrmw.start
10440 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
10441 ; GFX6-NEXT: v_mul_f32_e32 v3, 1.0, v3
10442 ; GFX6-NEXT: v_mul_f32_e32 v4, 1.0, v4
10443 ; GFX6-NEXT: s_waitcnt expcnt(0)
10444 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
10445 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
10446 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v3
10447 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
10448 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
10449 ; GFX6-NEXT: v_alignbit_b32 v4, v3, v4, 16
10450 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v6
10451 ; GFX6-NEXT: v_alignbit_b32 v3, v3, v5, 16
10452 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
10453 ; GFX6-NEXT: v_mov_b32_e32 v5, v3
10454 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[16:19], 0 offen glc
10455 ; GFX6-NEXT: s_waitcnt vmcnt(0)
10456 ; GFX6-NEXT: buffer_wbinvl1
10457 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
10458 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
10459 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
10460 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v5
10461 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
10462 ; GFX6-NEXT: s_cbranch_execnz .LBB30_1
10463 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
10464 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
10465 ; GFX6-NEXT: s_waitcnt expcnt(0)
10466 ; GFX6-NEXT: s_setpc_b64 s[30:31]
10467 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
10468 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst
10472 define <2 x bfloat> @buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) #0 {
10473 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10475 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
10476 ; GFX12-NEXT: s_wait_expcnt 0x0
10477 ; GFX12-NEXT: s_wait_samplecnt 0x0
10478 ; GFX12-NEXT: s_wait_bvhcnt 0x0
10479 ; GFX12-NEXT: s_wait_kmcnt 0x0
10480 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
10481 ; GFX12-NEXT: s_wait_storecnt 0x0
10482 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
10483 ; GFX12-NEXT: s_wait_loadcnt 0x0
10484 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
10485 ; GFX12-NEXT: s_setpc_b64 s[30:31]
10487 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10489 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10490 ; GFX940-NEXT: v_mov_b32_e32 v1, v0
10491 ; GFX940-NEXT: v_mov_b32_e32 v0, s16
10492 ; GFX940-NEXT: buffer_load_dword v0, v0, s[0:3], 0 offen offset:1024
10493 ; GFX940-NEXT: s_add_i32 s4, s16, 0x400
10494 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
10495 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v1
10496 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
10497 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10498 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
10499 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
10500 ; GFX940-NEXT: .LBB31_1: ; %atomicrmw.start
10501 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
10502 ; GFX940-NEXT: s_waitcnt vmcnt(0)
10503 ; GFX940-NEXT: v_mov_b32_e32 v7, v0
10504 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v7
10505 ; GFX940-NEXT: v_and_b32_e32 v1, 0xffff0000, v7
10506 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
10507 ; GFX940-NEXT: v_add_f32_e32 v1, v1, v3
10508 ; GFX940-NEXT: v_bfe_u32 v5, v0, 16, 1
10509 ; GFX940-NEXT: v_bfe_u32 v8, v1, 16, 1
10510 ; GFX940-NEXT: v_or_b32_e32 v6, 0x400000, v0
10511 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v1
10512 ; GFX940-NEXT: v_add3_u32 v5, v5, v0, s8
10513 ; GFX940-NEXT: v_add3_u32 v8, v8, v1, s8
10514 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
10515 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10516 ; GFX940-NEXT: buffer_wbl2 sc1
10517 ; GFX940-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
10518 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v5, v6, s[4:5]
10519 ; GFX940-NEXT: v_perm_b32 v6, v1, v0, s9
10520 ; GFX940-NEXT: v_mov_b64_e32 v[0:1], v[6:7]
10521 ; GFX940-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[0:3], 0 offen sc0
10522 ; GFX940-NEXT: s_waitcnt vmcnt(0)
10523 ; GFX940-NEXT: buffer_inv sc1
10524 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v0, v7
10525 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10526 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
10527 ; GFX940-NEXT: s_cbranch_execnz .LBB31_1
10528 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
10529 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
10530 ; GFX940-NEXT: s_setpc_b64 s[30:31]
10532 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10534 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10535 ; GFX11-NEXT: v_dual_mov_b32 v1, v0 :: v_dual_mov_b32 v0, s16
10536 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
10537 ; GFX11-NEXT: s_mov_b32 s5, 0
10538 ; GFX11-NEXT: v_mov_b32_e32 v4, s4
10539 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
10540 ; GFX11-NEXT: v_lshlrev_b32_e32 v2, 16, v1
10541 ; GFX11-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen offset:1024
10542 ; GFX11-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10543 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
10544 ; GFX11-NEXT: .p2align 6
10545 ; GFX11-NEXT: .LBB31_1: ; %atomicrmw.start
10546 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
10547 ; GFX11-NEXT: s_waitcnt vmcnt(0)
10548 ; GFX11-NEXT: v_mov_b32_e32 v6, v0
10549 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
10550 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
10551 ; GFX11-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
10552 ; GFX11-NEXT: v_add_f32_e32 v1, v1, v3
10553 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
10554 ; GFX11-NEXT: v_bfe_u32 v7, v1, 16, 1
10555 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v1
10556 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
10557 ; GFX11-NEXT: v_add3_u32 v7, v7, v1, 0x7fff
10558 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
10559 ; GFX11-NEXT: v_dual_cndmask_b32 v1, v7, v9 :: v_dual_lshlrev_b32 v0, 16, v6
10560 ; GFX11-NEXT: v_add_f32_e32 v0, v0, v2
10561 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
10562 ; GFX11-NEXT: v_bfe_u32 v5, v0, 16, 1
10563 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
10564 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
10565 ; GFX11-NEXT: v_add3_u32 v5, v5, v0, 0x7fff
10566 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
10567 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v5, v8, s4
10568 ; GFX11-NEXT: v_perm_b32 v5, v1, v0, 0x7060302
10569 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
10570 ; GFX11-NEXT: v_dual_mov_b32 v0, v5 :: v_dual_mov_b32 v1, v6
10571 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[0:1], v4, s[0:3], 0 offen glc
10572 ; GFX11-NEXT: s_waitcnt vmcnt(0)
10573 ; GFX11-NEXT: buffer_gl1_inv
10574 ; GFX11-NEXT: buffer_gl0_inv
10575 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v6
10576 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
10577 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
10578 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
10579 ; GFX11-NEXT: s_cbranch_execnz .LBB31_1
10580 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
10581 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
10582 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
10583 ; GFX11-NEXT: s_setpc_b64 s[30:31]
10585 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10587 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10588 ; GFX10-NEXT: v_mov_b32_e32 v1, v0
10589 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
10590 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
10591 ; GFX10-NEXT: s_mov_b32 s5, 0
10592 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
10593 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v1
10594 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
10595 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10596 ; GFX10-NEXT: .LBB31_1: ; %atomicrmw.start
10597 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
10598 ; GFX10-NEXT: s_waitcnt vmcnt(0)
10599 ; GFX10-NEXT: v_mov_b32_e32 v6, v0
10600 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
10601 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v6
10602 ; GFX10-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
10603 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
10604 ; GFX10-NEXT: v_add_f32_e32 v1, v1, v3
10605 ; GFX10-NEXT: v_bfe_u32 v5, v0, 16, 1
10606 ; GFX10-NEXT: v_bfe_u32 v7, v1, 16, 1
10607 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
10608 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v1
10609 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v1, v1
10610 ; GFX10-NEXT: v_add3_u32 v5, v5, v0, 0x7fff
10611 ; GFX10-NEXT: v_add3_u32 v7, v7, v1, 0x7fff
10612 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
10613 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v7, v9, vcc_lo
10614 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v5, v8, s4
10615 ; GFX10-NEXT: v_perm_b32 v5, v1, v0, 0x7060302
10616 ; GFX10-NEXT: v_mov_b32_e32 v0, v5
10617 ; GFX10-NEXT: v_mov_b32_e32 v1, v6
10618 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
10619 ; GFX10-NEXT: s_waitcnt vmcnt(0)
10620 ; GFX10-NEXT: buffer_gl1_inv
10621 ; GFX10-NEXT: buffer_gl0_inv
10622 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v6
10623 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
10624 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
10625 ; GFX10-NEXT: s_cbranch_execnz .LBB31_1
10626 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
10627 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
10628 ; GFX10-NEXT: s_setpc_b64 s[30:31]
10630 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10632 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10633 ; GFX90A-NEXT: v_mov_b32_e32 v1, v0
10634 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
10635 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
10636 ; GFX90A-NEXT: s_add_i32 s4, s20, 0x400
10637 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
10638 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v1
10639 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
10640 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10641 ; GFX90A-NEXT: s_mov_b32 s9, 0x7060302
10642 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
10643 ; GFX90A-NEXT: .LBB31_1: ; %atomicrmw.start
10644 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
10645 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
10646 ; GFX90A-NEXT: v_mov_b32_e32 v7, v0
10647 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v7
10648 ; GFX90A-NEXT: v_and_b32_e32 v1, 0xffff0000, v7
10649 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
10650 ; GFX90A-NEXT: v_add_f32_e32 v1, v1, v3
10651 ; GFX90A-NEXT: v_bfe_u32 v5, v0, 16, 1
10652 ; GFX90A-NEXT: v_bfe_u32 v8, v1, 16, 1
10653 ; GFX90A-NEXT: v_or_b32_e32 v6, 0x400000, v0
10654 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v1
10655 ; GFX90A-NEXT: v_add3_u32 v5, v5, v0, s8
10656 ; GFX90A-NEXT: v_add3_u32 v8, v8, v1, s8
10657 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
10658 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10659 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v5, v6, s[4:5]
10660 ; GFX90A-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
10661 ; GFX90A-NEXT: v_perm_b32 v6, v1, v0, s9
10662 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[6:7], v[6:7] op_sel:[0,1]
10663 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
10664 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
10665 ; GFX90A-NEXT: buffer_wbinvl1
10666 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v7
10667 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10668 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
10669 ; GFX90A-NEXT: s_cbranch_execnz .LBB31_1
10670 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
10671 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
10672 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
10674 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10676 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10677 ; GFX908-NEXT: v_mov_b32_e32 v1, v0
10678 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
10679 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
10680 ; GFX908-NEXT: s_add_i32 s4, s20, 0x400
10681 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
10682 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v1
10683 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
10684 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10685 ; GFX908-NEXT: s_mov_b32 s9, 0x7060302
10686 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
10687 ; GFX908-NEXT: .LBB31_1: ; %atomicrmw.start
10688 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
10689 ; GFX908-NEXT: s_waitcnt vmcnt(0)
10690 ; GFX908-NEXT: v_mov_b32_e32 v6, v0
10691 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v6
10692 ; GFX908-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
10693 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
10694 ; GFX908-NEXT: v_add_f32_e32 v1, v1, v3
10695 ; GFX908-NEXT: v_bfe_u32 v5, v0, 16, 1
10696 ; GFX908-NEXT: v_bfe_u32 v8, v1, 16, 1
10697 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
10698 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v1
10699 ; GFX908-NEXT: v_add3_u32 v5, v5, v0, s8
10700 ; GFX908-NEXT: v_add3_u32 v8, v8, v1, s8
10701 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
10702 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10703 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v5, v7, s[4:5]
10704 ; GFX908-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
10705 ; GFX908-NEXT: v_perm_b32 v5, v1, v0, s9
10706 ; GFX908-NEXT: v_mov_b32_e32 v0, v5
10707 ; GFX908-NEXT: v_mov_b32_e32 v1, v6
10708 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
10709 ; GFX908-NEXT: s_waitcnt vmcnt(0)
10710 ; GFX908-NEXT: buffer_wbinvl1
10711 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v6
10712 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10713 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
10714 ; GFX908-NEXT: s_cbranch_execnz .LBB31_1
10715 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
10716 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
10717 ; GFX908-NEXT: s_setpc_b64 s[30:31]
10719 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10721 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10722 ; GFX8-NEXT: v_mov_b32_e32 v1, v0
10723 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
10724 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
10725 ; GFX8-NEXT: s_add_i32 s4, s20, 0x400
10726 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
10727 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v1
10728 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10729 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
10730 ; GFX8-NEXT: .LBB31_1: ; %atomicrmw.start
10731 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
10732 ; GFX8-NEXT: s_waitcnt vmcnt(0)
10733 ; GFX8-NEXT: v_mov_b32_e32 v6, v0
10734 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v6
10735 ; GFX8-NEXT: v_and_b32_e32 v1, 0xffff0000, v6
10736 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
10737 ; GFX8-NEXT: v_add_f32_e32 v1, v1, v3
10738 ; GFX8-NEXT: v_bfe_u32 v5, v0, 16, 1
10739 ; GFX8-NEXT: v_bfe_u32 v8, v1, 16, 1
10740 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, v5, v0
10741 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v1
10742 ; GFX8-NEXT: v_add_u32_e32 v5, vcc, 0x7fff, v5
10743 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
10744 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v1
10745 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v1, v1
10746 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
10747 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10748 ; GFX8-NEXT: v_cndmask_b32_e32 v1, v8, v9, vcc
10749 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v5, v7, s[4:5]
10750 ; GFX8-NEXT: v_lshrrev_b32_e32 v1, 16, v1
10751 ; GFX8-NEXT: v_alignbit_b32 v5, v1, v0, 16
10752 ; GFX8-NEXT: v_mov_b32_e32 v0, v5
10753 ; GFX8-NEXT: v_mov_b32_e32 v1, v6
10754 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v4, s[16:19], 0 offen glc
10755 ; GFX8-NEXT: s_waitcnt vmcnt(0)
10756 ; GFX8-NEXT: buffer_wbinvl1
10757 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v6
10758 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10759 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
10760 ; GFX8-NEXT: s_cbranch_execnz .LBB31_1
10761 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
10762 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
10763 ; GFX8-NEXT: s_setpc_b64 s[30:31]
10765 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10767 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10768 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
10769 ; GFX7-NEXT: buffer_load_dword v4, v2, s[16:19], 0 offen offset:1024
10770 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
10771 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
10772 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
10773 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
10774 ; GFX7-NEXT: v_and_b32_e32 v2, 0xffff0000, v0
10775 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10776 ; GFX7-NEXT: s_waitcnt vmcnt(0)
10777 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v4
10778 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v4
10779 ; GFX7-NEXT: v_mov_b32_e32 v4, s6
10780 ; GFX7-NEXT: .LBB31_1: ; %atomicrmw.start
10781 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
10782 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
10783 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
10784 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v1
10785 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
10786 ; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1
10787 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v3
10788 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v2
10789 ; GFX7-NEXT: v_alignbit_b32 v1, v1, v0, 16
10790 ; GFX7-NEXT: v_lshrrev_b32_e32 v0, 16, v6
10791 ; GFX7-NEXT: v_alignbit_b32 v0, v0, v5, 16
10792 ; GFX7-NEXT: v_mov_b32_e32 v6, v1
10793 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
10794 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
10795 ; GFX7-NEXT: s_waitcnt vmcnt(0)
10796 ; GFX7-NEXT: buffer_wbinvl1
10797 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
10798 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v5
10799 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
10800 ; GFX7-NEXT: v_lshlrev_b32_e32 v0, 16, v5
10801 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
10802 ; GFX7-NEXT: s_cbranch_execnz .LBB31_1
10803 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
10804 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
10805 ; GFX7-NEXT: s_setpc_b64 s[30:31]
10807 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_ret_v2bf16__offset__amdgpu_no_remote_memory:
10809 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10810 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
10811 ; GFX6-NEXT: buffer_load_dword v4, v2, s[16:19], 0 offen offset:1024
10812 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
10813 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
10814 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
10815 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
10816 ; GFX6-NEXT: v_and_b32_e32 v2, 0xffff0000, v0
10817 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v1
10818 ; GFX6-NEXT: s_waitcnt vmcnt(0)
10819 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v4
10820 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v4
10821 ; GFX6-NEXT: v_mov_b32_e32 v4, s6
10822 ; GFX6-NEXT: .LBB31_1: ; %atomicrmw.start
10823 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
10824 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
10825 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
10826 ; GFX6-NEXT: s_waitcnt expcnt(0)
10827 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v1
10828 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v0
10829 ; GFX6-NEXT: v_lshrrev_b32_e32 v1, 16, v1
10830 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v3
10831 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v2
10832 ; GFX6-NEXT: v_alignbit_b32 v1, v1, v0, 16
10833 ; GFX6-NEXT: v_lshrrev_b32_e32 v0, 16, v6
10834 ; GFX6-NEXT: v_alignbit_b32 v0, v0, v5, 16
10835 ; GFX6-NEXT: v_mov_b32_e32 v6, v1
10836 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
10837 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
10838 ; GFX6-NEXT: s_waitcnt vmcnt(0)
10839 ; GFX6-NEXT: buffer_wbinvl1
10840 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
10841 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v5
10842 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
10843 ; GFX6-NEXT: v_lshlrev_b32_e32 v0, 16, v5
10844 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
10845 ; GFX6-NEXT: s_cbranch_execnz .LBB31_1
10846 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
10847 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
10848 ; GFX6-NEXT: s_waitcnt expcnt(0)
10849 ; GFX6-NEXT: s_setpc_b64 s[30:31]
10850 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
10851 %result = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst, !amdgpu.no.remote.memory !0
10852 ret <2 x bfloat> %result
10855 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) #0 {
10856 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
10858 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
10859 ; GFX12-NEXT: s_wait_expcnt 0x0
10860 ; GFX12-NEXT: s_wait_samplecnt 0x0
10861 ; GFX12-NEXT: s_wait_bvhcnt 0x0
10862 ; GFX12-NEXT: s_wait_kmcnt 0x0
10863 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
10864 ; GFX12-NEXT: s_wait_storecnt 0x0
10865 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024
10866 ; GFX12-NEXT: s_wait_storecnt 0x0
10867 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
10868 ; GFX12-NEXT: s_setpc_b64 s[30:31]
10870 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
10872 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10873 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
10874 ; GFX940-NEXT: buffer_load_dword v1, v1, s[0:3], 0 offen offset:1024
10875 ; GFX940-NEXT: s_add_i32 s4, s16, 0x400
10876 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
10877 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v0
10878 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
10879 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
10880 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
10881 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
10882 ; GFX940-NEXT: .LBB32_1: ; %atomicrmw.start
10883 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
10884 ; GFX940-NEXT: s_waitcnt vmcnt(0)
10885 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10886 ; GFX940-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10887 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
10888 ; GFX940-NEXT: v_add_f32_e32 v5, v5, v3
10889 ; GFX940-NEXT: v_bfe_u32 v6, v0, 16, 1
10890 ; GFX940-NEXT: v_bfe_u32 v8, v5, 16, 1
10891 ; GFX940-NEXT: v_or_b32_e32 v7, 0x400000, v0
10892 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v5
10893 ; GFX940-NEXT: v_add3_u32 v6, v6, v0, s8
10894 ; GFX940-NEXT: v_add3_u32 v8, v8, v5, s8
10895 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
10896 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
10897 ; GFX940-NEXT: buffer_wbl2 sc1
10898 ; GFX940-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
10899 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
10900 ; GFX940-NEXT: v_perm_b32 v0, v5, v0, s9
10901 ; GFX940-NEXT: v_mov_b64_e32 v[6:7], v[0:1]
10902 ; GFX940-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[0:3], 0 offen sc0
10903 ; GFX940-NEXT: s_waitcnt vmcnt(0)
10904 ; GFX940-NEXT: buffer_inv sc1
10905 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
10906 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
10907 ; GFX940-NEXT: v_mov_b32_e32 v1, v6
10908 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
10909 ; GFX940-NEXT: s_cbranch_execnz .LBB32_1
10910 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
10911 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
10912 ; GFX940-NEXT: s_setpc_b64 s[30:31]
10914 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
10916 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10917 ; GFX11-NEXT: v_dual_mov_b32 v1, s16 :: v_dual_lshlrev_b32 v2, 16, v0
10918 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
10919 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
10920 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_and_b32 v3, 0xffff0000, v0
10921 ; GFX11-NEXT: buffer_load_b32 v1, v1, s[0:3], 0 offen offset:1024
10922 ; GFX11-NEXT: s_mov_b32 s5, 0
10923 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
10924 ; GFX11-NEXT: .p2align 6
10925 ; GFX11-NEXT: .LBB32_1: ; %atomicrmw.start
10926 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
10927 ; GFX11-NEXT: s_waitcnt vmcnt(0)
10928 ; GFX11-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10929 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10930 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
10931 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
10932 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v3 :: v_dual_add_f32 v0, v0, v2
10933 ; GFX11-NEXT: v_bfe_u32 v7, v5, 16, 1
10934 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
10935 ; GFX11-NEXT: v_bfe_u32 v6, v0, 16, 1
10936 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
10937 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v5
10938 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
10939 ; GFX11-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
10940 ; GFX11-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
10941 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
10942 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
10943 ; GFX11-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
10944 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
10945 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
10946 ; GFX11-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
10947 ; GFX11-NEXT: v_dual_mov_b32 v6, v1 :: v_dual_mov_b32 v5, v0
10948 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[5:6], v4, s[0:3], 0 offen glc
10949 ; GFX11-NEXT: s_waitcnt vmcnt(0)
10950 ; GFX11-NEXT: buffer_gl1_inv
10951 ; GFX11-NEXT: buffer_gl0_inv
10952 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
10953 ; GFX11-NEXT: v_mov_b32_e32 v1, v5
10954 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
10955 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
10956 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
10957 ; GFX11-NEXT: s_cbranch_execnz .LBB32_1
10958 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
10959 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
10960 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
10961 ; GFX11-NEXT: s_setpc_b64 s[30:31]
10963 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
10965 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
10966 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
10967 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
10968 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v0
10969 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
10970 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
10971 ; GFX10-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
10972 ; GFX10-NEXT: s_mov_b32 s5, 0
10973 ; GFX10-NEXT: .LBB32_1: ; %atomicrmw.start
10974 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
10975 ; GFX10-NEXT: s_waitcnt vmcnt(0)
10976 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v1
10977 ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
10978 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
10979 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
10980 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v3
10981 ; GFX10-NEXT: v_bfe_u32 v6, v0, 16, 1
10982 ; GFX10-NEXT: v_bfe_u32 v7, v5, 16, 1
10983 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
10984 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v5
10985 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
10986 ; GFX10-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
10987 ; GFX10-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
10988 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
10989 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
10990 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
10991 ; GFX10-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
10992 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
10993 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
10994 ; GFX10-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
10995 ; GFX10-NEXT: s_waitcnt vmcnt(0)
10996 ; GFX10-NEXT: buffer_gl1_inv
10997 ; GFX10-NEXT: buffer_gl0_inv
10998 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
10999 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
11000 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
11001 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
11002 ; GFX10-NEXT: s_cbranch_execnz .LBB32_1
11003 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
11004 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
11005 ; GFX10-NEXT: s_setpc_b64 s[30:31]
11007 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
11009 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11010 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
11011 ; GFX90A-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
11012 ; GFX90A-NEXT: s_add_i32 s4, s20, 0x400
11013 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
11014 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v0
11015 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
11016 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
11017 ; GFX90A-NEXT: s_mov_b32 s9, 0x7060302
11018 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
11019 ; GFX90A-NEXT: .LBB32_1: ; %atomicrmw.start
11020 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
11021 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
11022 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11023 ; GFX90A-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11024 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
11025 ; GFX90A-NEXT: v_add_f32_e32 v5, v5, v3
11026 ; GFX90A-NEXT: v_bfe_u32 v6, v0, 16, 1
11027 ; GFX90A-NEXT: v_bfe_u32 v8, v5, 16, 1
11028 ; GFX90A-NEXT: v_or_b32_e32 v7, 0x400000, v0
11029 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v5
11030 ; GFX90A-NEXT: v_add3_u32 v6, v6, v0, s8
11031 ; GFX90A-NEXT: v_add3_u32 v8, v8, v5, s8
11032 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
11033 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
11034 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
11035 ; GFX90A-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
11036 ; GFX90A-NEXT: v_perm_b32 v0, v5, v0, s9
11037 ; GFX90A-NEXT: v_pk_mov_b32 v[6:7], v[0:1], v[0:1] op_sel:[0,1]
11038 ; GFX90A-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[16:19], 0 offen glc
11039 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
11040 ; GFX90A-NEXT: buffer_wbinvl1
11041 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
11042 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
11043 ; GFX90A-NEXT: v_mov_b32_e32 v1, v6
11044 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
11045 ; GFX90A-NEXT: s_cbranch_execnz .LBB32_1
11046 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
11047 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
11048 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
11050 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
11052 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11053 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
11054 ; GFX908-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
11055 ; GFX908-NEXT: s_add_i32 s4, s20, 0x400
11056 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
11057 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v0
11058 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
11059 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
11060 ; GFX908-NEXT: s_mov_b32 s9, 0x7060302
11061 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
11062 ; GFX908-NEXT: .LBB32_1: ; %atomicrmw.start
11063 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
11064 ; GFX908-NEXT: s_waitcnt vmcnt(0)
11065 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11066 ; GFX908-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11067 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
11068 ; GFX908-NEXT: v_add_f32_e32 v5, v5, v3
11069 ; GFX908-NEXT: v_bfe_u32 v6, v0, 16, 1
11070 ; GFX908-NEXT: v_bfe_u32 v8, v5, 16, 1
11071 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
11072 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v5
11073 ; GFX908-NEXT: v_add3_u32 v6, v6, v0, s8
11074 ; GFX908-NEXT: v_add3_u32 v8, v8, v5, s8
11075 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
11076 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
11077 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
11078 ; GFX908-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
11079 ; GFX908-NEXT: v_perm_b32 v0, v5, v0, s9
11080 ; GFX908-NEXT: v_mov_b32_e32 v6, v1
11081 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
11082 ; GFX908-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
11083 ; GFX908-NEXT: s_waitcnt vmcnt(0)
11084 ; GFX908-NEXT: buffer_wbinvl1
11085 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
11086 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
11087 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
11088 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
11089 ; GFX908-NEXT: s_cbranch_execnz .LBB32_1
11090 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
11091 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
11092 ; GFX908-NEXT: s_setpc_b64 s[30:31]
11094 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
11096 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11097 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
11098 ; GFX8-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
11099 ; GFX8-NEXT: s_add_i32 s4, s20, 0x400
11100 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
11101 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v0
11102 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
11103 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
11104 ; GFX8-NEXT: .LBB32_1: ; %atomicrmw.start
11105 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
11106 ; GFX8-NEXT: s_waitcnt vmcnt(0)
11107 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11108 ; GFX8-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11109 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
11110 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v3
11111 ; GFX8-NEXT: v_bfe_u32 v6, v0, 16, 1
11112 ; GFX8-NEXT: v_bfe_u32 v8, v5, 16, 1
11113 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v0
11114 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v5
11115 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
11116 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
11117 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v5
11118 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
11119 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
11120 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
11121 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
11122 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
11123 ; GFX8-NEXT: v_lshrrev_b32_e32 v5, 16, v5
11124 ; GFX8-NEXT: v_alignbit_b32 v0, v5, v0, 16
11125 ; GFX8-NEXT: v_mov_b32_e32 v6, v1
11126 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
11127 ; GFX8-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
11128 ; GFX8-NEXT: s_waitcnt vmcnt(0)
11129 ; GFX8-NEXT: buffer_wbinvl1
11130 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
11131 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
11132 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
11133 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
11134 ; GFX8-NEXT: s_cbranch_execnz .LBB32_1
11135 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
11136 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
11137 ; GFX8-NEXT: s_setpc_b64 s[30:31]
11139 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
11141 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11142 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
11143 ; GFX7-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
11144 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
11145 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
11146 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
11147 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
11148 ; GFX7-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
11149 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
11150 ; GFX7-NEXT: s_waitcnt vmcnt(0)
11151 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
11152 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v2
11153 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
11154 ; GFX7-NEXT: .LBB32_1: ; %atomicrmw.start
11155 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
11156 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
11157 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v4
11158 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
11159 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
11160 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
11161 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
11162 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
11163 ; GFX7-NEXT: v_alignbit_b32 v4, v3, v4, 16
11164 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v6
11165 ; GFX7-NEXT: v_alignbit_b32 v3, v3, v5, 16
11166 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
11167 ; GFX7-NEXT: v_mov_b32_e32 v5, v3
11168 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[16:19], 0 offen glc
11169 ; GFX7-NEXT: s_waitcnt vmcnt(0)
11170 ; GFX7-NEXT: buffer_wbinvl1
11171 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
11172 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
11173 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11174 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v5
11175 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
11176 ; GFX7-NEXT: s_cbranch_execnz .LBB32_1
11177 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
11178 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
11179 ; GFX7-NEXT: s_setpc_b64 s[30:31]
11181 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_remote_memory:
11183 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11184 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
11185 ; GFX6-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
11186 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
11187 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
11188 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
11189 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
11190 ; GFX6-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
11191 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
11192 ; GFX6-NEXT: s_waitcnt vmcnt(0)
11193 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
11194 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v2
11195 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
11196 ; GFX6-NEXT: .LBB32_1: ; %atomicrmw.start
11197 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
11198 ; GFX6-NEXT: v_mul_f32_e32 v3, 1.0, v3
11199 ; GFX6-NEXT: v_mul_f32_e32 v4, 1.0, v4
11200 ; GFX6-NEXT: s_waitcnt expcnt(0)
11201 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
11202 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
11203 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v3
11204 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
11205 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
11206 ; GFX6-NEXT: v_alignbit_b32 v4, v3, v4, 16
11207 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v6
11208 ; GFX6-NEXT: v_alignbit_b32 v3, v3, v5, 16
11209 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
11210 ; GFX6-NEXT: v_mov_b32_e32 v5, v3
11211 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[16:19], 0 offen glc
11212 ; GFX6-NEXT: s_waitcnt vmcnt(0)
11213 ; GFX6-NEXT: buffer_wbinvl1
11214 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
11215 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
11216 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11217 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v5
11218 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
11219 ; GFX6-NEXT: s_cbranch_execnz .LBB32_1
11220 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
11221 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
11222 ; GFX6-NEXT: s_waitcnt expcnt(0)
11223 ; GFX6-NEXT: s_setpc_b64 s[30:31]
11224 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
11225 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst, !amdgpu.no.remote.memory !0
11229 define void @buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory(ptr addrspace(7) inreg %ptr, <2 x bfloat> %val) #0 {
11230 ; GFX12-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11232 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
11233 ; GFX12-NEXT: s_wait_expcnt 0x0
11234 ; GFX12-NEXT: s_wait_samplecnt 0x0
11235 ; GFX12-NEXT: s_wait_bvhcnt 0x0
11236 ; GFX12-NEXT: s_wait_kmcnt 0x0
11237 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
11238 ; GFX12-NEXT: s_wait_storecnt 0x0
11239 ; GFX12-NEXT: buffer_atomic_pk_add_bf16 v0, v1, s[0:3], null offen offset:1024
11240 ; GFX12-NEXT: s_wait_storecnt 0x0
11241 ; GFX12-NEXT: global_inv scope:SCOPE_DEV
11242 ; GFX12-NEXT: s_setpc_b64 s[30:31]
11244 ; GFX940-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11246 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11247 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
11248 ; GFX940-NEXT: buffer_load_dword v1, v1, s[0:3], 0 offen offset:1024
11249 ; GFX940-NEXT: s_add_i32 s4, s16, 0x400
11250 ; GFX940-NEXT: s_mov_b64 s[6:7], 0
11251 ; GFX940-NEXT: v_lshlrev_b32_e32 v2, 16, v0
11252 ; GFX940-NEXT: s_movk_i32 s8, 0x7fff
11253 ; GFX940-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
11254 ; GFX940-NEXT: s_mov_b32 s9, 0x7060302
11255 ; GFX940-NEXT: v_mov_b32_e32 v4, s4
11256 ; GFX940-NEXT: .LBB33_1: ; %atomicrmw.start
11257 ; GFX940-NEXT: ; =>This Inner Loop Header: Depth=1
11258 ; GFX940-NEXT: s_waitcnt vmcnt(0)
11259 ; GFX940-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11260 ; GFX940-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11261 ; GFX940-NEXT: v_add_f32_e32 v0, v0, v2
11262 ; GFX940-NEXT: v_add_f32_e32 v5, v5, v3
11263 ; GFX940-NEXT: v_bfe_u32 v6, v0, 16, 1
11264 ; GFX940-NEXT: v_bfe_u32 v8, v5, 16, 1
11265 ; GFX940-NEXT: v_or_b32_e32 v7, 0x400000, v0
11266 ; GFX940-NEXT: v_or_b32_e32 v9, 0x400000, v5
11267 ; GFX940-NEXT: v_add3_u32 v6, v6, v0, s8
11268 ; GFX940-NEXT: v_add3_u32 v8, v8, v5, s8
11269 ; GFX940-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
11270 ; GFX940-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
11271 ; GFX940-NEXT: buffer_wbl2 sc1
11272 ; GFX940-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
11273 ; GFX940-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
11274 ; GFX940-NEXT: v_perm_b32 v0, v5, v0, s9
11275 ; GFX940-NEXT: v_mov_b64_e32 v[6:7], v[0:1]
11276 ; GFX940-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[0:3], 0 offen sc0
11277 ; GFX940-NEXT: s_waitcnt vmcnt(0)
11278 ; GFX940-NEXT: buffer_inv sc1
11279 ; GFX940-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
11280 ; GFX940-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
11281 ; GFX940-NEXT: v_mov_b32_e32 v1, v6
11282 ; GFX940-NEXT: s_andn2_b64 exec, exec, s[6:7]
11283 ; GFX940-NEXT: s_cbranch_execnz .LBB33_1
11284 ; GFX940-NEXT: ; %bb.2: ; %atomicrmw.end
11285 ; GFX940-NEXT: s_or_b64 exec, exec, s[6:7]
11286 ; GFX940-NEXT: s_setpc_b64 s[30:31]
11288 ; GFX11-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11290 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11291 ; GFX11-NEXT: v_dual_mov_b32 v1, s16 :: v_dual_lshlrev_b32 v2, 16, v0
11292 ; GFX11-NEXT: s_add_i32 s4, s16, 0x400
11293 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
11294 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_and_b32 v3, 0xffff0000, v0
11295 ; GFX11-NEXT: buffer_load_b32 v1, v1, s[0:3], 0 offen offset:1024
11296 ; GFX11-NEXT: s_mov_b32 s5, 0
11297 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x1
11298 ; GFX11-NEXT: .p2align 6
11299 ; GFX11-NEXT: .LBB33_1: ; %atomicrmw.start
11300 ; GFX11-NEXT: ; =>This Inner Loop Header: Depth=1
11301 ; GFX11-NEXT: s_waitcnt vmcnt(0)
11302 ; GFX11-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11303 ; GFX11-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11304 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
11305 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
11306 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v3 :: v_dual_add_f32 v0, v0, v2
11307 ; GFX11-NEXT: v_bfe_u32 v7, v5, 16, 1
11308 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2)
11309 ; GFX11-NEXT: v_bfe_u32 v6, v0, 16, 1
11310 ; GFX11-NEXT: v_or_b32_e32 v8, 0x400000, v0
11311 ; GFX11-NEXT: v_or_b32_e32 v9, 0x400000, v5
11312 ; GFX11-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
11313 ; GFX11-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
11314 ; GFX11-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
11315 ; GFX11-NEXT: v_cmp_u_f32_e64 s4, v0, v0
11316 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
11317 ; GFX11-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
11318 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
11319 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
11320 ; GFX11-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
11321 ; GFX11-NEXT: v_dual_mov_b32 v6, v1 :: v_dual_mov_b32 v5, v0
11322 ; GFX11-NEXT: buffer_atomic_cmpswap_b32 v[5:6], v4, s[0:3], 0 offen glc
11323 ; GFX11-NEXT: s_waitcnt vmcnt(0)
11324 ; GFX11-NEXT: buffer_gl1_inv
11325 ; GFX11-NEXT: buffer_gl0_inv
11326 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
11327 ; GFX11-NEXT: v_mov_b32_e32 v1, v5
11328 ; GFX11-NEXT: s_or_b32 s5, vcc_lo, s5
11329 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
11330 ; GFX11-NEXT: s_and_not1_b32 exec_lo, exec_lo, s5
11331 ; GFX11-NEXT: s_cbranch_execnz .LBB33_1
11332 ; GFX11-NEXT: ; %bb.2: ; %atomicrmw.end
11333 ; GFX11-NEXT: s_set_inst_prefetch_distance 0x2
11334 ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s5
11335 ; GFX11-NEXT: s_setpc_b64 s[30:31]
11337 ; GFX10-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11339 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11340 ; GFX10-NEXT: v_mov_b32_e32 v1, s20
11341 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
11342 ; GFX10-NEXT: v_lshlrev_b32_e32 v2, 16, v0
11343 ; GFX10-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
11344 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
11345 ; GFX10-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
11346 ; GFX10-NEXT: s_mov_b32 s5, 0
11347 ; GFX10-NEXT: .LBB33_1: ; %atomicrmw.start
11348 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
11349 ; GFX10-NEXT: s_waitcnt vmcnt(0)
11350 ; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11351 ; GFX10-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11352 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
11353 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
11354 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v3
11355 ; GFX10-NEXT: v_bfe_u32 v6, v0, 16, 1
11356 ; GFX10-NEXT: v_bfe_u32 v7, v5, 16, 1
11357 ; GFX10-NEXT: v_or_b32_e32 v8, 0x400000, v0
11358 ; GFX10-NEXT: v_or_b32_e32 v9, 0x400000, v5
11359 ; GFX10-NEXT: v_cmp_u_f32_e32 vcc_lo, v5, v5
11360 ; GFX10-NEXT: v_add3_u32 v6, v6, v0, 0x7fff
11361 ; GFX10-NEXT: v_add3_u32 v7, v7, v5, 0x7fff
11362 ; GFX10-NEXT: v_cmp_u_f32_e64 s4, v0, v0
11363 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v7, v9, vcc_lo
11364 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v6, v8, s4
11365 ; GFX10-NEXT: v_perm_b32 v0, v5, v0, 0x7060302
11366 ; GFX10-NEXT: v_mov_b32_e32 v6, v1
11367 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
11368 ; GFX10-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
11369 ; GFX10-NEXT: s_waitcnt vmcnt(0)
11370 ; GFX10-NEXT: buffer_gl1_inv
11371 ; GFX10-NEXT: buffer_gl0_inv
11372 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v5, v1
11373 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
11374 ; GFX10-NEXT: s_or_b32 s5, vcc_lo, s5
11375 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s5
11376 ; GFX10-NEXT: s_cbranch_execnz .LBB33_1
11377 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
11378 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s5
11379 ; GFX10-NEXT: s_setpc_b64 s[30:31]
11381 ; GFX90A-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11383 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11384 ; GFX90A-NEXT: v_mov_b32_e32 v1, s20
11385 ; GFX90A-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
11386 ; GFX90A-NEXT: s_add_i32 s4, s20, 0x400
11387 ; GFX90A-NEXT: s_mov_b64 s[6:7], 0
11388 ; GFX90A-NEXT: v_lshlrev_b32_e32 v2, 16, v0
11389 ; GFX90A-NEXT: s_movk_i32 s8, 0x7fff
11390 ; GFX90A-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
11391 ; GFX90A-NEXT: s_mov_b32 s9, 0x7060302
11392 ; GFX90A-NEXT: v_mov_b32_e32 v4, s4
11393 ; GFX90A-NEXT: .LBB33_1: ; %atomicrmw.start
11394 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
11395 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
11396 ; GFX90A-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11397 ; GFX90A-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11398 ; GFX90A-NEXT: v_add_f32_e32 v0, v0, v2
11399 ; GFX90A-NEXT: v_add_f32_e32 v5, v5, v3
11400 ; GFX90A-NEXT: v_bfe_u32 v6, v0, 16, 1
11401 ; GFX90A-NEXT: v_bfe_u32 v8, v5, 16, 1
11402 ; GFX90A-NEXT: v_or_b32_e32 v7, 0x400000, v0
11403 ; GFX90A-NEXT: v_or_b32_e32 v9, 0x400000, v5
11404 ; GFX90A-NEXT: v_add3_u32 v6, v6, v0, s8
11405 ; GFX90A-NEXT: v_add3_u32 v8, v8, v5, s8
11406 ; GFX90A-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
11407 ; GFX90A-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
11408 ; GFX90A-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
11409 ; GFX90A-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
11410 ; GFX90A-NEXT: v_perm_b32 v0, v5, v0, s9
11411 ; GFX90A-NEXT: v_pk_mov_b32 v[6:7], v[0:1], v[0:1] op_sel:[0,1]
11412 ; GFX90A-NEXT: buffer_atomic_cmpswap v[6:7], v4, s[16:19], 0 offen glc
11413 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
11414 ; GFX90A-NEXT: buffer_wbinvl1
11415 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v6, v1
11416 ; GFX90A-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
11417 ; GFX90A-NEXT: v_mov_b32_e32 v1, v6
11418 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[6:7]
11419 ; GFX90A-NEXT: s_cbranch_execnz .LBB33_1
11420 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
11421 ; GFX90A-NEXT: s_or_b64 exec, exec, s[6:7]
11422 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
11424 ; GFX908-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11426 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11427 ; GFX908-NEXT: v_mov_b32_e32 v1, s20
11428 ; GFX908-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
11429 ; GFX908-NEXT: s_add_i32 s4, s20, 0x400
11430 ; GFX908-NEXT: s_mov_b64 s[6:7], 0
11431 ; GFX908-NEXT: v_lshlrev_b32_e32 v2, 16, v0
11432 ; GFX908-NEXT: s_movk_i32 s8, 0x7fff
11433 ; GFX908-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
11434 ; GFX908-NEXT: s_mov_b32 s9, 0x7060302
11435 ; GFX908-NEXT: v_mov_b32_e32 v4, s4
11436 ; GFX908-NEXT: .LBB33_1: ; %atomicrmw.start
11437 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
11438 ; GFX908-NEXT: s_waitcnt vmcnt(0)
11439 ; GFX908-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11440 ; GFX908-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11441 ; GFX908-NEXT: v_add_f32_e32 v0, v0, v2
11442 ; GFX908-NEXT: v_add_f32_e32 v5, v5, v3
11443 ; GFX908-NEXT: v_bfe_u32 v6, v0, 16, 1
11444 ; GFX908-NEXT: v_bfe_u32 v8, v5, 16, 1
11445 ; GFX908-NEXT: v_or_b32_e32 v7, 0x400000, v0
11446 ; GFX908-NEXT: v_or_b32_e32 v9, 0x400000, v5
11447 ; GFX908-NEXT: v_add3_u32 v6, v6, v0, s8
11448 ; GFX908-NEXT: v_add3_u32 v8, v8, v5, s8
11449 ; GFX908-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
11450 ; GFX908-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
11451 ; GFX908-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
11452 ; GFX908-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
11453 ; GFX908-NEXT: v_perm_b32 v0, v5, v0, s9
11454 ; GFX908-NEXT: v_mov_b32_e32 v6, v1
11455 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
11456 ; GFX908-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
11457 ; GFX908-NEXT: s_waitcnt vmcnt(0)
11458 ; GFX908-NEXT: buffer_wbinvl1
11459 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
11460 ; GFX908-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
11461 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
11462 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[6:7]
11463 ; GFX908-NEXT: s_cbranch_execnz .LBB33_1
11464 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
11465 ; GFX908-NEXT: s_or_b64 exec, exec, s[6:7]
11466 ; GFX908-NEXT: s_setpc_b64 s[30:31]
11468 ; GFX8-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11470 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11471 ; GFX8-NEXT: v_mov_b32_e32 v1, s20
11472 ; GFX8-NEXT: buffer_load_dword v1, v1, s[16:19], 0 offen offset:1024
11473 ; GFX8-NEXT: s_add_i32 s4, s20, 0x400
11474 ; GFX8-NEXT: s_mov_b64 s[6:7], 0
11475 ; GFX8-NEXT: v_lshlrev_b32_e32 v2, 16, v0
11476 ; GFX8-NEXT: v_and_b32_e32 v3, 0xffff0000, v0
11477 ; GFX8-NEXT: v_mov_b32_e32 v4, s4
11478 ; GFX8-NEXT: .LBB33_1: ; %atomicrmw.start
11479 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
11480 ; GFX8-NEXT: s_waitcnt vmcnt(0)
11481 ; GFX8-NEXT: v_lshlrev_b32_e32 v0, 16, v1
11482 ; GFX8-NEXT: v_and_b32_e32 v5, 0xffff0000, v1
11483 ; GFX8-NEXT: v_add_f32_e32 v0, v0, v2
11484 ; GFX8-NEXT: v_add_f32_e32 v5, v5, v3
11485 ; GFX8-NEXT: v_bfe_u32 v6, v0, 16, 1
11486 ; GFX8-NEXT: v_bfe_u32 v8, v5, 16, 1
11487 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, v6, v0
11488 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, v8, v5
11489 ; GFX8-NEXT: v_add_u32_e32 v6, vcc, 0x7fff, v6
11490 ; GFX8-NEXT: v_add_u32_e32 v8, vcc, 0x7fff, v8
11491 ; GFX8-NEXT: v_or_b32_e32 v9, 0x400000, v5
11492 ; GFX8-NEXT: v_cmp_u_f32_e32 vcc, v5, v5
11493 ; GFX8-NEXT: v_or_b32_e32 v7, 0x400000, v0
11494 ; GFX8-NEXT: v_cmp_u_f32_e64 s[4:5], v0, v0
11495 ; GFX8-NEXT: v_cndmask_b32_e32 v5, v8, v9, vcc
11496 ; GFX8-NEXT: v_cndmask_b32_e64 v0, v6, v7, s[4:5]
11497 ; GFX8-NEXT: v_lshrrev_b32_e32 v5, 16, v5
11498 ; GFX8-NEXT: v_alignbit_b32 v0, v5, v0, 16
11499 ; GFX8-NEXT: v_mov_b32_e32 v6, v1
11500 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
11501 ; GFX8-NEXT: buffer_atomic_cmpswap v[5:6], v4, s[16:19], 0 offen glc
11502 ; GFX8-NEXT: s_waitcnt vmcnt(0)
11503 ; GFX8-NEXT: buffer_wbinvl1
11504 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v5, v1
11505 ; GFX8-NEXT: s_or_b64 s[6:7], vcc, s[6:7]
11506 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
11507 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[6:7]
11508 ; GFX8-NEXT: s_cbranch_execnz .LBB33_1
11509 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
11510 ; GFX8-NEXT: s_or_b64 exec, exec, s[6:7]
11511 ; GFX8-NEXT: s_setpc_b64 s[30:31]
11513 ; GFX7-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11515 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11516 ; GFX7-NEXT: v_mov_b32_e32 v2, s20
11517 ; GFX7-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
11518 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
11519 ; GFX7-NEXT: v_mul_f32_e32 v0, 1.0, v0
11520 ; GFX7-NEXT: v_mul_f32_e32 v1, 1.0, v1
11521 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
11522 ; GFX7-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
11523 ; GFX7-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
11524 ; GFX7-NEXT: s_waitcnt vmcnt(0)
11525 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
11526 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v2
11527 ; GFX7-NEXT: v_mov_b32_e32 v2, s6
11528 ; GFX7-NEXT: .LBB33_1: ; %atomicrmw.start
11529 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
11530 ; GFX7-NEXT: v_mul_f32_e32 v3, 1.0, v3
11531 ; GFX7-NEXT: v_mul_f32_e32 v4, 1.0, v4
11532 ; GFX7-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
11533 ; GFX7-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
11534 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v3
11535 ; GFX7-NEXT: v_add_f32_e32 v6, v6, v1
11536 ; GFX7-NEXT: v_add_f32_e32 v5, v5, v0
11537 ; GFX7-NEXT: v_alignbit_b32 v4, v3, v4, 16
11538 ; GFX7-NEXT: v_lshrrev_b32_e32 v3, 16, v6
11539 ; GFX7-NEXT: v_alignbit_b32 v3, v3, v5, 16
11540 ; GFX7-NEXT: v_mov_b32_e32 v6, v4
11541 ; GFX7-NEXT: v_mov_b32_e32 v5, v3
11542 ; GFX7-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[16:19], 0 offen glc
11543 ; GFX7-NEXT: s_waitcnt vmcnt(0)
11544 ; GFX7-NEXT: buffer_wbinvl1
11545 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
11546 ; GFX7-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
11547 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11548 ; GFX7-NEXT: v_lshlrev_b32_e32 v4, 16, v5
11549 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
11550 ; GFX7-NEXT: s_cbranch_execnz .LBB33_1
11551 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
11552 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
11553 ; GFX7-NEXT: s_setpc_b64 s[30:31]
11555 ; GFX6-LABEL: buffer_fat_ptr_agent_atomic_fadd_noret_v2bf16__offset__amdgpu_no_fine_grained_memory__amdgpu_no_remote_memory:
11557 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11558 ; GFX6-NEXT: v_mov_b32_e32 v2, s20
11559 ; GFX6-NEXT: buffer_load_dword v2, v2, s[16:19], 0 offen offset:1024
11560 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
11561 ; GFX6-NEXT: v_mul_f32_e32 v0, 1.0, v0
11562 ; GFX6-NEXT: v_mul_f32_e32 v1, 1.0, v1
11563 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
11564 ; GFX6-NEXT: v_and_b32_e32 v0, 0xffff0000, v0
11565 ; GFX6-NEXT: v_and_b32_e32 v1, 0xffff0000, v1
11566 ; GFX6-NEXT: s_waitcnt vmcnt(0)
11567 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v2
11568 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v2
11569 ; GFX6-NEXT: v_mov_b32_e32 v2, s6
11570 ; GFX6-NEXT: .LBB33_1: ; %atomicrmw.start
11571 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
11572 ; GFX6-NEXT: v_mul_f32_e32 v3, 1.0, v3
11573 ; GFX6-NEXT: v_mul_f32_e32 v4, 1.0, v4
11574 ; GFX6-NEXT: s_waitcnt expcnt(0)
11575 ; GFX6-NEXT: v_and_b32_e32 v6, 0xffff0000, v3
11576 ; GFX6-NEXT: v_and_b32_e32 v5, 0xffff0000, v4
11577 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v3
11578 ; GFX6-NEXT: v_add_f32_e32 v6, v6, v1
11579 ; GFX6-NEXT: v_add_f32_e32 v5, v5, v0
11580 ; GFX6-NEXT: v_alignbit_b32 v4, v3, v4, 16
11581 ; GFX6-NEXT: v_lshrrev_b32_e32 v3, 16, v6
11582 ; GFX6-NEXT: v_alignbit_b32 v3, v3, v5, 16
11583 ; GFX6-NEXT: v_mov_b32_e32 v6, v4
11584 ; GFX6-NEXT: v_mov_b32_e32 v5, v3
11585 ; GFX6-NEXT: buffer_atomic_cmpswap v[5:6], v2, s[16:19], 0 offen glc
11586 ; GFX6-NEXT: s_waitcnt vmcnt(0)
11587 ; GFX6-NEXT: buffer_wbinvl1
11588 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v5, v4
11589 ; GFX6-NEXT: v_and_b32_e32 v3, 0xffff0000, v5
11590 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11591 ; GFX6-NEXT: v_lshlrev_b32_e32 v4, 16, v5
11592 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
11593 ; GFX6-NEXT: s_cbranch_execnz .LBB33_1
11594 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
11595 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
11596 ; GFX6-NEXT: s_waitcnt expcnt(0)
11597 ; GFX6-NEXT: s_setpc_b64 s[30:31]
11598 %gep = getelementptr <2 x bfloat>, ptr addrspace(7) %ptr, i32 256
11599 %unused = atomicrmw fadd ptr addrspace(7) %gep, <2 x bfloat> %val syncscope("agent") seq_cst, !amdgpu.no.fine.grained.memory !0, !amdgpu.no.remote.memory !0
11603 ; --------------------------------------------------------------------
11605 ; --------------------------------------------------------------------
11607 define float @buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory(ptr addrspace(7) inreg %ptr, float %val) #0 {
11608 ; GFX12-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11610 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
11611 ; GFX12-NEXT: s_wait_expcnt 0x0
11612 ; GFX12-NEXT: s_wait_samplecnt 0x0
11613 ; GFX12-NEXT: s_wait_bvhcnt 0x0
11614 ; GFX12-NEXT: s_wait_kmcnt 0x0
11615 ; GFX12-NEXT: v_mov_b32_e32 v1, s16
11616 ; GFX12-NEXT: global_wb scope:SCOPE_SYS
11617 ; GFX12-NEXT: s_wait_storecnt 0x0
11618 ; GFX12-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], null offen offset:1024 th:TH_ATOMIC_RETURN
11619 ; GFX12-NEXT: s_wait_loadcnt 0x0
11620 ; GFX12-NEXT: global_inv scope:SCOPE_SYS
11621 ; GFX12-NEXT: s_setpc_b64 s[30:31]
11623 ; GFX940-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11625 ; GFX940-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11626 ; GFX940-NEXT: v_mov_b32_e32 v1, s16
11627 ; GFX940-NEXT: buffer_wbl2 sc0 sc1
11628 ; GFX940-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 sc0
11629 ; GFX940-NEXT: s_waitcnt vmcnt(0)
11630 ; GFX940-NEXT: buffer_inv sc0 sc1
11631 ; GFX940-NEXT: s_setpc_b64 s[30:31]
11633 ; GFX11-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11635 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11636 ; GFX11-NEXT: v_mov_b32_e32 v1, s16
11637 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
11638 ; GFX11-NEXT: buffer_atomic_add_f32 v0, v1, s[0:3], 0 offen offset:1024 glc
11639 ; GFX11-NEXT: s_waitcnt vmcnt(0)
11640 ; GFX11-NEXT: buffer_gl1_inv
11641 ; GFX11-NEXT: buffer_gl0_inv
11642 ; GFX11-NEXT: s_setpc_b64 s[30:31]
11644 ; GFX10-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11646 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11647 ; GFX10-NEXT: v_mov_b32_e32 v2, v0
11648 ; GFX10-NEXT: v_mov_b32_e32 v0, s20
11649 ; GFX10-NEXT: s_add_i32 s4, s20, 0x400
11650 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
11651 ; GFX10-NEXT: s_mov_b32 s4, 0
11652 ; GFX10-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
11653 ; GFX10-NEXT: .LBB34_1: ; %atomicrmw.start
11654 ; GFX10-NEXT: ; =>This Inner Loop Header: Depth=1
11655 ; GFX10-NEXT: s_waitcnt vmcnt(0)
11656 ; GFX10-NEXT: v_mov_b32_e32 v5, v0
11657 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
11658 ; GFX10-NEXT: v_add_f32_e32 v4, v5, v2
11659 ; GFX10-NEXT: v_mov_b32_e32 v0, v4
11660 ; GFX10-NEXT: v_mov_b32_e32 v1, v5
11661 ; GFX10-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
11662 ; GFX10-NEXT: s_waitcnt vmcnt(0)
11663 ; GFX10-NEXT: buffer_gl1_inv
11664 ; GFX10-NEXT: buffer_gl0_inv
11665 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, v0, v5
11666 ; GFX10-NEXT: s_or_b32 s4, vcc_lo, s4
11667 ; GFX10-NEXT: s_andn2_b32 exec_lo, exec_lo, s4
11668 ; GFX10-NEXT: s_cbranch_execnz .LBB34_1
11669 ; GFX10-NEXT: ; %bb.2: ; %atomicrmw.end
11670 ; GFX10-NEXT: s_or_b32 exec_lo, exec_lo, s4
11671 ; GFX10-NEXT: s_setpc_b64 s[30:31]
11673 ; GFX90A-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11675 ; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11676 ; GFX90A-NEXT: v_mov_b32_e32 v2, v0
11677 ; GFX90A-NEXT: v_mov_b32_e32 v0, s20
11678 ; GFX90A-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
11679 ; GFX90A-NEXT: s_add_i32 s6, s20, 0x400
11680 ; GFX90A-NEXT: s_mov_b64 s[4:5], 0
11681 ; GFX90A-NEXT: v_mov_b32_e32 v3, s6
11682 ; GFX90A-NEXT: .LBB34_1: ; %atomicrmw.start
11683 ; GFX90A-NEXT: ; =>This Inner Loop Header: Depth=1
11684 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
11685 ; GFX90A-NEXT: v_mov_b32_e32 v5, v0
11686 ; GFX90A-NEXT: v_add_f32_e32 v4, v5, v2
11687 ; GFX90A-NEXT: v_pk_mov_b32 v[0:1], v[4:5], v[4:5] op_sel:[0,1]
11688 ; GFX90A-NEXT: buffer_wbl2
11689 ; GFX90A-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
11690 ; GFX90A-NEXT: s_waitcnt vmcnt(0)
11691 ; GFX90A-NEXT: buffer_invl2
11692 ; GFX90A-NEXT: buffer_wbinvl1
11693 ; GFX90A-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
11694 ; GFX90A-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11695 ; GFX90A-NEXT: s_andn2_b64 exec, exec, s[4:5]
11696 ; GFX90A-NEXT: s_cbranch_execnz .LBB34_1
11697 ; GFX90A-NEXT: ; %bb.2: ; %atomicrmw.end
11698 ; GFX90A-NEXT: s_or_b64 exec, exec, s[4:5]
11699 ; GFX90A-NEXT: s_setpc_b64 s[30:31]
11701 ; GFX908-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11703 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11704 ; GFX908-NEXT: v_mov_b32_e32 v2, v0
11705 ; GFX908-NEXT: v_mov_b32_e32 v0, s20
11706 ; GFX908-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
11707 ; GFX908-NEXT: s_add_i32 s6, s20, 0x400
11708 ; GFX908-NEXT: s_mov_b64 s[4:5], 0
11709 ; GFX908-NEXT: v_mov_b32_e32 v3, s6
11710 ; GFX908-NEXT: .LBB34_1: ; %atomicrmw.start
11711 ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1
11712 ; GFX908-NEXT: s_waitcnt vmcnt(0)
11713 ; GFX908-NEXT: v_mov_b32_e32 v5, v0
11714 ; GFX908-NEXT: v_add_f32_e32 v4, v5, v2
11715 ; GFX908-NEXT: v_mov_b32_e32 v0, v4
11716 ; GFX908-NEXT: v_mov_b32_e32 v1, v5
11717 ; GFX908-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
11718 ; GFX908-NEXT: s_waitcnt vmcnt(0)
11719 ; GFX908-NEXT: buffer_wbinvl1
11720 ; GFX908-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
11721 ; GFX908-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11722 ; GFX908-NEXT: s_andn2_b64 exec, exec, s[4:5]
11723 ; GFX908-NEXT: s_cbranch_execnz .LBB34_1
11724 ; GFX908-NEXT: ; %bb.2: ; %atomicrmw.end
11725 ; GFX908-NEXT: s_or_b64 exec, exec, s[4:5]
11726 ; GFX908-NEXT: s_setpc_b64 s[30:31]
11728 ; GFX8-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11730 ; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11731 ; GFX8-NEXT: v_mov_b32_e32 v2, v0
11732 ; GFX8-NEXT: v_mov_b32_e32 v0, s20
11733 ; GFX8-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
11734 ; GFX8-NEXT: s_add_i32 s6, s20, 0x400
11735 ; GFX8-NEXT: s_mov_b64 s[4:5], 0
11736 ; GFX8-NEXT: v_mov_b32_e32 v3, s6
11737 ; GFX8-NEXT: .LBB34_1: ; %atomicrmw.start
11738 ; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
11739 ; GFX8-NEXT: s_waitcnt vmcnt(0)
11740 ; GFX8-NEXT: v_mov_b32_e32 v5, v0
11741 ; GFX8-NEXT: v_add_f32_e32 v4, v5, v2
11742 ; GFX8-NEXT: v_mov_b32_e32 v0, v4
11743 ; GFX8-NEXT: v_mov_b32_e32 v1, v5
11744 ; GFX8-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
11745 ; GFX8-NEXT: s_waitcnt vmcnt(0)
11746 ; GFX8-NEXT: buffer_wbinvl1
11747 ; GFX8-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
11748 ; GFX8-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11749 ; GFX8-NEXT: s_andn2_b64 exec, exec, s[4:5]
11750 ; GFX8-NEXT: s_cbranch_execnz .LBB34_1
11751 ; GFX8-NEXT: ; %bb.2: ; %atomicrmw.end
11752 ; GFX8-NEXT: s_or_b64 exec, exec, s[4:5]
11753 ; GFX8-NEXT: s_setpc_b64 s[30:31]
11755 ; GFX7-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11757 ; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11758 ; GFX7-NEXT: v_mov_b32_e32 v2, v0
11759 ; GFX7-NEXT: v_mov_b32_e32 v0, s20
11760 ; GFX7-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
11761 ; GFX7-NEXT: s_add_i32 s6, s20, 0x400
11762 ; GFX7-NEXT: s_mov_b64 s[4:5], 0
11763 ; GFX7-NEXT: v_mov_b32_e32 v3, s6
11764 ; GFX7-NEXT: .LBB34_1: ; %atomicrmw.start
11765 ; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
11766 ; GFX7-NEXT: s_waitcnt vmcnt(0)
11767 ; GFX7-NEXT: v_mov_b32_e32 v5, v0
11768 ; GFX7-NEXT: v_add_f32_e32 v4, v5, v2
11769 ; GFX7-NEXT: v_mov_b32_e32 v0, v4
11770 ; GFX7-NEXT: v_mov_b32_e32 v1, v5
11771 ; GFX7-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
11772 ; GFX7-NEXT: s_waitcnt vmcnt(0)
11773 ; GFX7-NEXT: buffer_wbinvl1
11774 ; GFX7-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
11775 ; GFX7-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11776 ; GFX7-NEXT: s_andn2_b64 exec, exec, s[4:5]
11777 ; GFX7-NEXT: s_cbranch_execnz .LBB34_1
11778 ; GFX7-NEXT: ; %bb.2: ; %atomicrmw.end
11779 ; GFX7-NEXT: s_or_b64 exec, exec, s[4:5]
11780 ; GFX7-NEXT: s_setpc_b64 s[30:31]
11782 ; GFX6-LABEL: buffer_fat_ptr_system_atomic_fadd_ret_f32__offset__amdgpu_no_fine_grained_memory:
11784 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
11785 ; GFX6-NEXT: v_mov_b32_e32 v2, v0
11786 ; GFX6-NEXT: v_mov_b32_e32 v0, s20
11787 ; GFX6-NEXT: buffer_load_dword v0, v0, s[16:19], 0 offen offset:1024
11788 ; GFX6-NEXT: s_add_i32 s6, s20, 0x400
11789 ; GFX6-NEXT: s_mov_b64 s[4:5], 0
11790 ; GFX6-NEXT: v_mov_b32_e32 v3, s6
11791 ; GFX6-NEXT: .LBB34_1: ; %atomicrmw.start
11792 ; GFX6-NEXT: ; =>This Inner Loop Header: Depth=1
11793 ; GFX6-NEXT: s_waitcnt vmcnt(0)
11794 ; GFX6-NEXT: v_mov_b32_e32 v5, v0
11795 ; GFX6-NEXT: v_add_f32_e32 v4, v5, v2
11796 ; GFX6-NEXT: s_waitcnt expcnt(0)
11797 ; GFX6-NEXT: v_mov_b32_e32 v0, v4
11798 ; GFX6-NEXT: v_mov_b32_e32 v1, v5
11799 ; GFX6-NEXT: buffer_atomic_cmpswap v[0:1], v3, s[16:19], 0 offen glc
11800 ; GFX6-NEXT: s_waitcnt vmcnt(0)
11801 ; GFX6-NEXT: buffer_wbinvl1
11802 ; GFX6-NEXT: v_cmp_eq_u32_e32 vcc, v0, v5
11803 ; GFX6-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
11804 ; GFX6-NEXT: s_andn2_b64 exec, exec, s[4:5]
11805 ; GFX6-NEXT: s_cbranch_execnz .LBB34_1
11806 ; GFX6-NEXT: ; %bb.2: ; %atomicrmw.end
11807 ; GFX6-NEXT: s_or_b64 exec, exec, s[4:5]
11808 ; GFX6-NEXT: s_waitcnt expcnt(0)
11809 ; GFX6-NEXT: s_setpc_b64 s[30:31]
11810 %gep = getelementptr float, ptr addrspace(7) %ptr, i32 256
11811 %result = atomicrmw fadd ptr addrspace(7) %gep, float %val seq_cst, !amdgpu.no.fine.grained.memory !0
11815 attributes #0 = { nounwind }