1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX9,GFX9-SDAG %s
3 ; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10,GFX10-SDAG %s
4 ; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11,GFX11-SDAG %s
5 ; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX12,GFX12-SDAG %s
6 ; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX9,GFX9-GISEL %s
7 ; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10,GFX10-GISEL %s
8 ; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11,GFX11-GISEL %s
9 ; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX12,GFX12-GISEL %s
11 ; Test splitting flat instruction offsets into the low and high bits
12 ; when the offset doesn't fit in the offset field.
14 define i8 @flat_inst_valu_offset_1(ptr %p) {
15 ; GFX9-LABEL: flat_inst_valu_offset_1:
17 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
18 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1] offset:1
19 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
20 ; GFX9-NEXT: s_setpc_b64 s[30:31]
22 ; GFX10-LABEL: flat_inst_valu_offset_1:
24 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
25 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, v0, 1
26 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
27 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
28 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
29 ; GFX10-NEXT: s_setpc_b64 s[30:31]
31 ; GFX11-LABEL: flat_inst_valu_offset_1:
33 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
34 ; GFX11-NEXT: flat_load_u8 v0, v[0:1] offset:1
35 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
36 ; GFX11-NEXT: s_setpc_b64 s[30:31]
38 ; GFX12-LABEL: flat_inst_valu_offset_1:
40 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
41 ; GFX12-NEXT: s_wait_expcnt 0x0
42 ; GFX12-NEXT: s_wait_samplecnt 0x0
43 ; GFX12-NEXT: s_wait_bvhcnt 0x0
44 ; GFX12-NEXT: s_wait_kmcnt 0x0
45 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:1
46 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
47 ; GFX12-NEXT: s_setpc_b64 s[30:31]
48 %gep = getelementptr i8, ptr %p, i64 1
49 %load = load i8, ptr %gep, align 4
53 define i8 @flat_inst_valu_offset_11bit_max(ptr %p) {
54 ; GFX9-LABEL: flat_inst_valu_offset_11bit_max:
56 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
57 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1] offset:2047
58 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
59 ; GFX9-NEXT: s_setpc_b64 s[30:31]
61 ; GFX10-LABEL: flat_inst_valu_offset_11bit_max:
63 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
64 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0x7ff, v0
65 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
66 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
67 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
68 ; GFX10-NEXT: s_setpc_b64 s[30:31]
70 ; GFX11-LABEL: flat_inst_valu_offset_11bit_max:
72 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
73 ; GFX11-NEXT: flat_load_u8 v0, v[0:1] offset:2047
74 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
75 ; GFX11-NEXT: s_setpc_b64 s[30:31]
77 ; GFX12-LABEL: flat_inst_valu_offset_11bit_max:
79 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
80 ; GFX12-NEXT: s_wait_expcnt 0x0
81 ; GFX12-NEXT: s_wait_samplecnt 0x0
82 ; GFX12-NEXT: s_wait_bvhcnt 0x0
83 ; GFX12-NEXT: s_wait_kmcnt 0x0
84 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:2047
85 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
86 ; GFX12-NEXT: s_setpc_b64 s[30:31]
87 %gep = getelementptr i8, ptr %p, i64 2047
88 %load = load i8, ptr %gep, align 4
92 define i8 @flat_inst_valu_offset_12bit_max(ptr %p) {
93 ; GFX9-LABEL: flat_inst_valu_offset_12bit_max:
95 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
96 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1] offset:4095
97 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
98 ; GFX9-NEXT: s_setpc_b64 s[30:31]
100 ; GFX10-LABEL: flat_inst_valu_offset_12bit_max:
102 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
103 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xfff, v0
104 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
105 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
106 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
107 ; GFX10-NEXT: s_setpc_b64 s[30:31]
109 ; GFX11-LABEL: flat_inst_valu_offset_12bit_max:
111 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
112 ; GFX11-NEXT: flat_load_u8 v0, v[0:1] offset:4095
113 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
114 ; GFX11-NEXT: s_setpc_b64 s[30:31]
116 ; GFX12-LABEL: flat_inst_valu_offset_12bit_max:
118 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
119 ; GFX12-NEXT: s_wait_expcnt 0x0
120 ; GFX12-NEXT: s_wait_samplecnt 0x0
121 ; GFX12-NEXT: s_wait_bvhcnt 0x0
122 ; GFX12-NEXT: s_wait_kmcnt 0x0
123 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:4095
124 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
125 ; GFX12-NEXT: s_setpc_b64 s[30:31]
126 %gep = getelementptr i8, ptr %p, i64 4095
127 %load = load i8, ptr %gep, align 4
131 define i8 @flat_inst_valu_offset_13bit_max(ptr %p) {
132 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_13bit_max:
133 ; GFX9-SDAG: ; %bb.0:
134 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
135 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
136 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
137 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095
138 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
139 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
141 ; GFX10-LABEL: flat_inst_valu_offset_13bit_max:
143 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
144 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0x1fff, v0
145 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
146 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
147 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
148 ; GFX10-NEXT: s_setpc_b64 s[30:31]
150 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_13bit_max:
151 ; GFX11-SDAG: ; %bb.0:
152 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
153 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1000, v0
154 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
155 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095
156 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
157 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
159 ; GFX12-LABEL: flat_inst_valu_offset_13bit_max:
161 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
162 ; GFX12-NEXT: s_wait_expcnt 0x0
163 ; GFX12-NEXT: s_wait_samplecnt 0x0
164 ; GFX12-NEXT: s_wait_bvhcnt 0x0
165 ; GFX12-NEXT: s_wait_kmcnt 0x0
166 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:8191
167 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
168 ; GFX12-NEXT: s_setpc_b64 s[30:31]
170 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_13bit_max:
171 ; GFX9-GISEL: ; %bb.0:
172 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
173 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, 0x1fff, v0
174 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
175 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
176 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
177 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
179 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_13bit_max:
180 ; GFX11-GISEL: ; %bb.0:
181 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
182 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, 0x1fff, v0
183 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
184 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
185 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
186 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
187 %gep = getelementptr i8, ptr %p, i64 8191
188 %load = load i8, ptr %gep, align 4
192 define i8 @flat_inst_valu_offset_24bit_max(ptr %p) {
193 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_24bit_max:
194 ; GFX9-SDAG: ; %bb.0:
195 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
196 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x7ff000, v0
197 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
198 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095
199 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
200 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
202 ; GFX10-LABEL: flat_inst_valu_offset_24bit_max:
204 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
205 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0x7fffff, v0
206 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
207 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
208 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
209 ; GFX10-NEXT: s_setpc_b64 s[30:31]
211 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_24bit_max:
212 ; GFX11-SDAG: ; %bb.0:
213 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
214 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x7ff000, v0
215 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
216 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095
217 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
218 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
220 ; GFX12-LABEL: flat_inst_valu_offset_24bit_max:
222 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
223 ; GFX12-NEXT: s_wait_expcnt 0x0
224 ; GFX12-NEXT: s_wait_samplecnt 0x0
225 ; GFX12-NEXT: s_wait_bvhcnt 0x0
226 ; GFX12-NEXT: s_wait_kmcnt 0x0
227 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:8388607
228 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
229 ; GFX12-NEXT: s_setpc_b64 s[30:31]
231 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_24bit_max:
232 ; GFX9-GISEL: ; %bb.0:
233 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
234 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, 0x7fffff, v0
235 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
236 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
237 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
238 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
240 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_24bit_max:
241 ; GFX11-GISEL: ; %bb.0:
242 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
243 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, 0x7fffff, v0
244 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
245 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
246 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
247 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
248 %gep = getelementptr i8, ptr %p, i64 8388607
249 %load = load i8, ptr %gep, align 4
253 define i8 @flat_inst_valu_offset_neg_11bit_max(ptr %p) {
254 ; GFX9-LABEL: flat_inst_valu_offset_neg_11bit_max:
256 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
257 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, 0xfffff800, v0
258 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
259 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1]
260 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
261 ; GFX9-NEXT: s_setpc_b64 s[30:31]
263 ; GFX10-LABEL: flat_inst_valu_offset_neg_11bit_max:
265 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
266 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffff800, v0
267 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
268 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
269 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
270 ; GFX10-NEXT: s_setpc_b64 s[30:31]
272 ; GFX11-LABEL: flat_inst_valu_offset_neg_11bit_max:
274 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
275 ; GFX11-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffff800, v0
276 ; GFX11-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
277 ; GFX11-NEXT: flat_load_u8 v0, v[0:1]
278 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
279 ; GFX11-NEXT: s_setpc_b64 s[30:31]
281 ; GFX12-LABEL: flat_inst_valu_offset_neg_11bit_max:
283 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
284 ; GFX12-NEXT: s_wait_expcnt 0x0
285 ; GFX12-NEXT: s_wait_samplecnt 0x0
286 ; GFX12-NEXT: s_wait_bvhcnt 0x0
287 ; GFX12-NEXT: s_wait_kmcnt 0x0
288 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-2048
289 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
290 ; GFX12-NEXT: s_setpc_b64 s[30:31]
291 %gep = getelementptr i8, ptr %p, i64 -2048
292 %load = load i8, ptr %gep, align 4
296 define i8 @flat_inst_valu_offset_neg_12bit_max(ptr %p) {
297 ; GFX9-LABEL: flat_inst_valu_offset_neg_12bit_max:
299 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
300 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, 0xfffff000, v0
301 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
302 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1]
303 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
304 ; GFX9-NEXT: s_setpc_b64 s[30:31]
306 ; GFX10-LABEL: flat_inst_valu_offset_neg_12bit_max:
308 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
309 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffff000, v0
310 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
311 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
312 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
313 ; GFX10-NEXT: s_setpc_b64 s[30:31]
315 ; GFX11-LABEL: flat_inst_valu_offset_neg_12bit_max:
317 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
318 ; GFX11-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffff000, v0
319 ; GFX11-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
320 ; GFX11-NEXT: flat_load_u8 v0, v[0:1]
321 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
322 ; GFX11-NEXT: s_setpc_b64 s[30:31]
324 ; GFX12-LABEL: flat_inst_valu_offset_neg_12bit_max:
326 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
327 ; GFX12-NEXT: s_wait_expcnt 0x0
328 ; GFX12-NEXT: s_wait_samplecnt 0x0
329 ; GFX12-NEXT: s_wait_bvhcnt 0x0
330 ; GFX12-NEXT: s_wait_kmcnt 0x0
331 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-4096
332 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
333 ; GFX12-NEXT: s_setpc_b64 s[30:31]
334 %gep = getelementptr i8, ptr %p, i64 -4096
335 %load = load i8, ptr %gep, align 4
339 define i8 @flat_inst_valu_offset_neg_13bit_max(ptr %p) {
340 ; GFX9-LABEL: flat_inst_valu_offset_neg_13bit_max:
342 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
343 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, 0xffffe000, v0
344 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
345 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1]
346 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
347 ; GFX9-NEXT: s_setpc_b64 s[30:31]
349 ; GFX10-LABEL: flat_inst_valu_offset_neg_13bit_max:
351 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
352 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xffffe000, v0
353 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
354 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
355 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
356 ; GFX10-NEXT: s_setpc_b64 s[30:31]
358 ; GFX11-LABEL: flat_inst_valu_offset_neg_13bit_max:
360 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
361 ; GFX11-NEXT: v_add_co_u32 v0, vcc_lo, 0xffffe000, v0
362 ; GFX11-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
363 ; GFX11-NEXT: flat_load_u8 v0, v[0:1]
364 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
365 ; GFX11-NEXT: s_setpc_b64 s[30:31]
367 ; GFX12-LABEL: flat_inst_valu_offset_neg_13bit_max:
369 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
370 ; GFX12-NEXT: s_wait_expcnt 0x0
371 ; GFX12-NEXT: s_wait_samplecnt 0x0
372 ; GFX12-NEXT: s_wait_bvhcnt 0x0
373 ; GFX12-NEXT: s_wait_kmcnt 0x0
374 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-8192
375 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
376 ; GFX12-NEXT: s_setpc_b64 s[30:31]
377 %gep = getelementptr i8, ptr %p, i64 -8192
378 %load = load i8, ptr %gep, align 4
382 define i8 @flat_inst_valu_offset_neg_24bit_max(ptr %p) {
383 ; GFX9-LABEL: flat_inst_valu_offset_neg_24bit_max:
385 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
386 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, 0xff800000, v0
387 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
388 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1]
389 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
390 ; GFX9-NEXT: s_setpc_b64 s[30:31]
392 ; GFX10-LABEL: flat_inst_valu_offset_neg_24bit_max:
394 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
395 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xff800000, v0
396 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
397 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
398 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
399 ; GFX10-NEXT: s_setpc_b64 s[30:31]
401 ; GFX11-LABEL: flat_inst_valu_offset_neg_24bit_max:
403 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
404 ; GFX11-NEXT: v_add_co_u32 v0, vcc_lo, 0xff800000, v0
405 ; GFX11-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
406 ; GFX11-NEXT: flat_load_u8 v0, v[0:1]
407 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
408 ; GFX11-NEXT: s_setpc_b64 s[30:31]
410 ; GFX12-LABEL: flat_inst_valu_offset_neg_24bit_max:
412 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
413 ; GFX12-NEXT: s_wait_expcnt 0x0
414 ; GFX12-NEXT: s_wait_samplecnt 0x0
415 ; GFX12-NEXT: s_wait_bvhcnt 0x0
416 ; GFX12-NEXT: s_wait_kmcnt 0x0
417 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-8388608
418 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
419 ; GFX12-NEXT: s_setpc_b64 s[30:31]
420 %gep = getelementptr i8, ptr %p, i64 -8388608
421 %load = load i8, ptr %gep, align 4
426 define i8 @flat_inst_valu_offset_2x_11bit_max(ptr %p) {
427 ; GFX9-LABEL: flat_inst_valu_offset_2x_11bit_max:
429 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
430 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1] offset:4095
431 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
432 ; GFX9-NEXT: s_setpc_b64 s[30:31]
434 ; GFX10-LABEL: flat_inst_valu_offset_2x_11bit_max:
436 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
437 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xfff, v0
438 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
439 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
440 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
441 ; GFX10-NEXT: s_setpc_b64 s[30:31]
443 ; GFX11-LABEL: flat_inst_valu_offset_2x_11bit_max:
445 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
446 ; GFX11-NEXT: flat_load_u8 v0, v[0:1] offset:4095
447 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
448 ; GFX11-NEXT: s_setpc_b64 s[30:31]
450 ; GFX12-LABEL: flat_inst_valu_offset_2x_11bit_max:
452 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
453 ; GFX12-NEXT: s_wait_expcnt 0x0
454 ; GFX12-NEXT: s_wait_samplecnt 0x0
455 ; GFX12-NEXT: s_wait_bvhcnt 0x0
456 ; GFX12-NEXT: s_wait_kmcnt 0x0
457 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:4095
458 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
459 ; GFX12-NEXT: s_setpc_b64 s[30:31]
460 %gep = getelementptr i8, ptr %p, i64 4095
461 %load = load i8, ptr %gep, align 4
465 define i8 @flat_inst_valu_offset_2x_12bit_max(ptr %p) {
466 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_2x_12bit_max:
467 ; GFX9-SDAG: ; %bb.0:
468 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
469 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
470 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
471 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095
472 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
473 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
475 ; GFX10-LABEL: flat_inst_valu_offset_2x_12bit_max:
477 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
478 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0x1fff, v0
479 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
480 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
481 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
482 ; GFX10-NEXT: s_setpc_b64 s[30:31]
484 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_2x_12bit_max:
485 ; GFX11-SDAG: ; %bb.0:
486 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
487 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1000, v0
488 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
489 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095
490 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
491 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
493 ; GFX12-LABEL: flat_inst_valu_offset_2x_12bit_max:
495 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
496 ; GFX12-NEXT: s_wait_expcnt 0x0
497 ; GFX12-NEXT: s_wait_samplecnt 0x0
498 ; GFX12-NEXT: s_wait_bvhcnt 0x0
499 ; GFX12-NEXT: s_wait_kmcnt 0x0
500 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:8191
501 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
502 ; GFX12-NEXT: s_setpc_b64 s[30:31]
504 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_2x_12bit_max:
505 ; GFX9-GISEL: ; %bb.0:
506 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
507 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, 0x1fff, v0
508 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
509 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
510 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
511 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
513 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_2x_12bit_max:
514 ; GFX11-GISEL: ; %bb.0:
515 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
516 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, 0x1fff, v0
517 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
518 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
519 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
520 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
521 %gep = getelementptr i8, ptr %p, i64 8191
522 %load = load i8, ptr %gep, align 4
526 define i8 @flat_inst_valu_offset_2x_13bit_max(ptr %p) {
527 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_2x_13bit_max:
528 ; GFX9-SDAG: ; %bb.0:
529 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
530 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x3000, v0
531 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
532 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095
533 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
534 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
536 ; GFX10-LABEL: flat_inst_valu_offset_2x_13bit_max:
538 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
539 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0x3fff, v0
540 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
541 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
542 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
543 ; GFX10-NEXT: s_setpc_b64 s[30:31]
545 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_2x_13bit_max:
546 ; GFX11-SDAG: ; %bb.0:
547 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
548 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x3000, v0
549 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
550 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095
551 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
552 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
554 ; GFX12-LABEL: flat_inst_valu_offset_2x_13bit_max:
556 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
557 ; GFX12-NEXT: s_wait_expcnt 0x0
558 ; GFX12-NEXT: s_wait_samplecnt 0x0
559 ; GFX12-NEXT: s_wait_bvhcnt 0x0
560 ; GFX12-NEXT: s_wait_kmcnt 0x0
561 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:16383
562 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
563 ; GFX12-NEXT: s_setpc_b64 s[30:31]
565 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_2x_13bit_max:
566 ; GFX9-GISEL: ; %bb.0:
567 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
568 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, 0x3fff, v0
569 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
570 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
571 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
572 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
574 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_2x_13bit_max:
575 ; GFX11-GISEL: ; %bb.0:
576 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
577 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, 0x3fff, v0
578 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
579 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
580 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
581 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
582 %gep = getelementptr i8, ptr %p, i64 16383
583 %load = load i8, ptr %gep, align 4
587 define i8 @flat_inst_valu_offset_2x_24bit_max(ptr %p) {
588 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_2x_24bit_max:
589 ; GFX9-SDAG: ; %bb.0:
590 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
591 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xfff000, v0
592 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
593 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4094
594 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
595 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
597 ; GFX10-LABEL: flat_inst_valu_offset_2x_24bit_max:
599 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
600 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffffe, v0
601 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
602 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
603 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
604 ; GFX10-NEXT: s_setpc_b64 s[30:31]
606 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_2x_24bit_max:
607 ; GFX11-SDAG: ; %bb.0:
608 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
609 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0xfff000, v0
610 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
611 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4094
612 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
613 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
615 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_2x_24bit_max:
616 ; GFX12-SDAG: ; %bb.0:
617 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
618 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
619 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
620 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
621 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
622 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, v0
623 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
624 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:8388606
625 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
626 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
628 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_2x_24bit_max:
629 ; GFX9-GISEL: ; %bb.0:
630 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
631 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, 0xfffffe, v0
632 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
633 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
634 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
635 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
637 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_2x_24bit_max:
638 ; GFX11-GISEL: ; %bb.0:
639 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
640 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffffe, v0
641 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
642 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
643 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
644 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
646 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_2x_24bit_max:
647 ; GFX12-GISEL: ; %bb.0:
648 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
649 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
650 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
651 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
652 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
653 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffffe, v0
654 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
655 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
656 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
657 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
658 %gep = getelementptr i8, ptr %p, i64 16777214
659 %load = load i8, ptr %gep, align 4
663 define i8 @flat_inst_valu_offset_2x_neg_11bit_max(ptr %p) {
664 ; GFX9-LABEL: flat_inst_valu_offset_2x_neg_11bit_max:
666 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
667 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, 0xfffff000, v0
668 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
669 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1]
670 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
671 ; GFX9-NEXT: s_setpc_b64 s[30:31]
673 ; GFX10-LABEL: flat_inst_valu_offset_2x_neg_11bit_max:
675 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
676 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffff000, v0
677 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
678 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
679 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
680 ; GFX10-NEXT: s_setpc_b64 s[30:31]
682 ; GFX11-LABEL: flat_inst_valu_offset_2x_neg_11bit_max:
684 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
685 ; GFX11-NEXT: v_add_co_u32 v0, vcc_lo, 0xfffff000, v0
686 ; GFX11-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
687 ; GFX11-NEXT: flat_load_u8 v0, v[0:1]
688 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
689 ; GFX11-NEXT: s_setpc_b64 s[30:31]
691 ; GFX12-LABEL: flat_inst_valu_offset_2x_neg_11bit_max:
693 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
694 ; GFX12-NEXT: s_wait_expcnt 0x0
695 ; GFX12-NEXT: s_wait_samplecnt 0x0
696 ; GFX12-NEXT: s_wait_bvhcnt 0x0
697 ; GFX12-NEXT: s_wait_kmcnt 0x0
698 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-4096
699 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
700 ; GFX12-NEXT: s_setpc_b64 s[30:31]
701 %gep = getelementptr i8, ptr %p, i64 -4096
702 %load = load i8, ptr %gep, align 4
706 define i8 @flat_inst_valu_offset_2x_neg_12bit_max(ptr %p) {
707 ; GFX9-LABEL: flat_inst_valu_offset_2x_neg_12bit_max:
709 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
710 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, 0xffffe000, v0
711 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
712 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1]
713 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
714 ; GFX9-NEXT: s_setpc_b64 s[30:31]
716 ; GFX10-LABEL: flat_inst_valu_offset_2x_neg_12bit_max:
718 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
719 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xffffe000, v0
720 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
721 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
722 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
723 ; GFX10-NEXT: s_setpc_b64 s[30:31]
725 ; GFX11-LABEL: flat_inst_valu_offset_2x_neg_12bit_max:
727 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
728 ; GFX11-NEXT: v_add_co_u32 v0, vcc_lo, 0xffffe000, v0
729 ; GFX11-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
730 ; GFX11-NEXT: flat_load_u8 v0, v[0:1]
731 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
732 ; GFX11-NEXT: s_setpc_b64 s[30:31]
734 ; GFX12-LABEL: flat_inst_valu_offset_2x_neg_12bit_max:
736 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
737 ; GFX12-NEXT: s_wait_expcnt 0x0
738 ; GFX12-NEXT: s_wait_samplecnt 0x0
739 ; GFX12-NEXT: s_wait_bvhcnt 0x0
740 ; GFX12-NEXT: s_wait_kmcnt 0x0
741 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-8192
742 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
743 ; GFX12-NEXT: s_setpc_b64 s[30:31]
744 %gep = getelementptr i8, ptr %p, i64 -8192
745 %load = load i8, ptr %gep, align 4
749 define i8 @flat_inst_valu_offset_2x_neg_13bit_max(ptr %p) {
750 ; GFX9-LABEL: flat_inst_valu_offset_2x_neg_13bit_max:
752 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
753 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, 0xffffc000, v0
754 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
755 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1]
756 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
757 ; GFX9-NEXT: s_setpc_b64 s[30:31]
759 ; GFX10-LABEL: flat_inst_valu_offset_2x_neg_13bit_max:
761 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
762 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xffffc000, v0
763 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
764 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
765 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
766 ; GFX10-NEXT: s_setpc_b64 s[30:31]
768 ; GFX11-LABEL: flat_inst_valu_offset_2x_neg_13bit_max:
770 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
771 ; GFX11-NEXT: v_add_co_u32 v0, vcc_lo, 0xffffc000, v0
772 ; GFX11-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
773 ; GFX11-NEXT: flat_load_u8 v0, v[0:1]
774 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
775 ; GFX11-NEXT: s_setpc_b64 s[30:31]
777 ; GFX12-LABEL: flat_inst_valu_offset_2x_neg_13bit_max:
779 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
780 ; GFX12-NEXT: s_wait_expcnt 0x0
781 ; GFX12-NEXT: s_wait_samplecnt 0x0
782 ; GFX12-NEXT: s_wait_bvhcnt 0x0
783 ; GFX12-NEXT: s_wait_kmcnt 0x0
784 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-16384
785 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
786 ; GFX12-NEXT: s_setpc_b64 s[30:31]
787 %gep = getelementptr i8, ptr %p, i64 -16384
788 %load = load i8, ptr %gep, align 4
792 define i8 @flat_inst_valu_offset_2x_neg_24bit_max(ptr %p) {
793 ; GFX9-LABEL: flat_inst_valu_offset_2x_neg_24bit_max:
795 ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
796 ; GFX9-NEXT: v_add_co_u32_e32 v0, vcc, 0xff000001, v0
797 ; GFX9-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
798 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1]
799 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
800 ; GFX9-NEXT: s_setpc_b64 s[30:31]
802 ; GFX10-LABEL: flat_inst_valu_offset_2x_neg_24bit_max:
804 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
805 ; GFX10-NEXT: v_add_co_u32 v0, vcc_lo, 0xff000001, v0
806 ; GFX10-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
807 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1]
808 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
809 ; GFX10-NEXT: s_setpc_b64 s[30:31]
811 ; GFX11-LABEL: flat_inst_valu_offset_2x_neg_24bit_max:
813 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
814 ; GFX11-NEXT: v_add_co_u32 v0, vcc_lo, 0xff000001, v0
815 ; GFX11-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
816 ; GFX11-NEXT: flat_load_u8 v0, v[0:1]
817 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
818 ; GFX11-NEXT: s_setpc_b64 s[30:31]
820 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_2x_neg_24bit_max:
821 ; GFX12-SDAG: ; %bb.0:
822 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
823 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
824 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
825 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
826 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
827 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0xff800000, v0
828 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
829 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8388607
830 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
831 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
833 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_2x_neg_24bit_max:
834 ; GFX12-GISEL: ; %bb.0:
835 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
836 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
837 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
838 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
839 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
840 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, 0xff000001, v0
841 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
842 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
843 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
844 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
845 %gep = getelementptr i8, ptr %p, i64 -16777215
846 %load = load i8, ptr %gep, align 4
850 ; Fill 11-bit low-bits (1ull << 33) | 2047
851 define i8 @flat_inst_valu_offset_64bit_11bit_split0(ptr %p) {
852 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_split0:
853 ; GFX9-SDAG: ; %bb.0:
854 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
855 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0, v0
856 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
857 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:2047
858 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
859 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
861 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_split0:
862 ; GFX10-SDAG: ; %bb.0:
863 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
864 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x7ff, v0
865 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
866 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
867 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
868 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
870 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_split0:
871 ; GFX11-SDAG: ; %bb.0:
872 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
873 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
874 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
875 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:2047
876 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
877 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
879 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_split0:
880 ; GFX12-SDAG: ; %bb.0:
881 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
882 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
883 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
884 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
885 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
886 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
887 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
888 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:2047
889 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
890 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
892 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_split0:
893 ; GFX9-GISEL: ; %bb.0:
894 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
895 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x7ff
896 ; GFX9-GISEL-NEXT: s_mov_b32 s5, 2
897 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
898 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
899 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
900 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
901 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
902 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
903 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
905 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_split0:
906 ; GFX10-GISEL: ; %bb.0:
907 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
908 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x7ff
909 ; GFX10-GISEL-NEXT: s_mov_b32 s5, 2
910 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
911 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
912 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
913 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
914 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
915 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
916 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
918 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_split0:
919 ; GFX11-GISEL: ; %bb.0:
920 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
921 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x7ff
922 ; GFX11-GISEL-NEXT: s_mov_b32 s1, 2
923 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
924 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
925 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
926 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
927 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
928 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
929 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
930 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
932 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_split0:
933 ; GFX12-GISEL: ; %bb.0:
934 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
935 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
936 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
937 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
938 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
939 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x7ff
940 ; GFX12-GISEL-NEXT: s_mov_b32 s1, 2
941 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
942 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
943 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
944 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
945 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
946 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
947 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
948 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
949 %gep = getelementptr i8, ptr %p, i64 8589936639
950 %load = load i8, ptr %gep, align 4
954 ; Fill 11-bit low-bits (1ull << 33) | 2048
955 define i8 @flat_inst_valu_offset_64bit_11bit_split1(ptr %p) {
956 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_split1:
957 ; GFX9-SDAG: ; %bb.0:
958 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
959 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0, v0
960 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
961 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:2048
962 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
963 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
965 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_split1:
966 ; GFX10-SDAG: ; %bb.0:
967 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
968 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800, v0
969 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
970 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
971 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
972 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
974 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_split1:
975 ; GFX11-SDAG: ; %bb.0:
976 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
977 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
978 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
979 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:2048
980 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
981 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
983 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_split1:
984 ; GFX12-SDAG: ; %bb.0:
985 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
986 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
987 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
988 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
989 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
990 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
991 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
992 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:2048
993 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
994 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
996 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_split1:
997 ; GFX9-GISEL: ; %bb.0:
998 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
999 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x800
1000 ; GFX9-GISEL-NEXT: s_mov_b32 s5, 2
1001 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1002 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1003 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1004 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1005 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1006 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1007 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1009 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_split1:
1010 ; GFX10-GISEL: ; %bb.0:
1011 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1012 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x800
1013 ; GFX10-GISEL-NEXT: s_mov_b32 s5, 2
1014 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1015 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1016 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1017 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1018 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1019 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1020 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1022 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_split1:
1023 ; GFX11-GISEL: ; %bb.0:
1024 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1025 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x800
1026 ; GFX11-GISEL-NEXT: s_mov_b32 s1, 2
1027 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1028 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1029 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1030 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1031 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1032 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1033 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1034 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1036 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_split1:
1037 ; GFX12-GISEL: ; %bb.0:
1038 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1039 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1040 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1041 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1042 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1043 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x800
1044 ; GFX12-GISEL-NEXT: s_mov_b32 s1, 2
1045 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1046 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1047 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1048 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1049 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1050 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1051 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1052 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1053 %gep = getelementptr i8, ptr %p, i64 8589936640
1054 %load = load i8, ptr %gep, align 4
1058 ; Fill 12-bit low-bits (1ull << 33) | 4095
1059 define i8 @flat_inst_valu_offset_64bit_12bit_split0(ptr %p) {
1060 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_split0:
1061 ; GFX9-SDAG: ; %bb.0:
1062 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1063 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0, v0
1064 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
1065 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095
1066 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1067 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1069 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_split0:
1070 ; GFX10-SDAG: ; %bb.0:
1071 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1072 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0xfff, v0
1073 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1074 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1075 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1076 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1078 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_split0:
1079 ; GFX11-SDAG: ; %bb.0:
1080 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1081 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
1082 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1083 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095
1084 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1085 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1087 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_split0:
1088 ; GFX12-SDAG: ; %bb.0:
1089 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1090 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1091 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1092 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1093 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1094 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
1095 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1096 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095
1097 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1098 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1100 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_split0:
1101 ; GFX9-GISEL: ; %bb.0:
1102 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1103 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0xfff
1104 ; GFX9-GISEL-NEXT: s_mov_b32 s5, 2
1105 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1106 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1107 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1108 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1109 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1110 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1111 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1113 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_split0:
1114 ; GFX10-GISEL: ; %bb.0:
1115 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1116 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0xfff
1117 ; GFX10-GISEL-NEXT: s_mov_b32 s5, 2
1118 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1119 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1120 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1121 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1122 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1123 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1124 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1126 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_split0:
1127 ; GFX11-GISEL: ; %bb.0:
1128 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1129 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0xfff
1130 ; GFX11-GISEL-NEXT: s_mov_b32 s1, 2
1131 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1132 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1133 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1134 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1135 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1136 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1137 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1138 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1140 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_split0:
1141 ; GFX12-GISEL: ; %bb.0:
1142 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1143 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1144 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1145 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1146 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1147 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0xfff
1148 ; GFX12-GISEL-NEXT: s_mov_b32 s1, 2
1149 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1150 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1151 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1152 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1153 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1154 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1155 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1156 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1157 %gep = getelementptr i8, ptr %p, i64 8589938687
1158 %load = load i8, ptr %gep, align 4
1162 ; Fill 12-bit low-bits (1ull << 33) | 4096
1163 define i8 @flat_inst_valu_offset_64bit_12bit_split1(ptr %p) {
1164 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_split1:
1165 ; GFX9-SDAG: ; %bb.0:
1166 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1167 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
1168 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
1169 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1170 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1171 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1173 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_split1:
1174 ; GFX10-SDAG: ; %bb.0:
1175 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1176 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1000, v0
1177 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1178 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1179 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1180 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1182 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_split1:
1183 ; GFX11-SDAG: ; %bb.0:
1184 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1185 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1000, v0
1186 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1187 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1]
1188 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1189 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1191 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_split1:
1192 ; GFX12-SDAG: ; %bb.0:
1193 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1194 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1195 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1196 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1197 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1198 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
1199 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1200 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4096
1201 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1202 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1204 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_split1:
1205 ; GFX9-GISEL: ; %bb.0:
1206 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1207 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x1000
1208 ; GFX9-GISEL-NEXT: s_mov_b32 s5, 2
1209 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1210 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1211 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1212 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1213 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1214 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1215 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1217 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_split1:
1218 ; GFX10-GISEL: ; %bb.0:
1219 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1220 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x1000
1221 ; GFX10-GISEL-NEXT: s_mov_b32 s5, 2
1222 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1223 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1224 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1225 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1226 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1227 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1228 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1230 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_split1:
1231 ; GFX11-GISEL: ; %bb.0:
1232 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1233 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x1000
1234 ; GFX11-GISEL-NEXT: s_mov_b32 s1, 2
1235 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1236 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1237 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1238 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1239 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1240 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1241 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1242 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1244 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_split1:
1245 ; GFX12-GISEL: ; %bb.0:
1246 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1247 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1248 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1249 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1250 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1251 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x1000
1252 ; GFX12-GISEL-NEXT: s_mov_b32 s1, 2
1253 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1254 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1255 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1256 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1257 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1258 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1259 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1260 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1261 %gep = getelementptr i8, ptr %p, i64 8589938688
1262 %load = load i8, ptr %gep, align 4
1266 ; Fill 13-bit low-bits (1ull << 33) | 8191
1267 define i8 @flat_inst_valu_offset_64bit_13bit_split0(ptr %p) {
1268 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_split0:
1269 ; GFX9-SDAG: ; %bb.0:
1270 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1271 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
1272 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
1273 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095
1274 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1275 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1277 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_split0:
1278 ; GFX10-SDAG: ; %bb.0:
1279 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1280 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1fff, v0
1281 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1282 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1283 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1284 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1286 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_split0:
1287 ; GFX11-SDAG: ; %bb.0:
1288 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1289 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1000, v0
1290 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1291 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095
1292 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1293 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1295 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_split0:
1296 ; GFX12-SDAG: ; %bb.0:
1297 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1298 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1299 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1300 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1301 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1302 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
1303 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1304 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:8191
1305 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1306 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1308 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_split0:
1309 ; GFX9-GISEL: ; %bb.0:
1310 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1311 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x1fff
1312 ; GFX9-GISEL-NEXT: s_mov_b32 s5, 2
1313 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1314 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1315 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1316 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1317 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1318 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1319 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1321 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_split0:
1322 ; GFX10-GISEL: ; %bb.0:
1323 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1324 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x1fff
1325 ; GFX10-GISEL-NEXT: s_mov_b32 s5, 2
1326 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1327 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1328 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1329 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1330 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1331 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1332 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1334 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_split0:
1335 ; GFX11-GISEL: ; %bb.0:
1336 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1337 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x1fff
1338 ; GFX11-GISEL-NEXT: s_mov_b32 s1, 2
1339 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1340 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1341 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1342 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1343 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1344 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1345 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1346 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1348 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_split0:
1349 ; GFX12-GISEL: ; %bb.0:
1350 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1351 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1352 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1353 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1354 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1355 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x1fff
1356 ; GFX12-GISEL-NEXT: s_mov_b32 s1, 2
1357 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1358 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1359 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1360 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1361 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1362 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1363 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1364 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1365 %gep = getelementptr i8, ptr %p, i64 8589942783
1366 %load = load i8, ptr %gep, align 4
1370 ; Fill 13-bit low-bits (1ull << 33) | 8192
1371 define i8 @flat_inst_valu_offset_64bit_13bit_split1(ptr %p) {
1372 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_split1:
1373 ; GFX9-SDAG: ; %bb.0:
1374 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1375 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x2000, v0
1376 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
1377 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1378 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1379 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1381 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_split1:
1382 ; GFX10-SDAG: ; %bb.0:
1383 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1384 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x2000, v0
1385 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1386 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1387 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1388 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1390 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_split1:
1391 ; GFX11-SDAG: ; %bb.0:
1392 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1393 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x2000, v0
1394 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1395 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1]
1396 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1397 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1399 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_split1:
1400 ; GFX12-SDAG: ; %bb.0:
1401 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1402 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1403 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1404 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1405 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1406 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0, v0
1407 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 2, v1, vcc_lo
1408 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:8192
1409 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1410 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1412 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_split1:
1413 ; GFX9-GISEL: ; %bb.0:
1414 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1415 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x2000
1416 ; GFX9-GISEL-NEXT: s_mov_b32 s5, 2
1417 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1418 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1419 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1420 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1421 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1422 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1423 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1425 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_split1:
1426 ; GFX10-GISEL: ; %bb.0:
1427 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1428 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x2000
1429 ; GFX10-GISEL-NEXT: s_mov_b32 s5, 2
1430 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1431 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1432 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1433 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1434 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1435 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1436 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1438 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_split1:
1439 ; GFX11-GISEL: ; %bb.0:
1440 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1441 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x2000
1442 ; GFX11-GISEL-NEXT: s_mov_b32 s1, 2
1443 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1444 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1445 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1446 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1447 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1448 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1449 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1450 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1452 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_split1:
1453 ; GFX12-GISEL: ; %bb.0:
1454 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1455 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1456 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1457 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1458 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1459 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x2000
1460 ; GFX12-GISEL-NEXT: s_mov_b32 s1, 2
1461 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1462 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1463 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1464 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1465 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1466 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1467 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1468 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1469 %gep = getelementptr i8, ptr %p, i64 8589942784
1470 %load = load i8, ptr %gep, align 4
1474 ; Fill 11-bit low-bits, negative high bits (1ull << 63) | 2047
1475 define i8 @flat_inst_valu_offset_64bit_11bit_neg_high_split0(ptr %p) {
1476 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split0:
1477 ; GFX9-SDAG: ; %bb.0:
1478 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1479 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x7ff, v0
1480 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v2, 1
1481 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v2, v1, vcc
1482 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1483 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1484 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1486 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split0:
1487 ; GFX10-SDAG: ; %bb.0:
1488 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1489 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x7ff, v0
1490 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1491 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1492 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1493 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1495 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split0:
1496 ; GFX11-SDAG: ; %bb.0:
1497 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1498 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x7ff, v0
1499 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1500 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1]
1501 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1502 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1504 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split0:
1505 ; GFX12-SDAG: ; %bb.0:
1506 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1507 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1508 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1509 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1510 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1511 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, v0
1512 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1513 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8386561
1514 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1515 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1517 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split0:
1518 ; GFX9-GISEL: ; %bb.0:
1519 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1520 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x7ff
1521 ; GFX9-GISEL-NEXT: s_brev_b32 s5, 1
1522 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1523 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1524 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1525 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1526 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1527 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1528 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1530 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split0:
1531 ; GFX10-GISEL: ; %bb.0:
1532 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1533 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x7ff
1534 ; GFX10-GISEL-NEXT: s_brev_b32 s5, 1
1535 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1536 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1537 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1538 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1539 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1540 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1541 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1543 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split0:
1544 ; GFX11-GISEL: ; %bb.0:
1545 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1546 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x7ff
1547 ; GFX11-GISEL-NEXT: s_brev_b32 s1, 1
1548 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1549 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1550 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1551 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1552 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1553 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1554 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1555 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1557 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split0:
1558 ; GFX12-GISEL: ; %bb.0:
1559 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1560 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1561 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1562 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1563 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1564 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x7ff
1565 ; GFX12-GISEL-NEXT: s_brev_b32 s1, 1
1566 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1567 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1568 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1569 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1570 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1571 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1572 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1573 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1574 %gep = getelementptr i8, ptr %p, i64 -9223372036854773761
1575 %load = load i8, ptr %gep, align 4
1579 ; Fill 11-bit low-bits, negative high bits (1ull << 63) | 2048
1580 define i8 @flat_inst_valu_offset_64bit_11bit_neg_high_split1(ptr %p) {
1581 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split1:
1582 ; GFX9-SDAG: ; %bb.0:
1583 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1584 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x800, v0
1585 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v2, 1
1586 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v2, v1, vcc
1587 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1588 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1589 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1591 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split1:
1592 ; GFX10-SDAG: ; %bb.0:
1593 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1594 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800, v0
1595 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1596 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1597 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1598 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1600 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split1:
1601 ; GFX11-SDAG: ; %bb.0:
1602 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1603 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800, v0
1604 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1605 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1]
1606 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1607 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1609 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split1:
1610 ; GFX12-SDAG: ; %bb.0:
1611 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1612 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1613 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1614 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1615 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1616 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, v0
1617 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1618 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8386560
1619 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1620 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1622 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split1:
1623 ; GFX9-GISEL: ; %bb.0:
1624 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1625 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x800
1626 ; GFX9-GISEL-NEXT: s_brev_b32 s5, 1
1627 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1628 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1629 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1630 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1631 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1632 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1633 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1635 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split1:
1636 ; GFX10-GISEL: ; %bb.0:
1637 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1638 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x800
1639 ; GFX10-GISEL-NEXT: s_brev_b32 s5, 1
1640 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1641 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1642 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1643 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1644 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1645 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1646 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1648 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split1:
1649 ; GFX11-GISEL: ; %bb.0:
1650 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1651 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x800
1652 ; GFX11-GISEL-NEXT: s_brev_b32 s1, 1
1653 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1654 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1655 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1656 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1657 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1658 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1659 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1660 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1662 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_11bit_neg_high_split1:
1663 ; GFX12-GISEL: ; %bb.0:
1664 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1665 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1666 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1667 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1668 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1669 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x800
1670 ; GFX12-GISEL-NEXT: s_brev_b32 s1, 1
1671 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1672 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1673 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1674 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1675 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1676 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1677 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1678 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1679 %gep = getelementptr i8, ptr %p, i64 -9223372036854773760
1680 %load = load i8, ptr %gep, align 4
1684 ; Fill 12-bit low-bits, negative high bits (1ull << 63) | 4095
1685 define i8 @flat_inst_valu_offset_64bit_12bit_neg_high_split0(ptr %p) {
1686 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split0:
1687 ; GFX9-SDAG: ; %bb.0:
1688 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1689 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xfff, v0
1690 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v2, 1
1691 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v2, v1, vcc
1692 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1693 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1694 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1696 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split0:
1697 ; GFX10-SDAG: ; %bb.0:
1698 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1699 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0xfff, v0
1700 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1701 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1702 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1703 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1705 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split0:
1706 ; GFX11-SDAG: ; %bb.0:
1707 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1708 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0xfff, v0
1709 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1710 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1]
1711 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1712 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1714 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split0:
1715 ; GFX12-SDAG: ; %bb.0:
1716 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1717 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1718 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1719 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1720 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1721 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, v0
1722 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1723 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8384513
1724 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1725 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1727 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split0:
1728 ; GFX9-GISEL: ; %bb.0:
1729 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1730 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0xfff
1731 ; GFX9-GISEL-NEXT: s_brev_b32 s5, 1
1732 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1733 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1734 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1735 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1736 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1737 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1738 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1740 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split0:
1741 ; GFX10-GISEL: ; %bb.0:
1742 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1743 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0xfff
1744 ; GFX10-GISEL-NEXT: s_brev_b32 s5, 1
1745 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1746 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1747 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1748 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1749 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1750 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1751 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1753 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split0:
1754 ; GFX11-GISEL: ; %bb.0:
1755 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1756 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0xfff
1757 ; GFX11-GISEL-NEXT: s_brev_b32 s1, 1
1758 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1759 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1760 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1761 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1762 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1763 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1764 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1765 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1767 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split0:
1768 ; GFX12-GISEL: ; %bb.0:
1769 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1770 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1771 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1772 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1773 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1774 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0xfff
1775 ; GFX12-GISEL-NEXT: s_brev_b32 s1, 1
1776 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1777 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1778 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1779 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1780 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1781 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1782 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1783 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1784 %gep = getelementptr i8, ptr %p, i64 -9223372036854771713
1785 %load = load i8, ptr %gep, align 4
1789 ; Fill 12-bit low-bits, negative high bits (1ull << 63) | 4096
1790 define i8 @flat_inst_valu_offset_64bit_12bit_neg_high_split1(ptr %p) {
1791 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split1:
1792 ; GFX9-SDAG: ; %bb.0:
1793 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1794 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
1795 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v2, 1
1796 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v2, v1, vcc
1797 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1798 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1799 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1801 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split1:
1802 ; GFX10-SDAG: ; %bb.0:
1803 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1804 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1000, v0
1805 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1806 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1807 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1808 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1810 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split1:
1811 ; GFX11-SDAG: ; %bb.0:
1812 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1813 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1000, v0
1814 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1815 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1]
1816 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1817 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1819 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split1:
1820 ; GFX12-SDAG: ; %bb.0:
1821 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1822 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1823 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1824 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1825 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1826 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, v0
1827 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1828 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8384512
1829 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1830 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1832 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split1:
1833 ; GFX9-GISEL: ; %bb.0:
1834 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1835 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x1000
1836 ; GFX9-GISEL-NEXT: s_brev_b32 s5, 1
1837 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1838 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1839 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1840 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1841 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1842 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1843 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1845 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split1:
1846 ; GFX10-GISEL: ; %bb.0:
1847 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1848 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x1000
1849 ; GFX10-GISEL-NEXT: s_brev_b32 s5, 1
1850 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1851 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1852 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1853 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1854 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1855 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1856 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1858 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split1:
1859 ; GFX11-GISEL: ; %bb.0:
1860 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1861 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x1000
1862 ; GFX11-GISEL-NEXT: s_brev_b32 s1, 1
1863 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1864 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1865 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1866 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1867 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1868 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1869 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1870 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1872 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_12bit_neg_high_split1:
1873 ; GFX12-GISEL: ; %bb.0:
1874 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1875 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1876 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1877 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1878 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1879 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x1000
1880 ; GFX12-GISEL-NEXT: s_brev_b32 s1, 1
1881 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1882 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1883 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1884 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1885 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1886 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1887 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1888 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1889 %gep = getelementptr i8, ptr %p, i64 -9223372036854771712
1890 %load = load i8, ptr %gep, align 4
1894 ; Fill 13-bit low-bits, negative high bits (1ull << 63) | 8191
1895 define i8 @flat_inst_valu_offset_64bit_13bit_neg_high_split0(ptr %p) {
1896 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split0:
1897 ; GFX9-SDAG: ; %bb.0:
1898 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1899 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1fff, v0
1900 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v2, 1
1901 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v2, v1, vcc
1902 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1903 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1904 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
1906 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split0:
1907 ; GFX10-SDAG: ; %bb.0:
1908 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1909 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1fff, v0
1910 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1911 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
1912 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1913 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
1915 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split0:
1916 ; GFX11-SDAG: ; %bb.0:
1917 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1918 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1fff, v0
1919 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1920 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1]
1921 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1922 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
1924 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split0:
1925 ; GFX12-SDAG: ; %bb.0:
1926 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1927 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
1928 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
1929 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
1930 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
1931 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, v0
1932 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
1933 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8380417
1934 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
1935 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
1937 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split0:
1938 ; GFX9-GISEL: ; %bb.0:
1939 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1940 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x1fff
1941 ; GFX9-GISEL-NEXT: s_brev_b32 s5, 1
1942 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
1943 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
1944 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
1945 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
1946 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1947 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1948 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
1950 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split0:
1951 ; GFX10-GISEL: ; %bb.0:
1952 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1953 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x1fff
1954 ; GFX10-GISEL-NEXT: s_brev_b32 s5, 1
1955 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
1956 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
1957 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1958 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1959 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
1960 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1961 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
1963 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split0:
1964 ; GFX11-GISEL: ; %bb.0:
1965 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1966 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x1fff
1967 ; GFX11-GISEL-NEXT: s_brev_b32 s1, 1
1968 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1969 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1970 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1971 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1972 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1973 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1974 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
1975 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
1977 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split0:
1978 ; GFX12-GISEL: ; %bb.0:
1979 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1980 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
1981 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
1982 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
1983 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
1984 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x1fff
1985 ; GFX12-GISEL-NEXT: s_brev_b32 s1, 1
1986 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
1987 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1988 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
1989 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
1990 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
1991 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
1992 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
1993 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
1994 %gep = getelementptr i8, ptr %p, i64 -9223372036854767617
1995 %load = load i8, ptr %gep, align 4
1999 ; Fill 13-bit low-bits, negative high bits (1ull << 63) | 8192
2000 define i8 @flat_inst_valu_offset_64bit_13bit_neg_high_split1(ptr %p) {
2001 ; GFX9-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split1:
2002 ; GFX9-SDAG: ; %bb.0:
2003 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2004 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x2000, v0
2005 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v2, 1
2006 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v2, v1, vcc
2007 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
2008 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2009 ; GFX9-SDAG-NEXT: s_setpc_b64 s[30:31]
2011 ; GFX10-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split1:
2012 ; GFX10-SDAG: ; %bb.0:
2013 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2014 ; GFX10-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x2000, v0
2015 ; GFX10-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
2016 ; GFX10-SDAG-NEXT: flat_load_ubyte v0, v[0:1]
2017 ; GFX10-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2018 ; GFX10-SDAG-NEXT: s_setpc_b64 s[30:31]
2020 ; GFX11-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split1:
2021 ; GFX11-SDAG: ; %bb.0:
2022 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2023 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x2000, v0
2024 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
2025 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1]
2026 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2027 ; GFX11-SDAG-NEXT: s_setpc_b64 s[30:31]
2029 ; GFX12-SDAG-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split1:
2030 ; GFX12-SDAG: ; %bb.0:
2031 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
2032 ; GFX12-SDAG-NEXT: s_wait_expcnt 0x0
2033 ; GFX12-SDAG-NEXT: s_wait_samplecnt 0x0
2034 ; GFX12-SDAG-NEXT: s_wait_bvhcnt 0x0
2035 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
2036 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, v0
2037 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
2038 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8380416
2039 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
2040 ; GFX12-SDAG-NEXT: s_setpc_b64 s[30:31]
2042 ; GFX9-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split1:
2043 ; GFX9-GISEL: ; %bb.0:
2044 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2045 ; GFX9-GISEL-NEXT: s_movk_i32 s4, 0x2000
2046 ; GFX9-GISEL-NEXT: s_brev_b32 s5, 1
2047 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v2, s4
2048 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v3, s5
2049 ; GFX9-GISEL-NEXT: v_add_co_u32_e32 v0, vcc, v0, v2
2050 ; GFX9-GISEL-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v3, vcc
2051 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
2052 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2053 ; GFX9-GISEL-NEXT: s_setpc_b64 s[30:31]
2055 ; GFX10-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split1:
2056 ; GFX10-GISEL: ; %bb.0:
2057 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2058 ; GFX10-GISEL-NEXT: s_movk_i32 s4, 0x2000
2059 ; GFX10-GISEL-NEXT: s_brev_b32 s5, 1
2060 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v2, s4
2061 ; GFX10-GISEL-NEXT: v_mov_b32_e32 v3, s5
2062 ; GFX10-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
2063 ; GFX10-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
2064 ; GFX10-GISEL-NEXT: flat_load_ubyte v0, v[0:1]
2065 ; GFX10-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2066 ; GFX10-GISEL-NEXT: s_setpc_b64 s[30:31]
2068 ; GFX11-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split1:
2069 ; GFX11-GISEL: ; %bb.0:
2070 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2071 ; GFX11-GISEL-NEXT: s_movk_i32 s0, 0x2000
2072 ; GFX11-GISEL-NEXT: s_brev_b32 s1, 1
2073 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2074 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
2075 ; GFX11-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
2076 ; GFX11-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
2077 ; GFX11-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
2078 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1]
2079 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2080 ; GFX11-GISEL-NEXT: s_setpc_b64 s[30:31]
2082 ; GFX12-GISEL-LABEL: flat_inst_valu_offset_64bit_13bit_neg_high_split1:
2083 ; GFX12-GISEL: ; %bb.0:
2084 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
2085 ; GFX12-GISEL-NEXT: s_wait_expcnt 0x0
2086 ; GFX12-GISEL-NEXT: s_wait_samplecnt 0x0
2087 ; GFX12-GISEL-NEXT: s_wait_bvhcnt 0x0
2088 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
2089 ; GFX12-GISEL-NEXT: s_movk_i32 s0, 0x2000
2090 ; GFX12-GISEL-NEXT: s_brev_b32 s1, 1
2091 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
2092 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
2093 ; GFX12-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, v0, v2
2094 ; GFX12-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
2095 ; GFX12-GISEL-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
2096 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1]
2097 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
2098 ; GFX12-GISEL-NEXT: s_setpc_b64 s[30:31]
2099 %gep = getelementptr i8, ptr %p, i64 -9223372036854767616
2100 %load = load i8, ptr %gep, align 4
2104 define amdgpu_kernel void @flat_inst_salu_offset_1(ptr %p) {
2105 ; GFX9-LABEL: flat_inst_salu_offset_1:
2107 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2108 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
2109 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
2110 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
2111 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1] offset:1 glc
2112 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2113 ; GFX9-NEXT: flat_store_byte v[0:1], v0
2114 ; GFX9-NEXT: s_endpgm
2116 ; GFX10-LABEL: flat_inst_salu_offset_1:
2118 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2119 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2120 ; GFX10-NEXT: s_add_u32 s0, s0, 1
2121 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
2122 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2123 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2124 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2125 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2126 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2127 ; GFX10-NEXT: s_endpgm
2129 ; GFX11-LABEL: flat_inst_salu_offset_1:
2131 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2132 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2133 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2134 ; GFX11-NEXT: flat_load_u8 v0, v[0:1] offset:1 glc dlc
2135 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2136 ; GFX11-NEXT: flat_store_b8 v[0:1], v0
2137 ; GFX11-NEXT: s_endpgm
2139 ; GFX12-LABEL: flat_inst_salu_offset_1:
2141 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2142 ; GFX12-NEXT: s_wait_kmcnt 0x0
2143 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2144 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:1 scope:SCOPE_SYS
2145 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2146 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2147 ; GFX12-NEXT: s_endpgm
2148 %gep = getelementptr i8, ptr %p, i64 1
2149 %load = load volatile i8, ptr %gep, align 1
2150 store i8 %load, ptr undef
2154 define amdgpu_kernel void @flat_inst_salu_offset_11bit_max(ptr %p) {
2155 ; GFX9-LABEL: flat_inst_salu_offset_11bit_max:
2157 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2158 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
2159 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
2160 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
2161 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1] offset:2047 glc
2162 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2163 ; GFX9-NEXT: flat_store_byte v[0:1], v0
2164 ; GFX9-NEXT: s_endpgm
2166 ; GFX10-LABEL: flat_inst_salu_offset_11bit_max:
2168 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2169 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2170 ; GFX10-NEXT: s_add_u32 s0, s0, 0x7ff
2171 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
2172 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2173 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2174 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2175 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2176 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2177 ; GFX10-NEXT: s_endpgm
2179 ; GFX11-LABEL: flat_inst_salu_offset_11bit_max:
2181 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2182 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2183 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2184 ; GFX11-NEXT: flat_load_u8 v0, v[0:1] offset:2047 glc dlc
2185 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2186 ; GFX11-NEXT: flat_store_b8 v[0:1], v0
2187 ; GFX11-NEXT: s_endpgm
2189 ; GFX12-LABEL: flat_inst_salu_offset_11bit_max:
2191 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2192 ; GFX12-NEXT: s_wait_kmcnt 0x0
2193 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2194 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:2047 scope:SCOPE_SYS
2195 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2196 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2197 ; GFX12-NEXT: s_endpgm
2198 %gep = getelementptr i8, ptr %p, i64 2047
2199 %load = load volatile i8, ptr %gep, align 1
2200 store i8 %load, ptr undef
2204 define amdgpu_kernel void @flat_inst_salu_offset_12bit_max(ptr %p) {
2205 ; GFX9-LABEL: flat_inst_salu_offset_12bit_max:
2207 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2208 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
2209 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
2210 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
2211 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1] offset:4095 glc
2212 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2213 ; GFX9-NEXT: flat_store_byte v[0:1], v0
2214 ; GFX9-NEXT: s_endpgm
2216 ; GFX10-LABEL: flat_inst_salu_offset_12bit_max:
2218 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2219 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2220 ; GFX10-NEXT: s_add_u32 s0, s0, 0xfff
2221 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
2222 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2223 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2224 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2225 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2226 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2227 ; GFX10-NEXT: s_endpgm
2229 ; GFX11-LABEL: flat_inst_salu_offset_12bit_max:
2231 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2232 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2233 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2234 ; GFX11-NEXT: flat_load_u8 v0, v[0:1] offset:4095 glc dlc
2235 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2236 ; GFX11-NEXT: flat_store_b8 v[0:1], v0
2237 ; GFX11-NEXT: s_endpgm
2239 ; GFX12-LABEL: flat_inst_salu_offset_12bit_max:
2241 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2242 ; GFX12-NEXT: s_wait_kmcnt 0x0
2243 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2244 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:4095 scope:SCOPE_SYS
2245 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2246 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2247 ; GFX12-NEXT: s_endpgm
2248 %gep = getelementptr i8, ptr %p, i64 4095
2249 %load = load volatile i8, ptr %gep, align 1
2250 store i8 %load, ptr undef
2254 define amdgpu_kernel void @flat_inst_salu_offset_13bit_max(ptr %p) {
2255 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_13bit_max:
2256 ; GFX9-SDAG: ; %bb.0:
2257 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2258 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2259 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2260 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2261 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
2262 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
2263 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095 glc
2264 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2265 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2266 ; GFX9-SDAG-NEXT: s_endpgm
2268 ; GFX10-LABEL: flat_inst_salu_offset_13bit_max:
2270 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2271 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2272 ; GFX10-NEXT: s_add_u32 s0, s0, 0x1fff
2273 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
2274 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2275 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2276 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2277 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2278 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2279 ; GFX10-NEXT: s_endpgm
2281 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_13bit_max:
2282 ; GFX11-SDAG: ; %bb.0:
2283 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2284 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2285 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0x1000, s0
2286 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2287 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 0, s1, s0
2288 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095 glc dlc
2289 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2290 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2291 ; GFX11-SDAG-NEXT: s_endpgm
2293 ; GFX12-LABEL: flat_inst_salu_offset_13bit_max:
2295 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2296 ; GFX12-NEXT: s_wait_kmcnt 0x0
2297 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2298 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:8191 scope:SCOPE_SYS
2299 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2300 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2301 ; GFX12-NEXT: s_endpgm
2303 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_13bit_max:
2304 ; GFX9-GISEL: ; %bb.0:
2305 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2306 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2307 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x1fff
2308 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0
2309 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
2310 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
2311 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
2312 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2313 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
2314 ; GFX9-GISEL-NEXT: s_endpgm
2316 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_13bit_max:
2317 ; GFX11-GISEL: ; %bb.0:
2318 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2319 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2320 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x1fff
2321 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0
2322 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2323 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2324 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2325 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2326 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
2327 ; GFX11-GISEL-NEXT: s_endpgm
2328 %gep = getelementptr i8, ptr %p, i64 8191
2329 %load = load volatile i8, ptr %gep, align 1
2330 store i8 %load, ptr undef
2334 define amdgpu_kernel void @flat_inst_salu_offset_neg_11bit_max(ptr %p) {
2335 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_neg_11bit_max:
2336 ; GFX9-SDAG: ; %bb.0:
2337 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2338 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2339 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2340 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2341 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xfffff800, v0
2342 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
2343 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
2344 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2345 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2346 ; GFX9-SDAG-NEXT: s_endpgm
2348 ; GFX10-LABEL: flat_inst_salu_offset_neg_11bit_max:
2350 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2351 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2352 ; GFX10-NEXT: s_add_u32 s0, s0, 0xfffff800
2353 ; GFX10-NEXT: s_addc_u32 s1, s1, -1
2354 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2355 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2356 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2357 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2358 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2359 ; GFX10-NEXT: s_endpgm
2361 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_neg_11bit_max:
2362 ; GFX11-SDAG: ; %bb.0:
2363 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2364 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2365 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0xfffff800, s0
2366 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2367 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, -1, s1, s0
2368 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2369 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2370 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2371 ; GFX11-SDAG-NEXT: s_endpgm
2373 ; GFX12-LABEL: flat_inst_salu_offset_neg_11bit_max:
2375 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2376 ; GFX12-NEXT: s_wait_kmcnt 0x0
2377 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2378 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-2048 scope:SCOPE_SYS
2379 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2380 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2381 ; GFX12-NEXT: s_endpgm
2383 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_neg_11bit_max:
2384 ; GFX9-GISEL: ; %bb.0:
2385 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2386 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2387 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0xfffff800
2388 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, -1
2389 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
2390 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
2391 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
2392 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2393 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
2394 ; GFX9-GISEL-NEXT: s_endpgm
2396 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_neg_11bit_max:
2397 ; GFX11-GISEL: ; %bb.0:
2398 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2399 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2400 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0xfffff800
2401 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, -1
2402 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2403 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2404 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2405 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2406 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
2407 ; GFX11-GISEL-NEXT: s_endpgm
2408 %gep = getelementptr i8, ptr %p, i64 -2048
2409 %load = load volatile i8, ptr %gep, align 1
2410 store i8 %load, ptr undef
2414 define amdgpu_kernel void @flat_inst_salu_offset_neg_12bit_max(ptr %p) {
2415 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_neg_12bit_max:
2416 ; GFX9-SDAG: ; %bb.0:
2417 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2418 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2419 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2420 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2421 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xfffff000, v0
2422 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
2423 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
2424 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2425 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2426 ; GFX9-SDAG-NEXT: s_endpgm
2428 ; GFX10-LABEL: flat_inst_salu_offset_neg_12bit_max:
2430 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2431 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2432 ; GFX10-NEXT: s_add_u32 s0, s0, 0xfffff000
2433 ; GFX10-NEXT: s_addc_u32 s1, s1, -1
2434 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2435 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2436 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2437 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2438 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2439 ; GFX10-NEXT: s_endpgm
2441 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_neg_12bit_max:
2442 ; GFX11-SDAG: ; %bb.0:
2443 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2444 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2445 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0xfffff000, s0
2446 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2447 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, -1, s1, s0
2448 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2449 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2450 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2451 ; GFX11-SDAG-NEXT: s_endpgm
2453 ; GFX12-LABEL: flat_inst_salu_offset_neg_12bit_max:
2455 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2456 ; GFX12-NEXT: s_wait_kmcnt 0x0
2457 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2458 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-4096 scope:SCOPE_SYS
2459 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2460 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2461 ; GFX12-NEXT: s_endpgm
2463 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_neg_12bit_max:
2464 ; GFX9-GISEL: ; %bb.0:
2465 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2466 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2467 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0xfffff000
2468 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, -1
2469 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
2470 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
2471 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
2472 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2473 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
2474 ; GFX9-GISEL-NEXT: s_endpgm
2476 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_neg_12bit_max:
2477 ; GFX11-GISEL: ; %bb.0:
2478 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2479 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2480 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0xfffff000
2481 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, -1
2482 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2483 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2484 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2485 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2486 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
2487 ; GFX11-GISEL-NEXT: s_endpgm
2488 %gep = getelementptr i8, ptr %p, i64 -4096
2489 %load = load volatile i8, ptr %gep, align 1
2490 store i8 %load, ptr undef
2494 define amdgpu_kernel void @flat_inst_salu_offset_neg_13bit_max(ptr %p) {
2495 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_neg_13bit_max:
2496 ; GFX9-SDAG: ; %bb.0:
2497 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2498 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2499 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2500 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2501 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xffffe000, v0
2502 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
2503 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
2504 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2505 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2506 ; GFX9-SDAG-NEXT: s_endpgm
2508 ; GFX10-LABEL: flat_inst_salu_offset_neg_13bit_max:
2510 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2511 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2512 ; GFX10-NEXT: s_add_u32 s0, s0, 0xffffe000
2513 ; GFX10-NEXT: s_addc_u32 s1, s1, -1
2514 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2515 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2516 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2517 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2518 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2519 ; GFX10-NEXT: s_endpgm
2521 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_neg_13bit_max:
2522 ; GFX11-SDAG: ; %bb.0:
2523 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2524 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2525 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0xffffe000, s0
2526 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2527 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, -1, s1, s0
2528 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2529 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2530 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2531 ; GFX11-SDAG-NEXT: s_endpgm
2533 ; GFX12-LABEL: flat_inst_salu_offset_neg_13bit_max:
2535 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2536 ; GFX12-NEXT: s_wait_kmcnt 0x0
2537 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2538 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-8192 scope:SCOPE_SYS
2539 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2540 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2541 ; GFX12-NEXT: s_endpgm
2543 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_neg_13bit_max:
2544 ; GFX9-GISEL: ; %bb.0:
2545 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2546 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2547 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0xffffe000
2548 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, -1
2549 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
2550 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
2551 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
2552 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2553 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
2554 ; GFX9-GISEL-NEXT: s_endpgm
2556 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_neg_13bit_max:
2557 ; GFX11-GISEL: ; %bb.0:
2558 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2559 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2560 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0xffffe000
2561 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, -1
2562 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2563 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2564 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2565 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2566 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
2567 ; GFX11-GISEL-NEXT: s_endpgm
2568 %gep = getelementptr i8, ptr %p, i64 -8192
2569 %load = load volatile i8, ptr %gep, align 1
2570 store i8 %load, ptr undef
2574 define amdgpu_kernel void @flat_inst_salu_offset_2x_11bit_max(ptr %p) {
2575 ; GFX9-LABEL: flat_inst_salu_offset_2x_11bit_max:
2577 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2578 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
2579 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
2580 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
2581 ; GFX9-NEXT: flat_load_ubyte v0, v[0:1] offset:4095 glc
2582 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2583 ; GFX9-NEXT: flat_store_byte v[0:1], v0
2584 ; GFX9-NEXT: s_endpgm
2586 ; GFX10-LABEL: flat_inst_salu_offset_2x_11bit_max:
2588 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2589 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2590 ; GFX10-NEXT: s_add_u32 s0, s0, 0xfff
2591 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
2592 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2593 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2594 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2595 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2596 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2597 ; GFX10-NEXT: s_endpgm
2599 ; GFX11-LABEL: flat_inst_salu_offset_2x_11bit_max:
2601 ; GFX11-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2602 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
2603 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2604 ; GFX11-NEXT: flat_load_u8 v0, v[0:1] offset:4095 glc dlc
2605 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2606 ; GFX11-NEXT: flat_store_b8 v[0:1], v0
2607 ; GFX11-NEXT: s_endpgm
2609 ; GFX12-LABEL: flat_inst_salu_offset_2x_11bit_max:
2611 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2612 ; GFX12-NEXT: s_wait_kmcnt 0x0
2613 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2614 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:4095 scope:SCOPE_SYS
2615 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2616 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2617 ; GFX12-NEXT: s_endpgm
2618 %gep = getelementptr i8, ptr %p, i64 4095
2619 %load = load volatile i8, ptr %gep, align 1
2620 store i8 %load, ptr undef
2624 define amdgpu_kernel void @flat_inst_salu_offset_2x_12bit_max(ptr %p) {
2625 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_2x_12bit_max:
2626 ; GFX9-SDAG: ; %bb.0:
2627 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2628 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2629 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2630 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2631 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
2632 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
2633 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095 glc
2634 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2635 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2636 ; GFX9-SDAG-NEXT: s_endpgm
2638 ; GFX10-LABEL: flat_inst_salu_offset_2x_12bit_max:
2640 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2641 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2642 ; GFX10-NEXT: s_add_u32 s0, s0, 0x1fff
2643 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
2644 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2645 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2646 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2647 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2648 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2649 ; GFX10-NEXT: s_endpgm
2651 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_2x_12bit_max:
2652 ; GFX11-SDAG: ; %bb.0:
2653 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2654 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2655 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0x1000, s0
2656 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2657 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 0, s1, s0
2658 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095 glc dlc
2659 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2660 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2661 ; GFX11-SDAG-NEXT: s_endpgm
2663 ; GFX12-LABEL: flat_inst_salu_offset_2x_12bit_max:
2665 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2666 ; GFX12-NEXT: s_wait_kmcnt 0x0
2667 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2668 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:8191 scope:SCOPE_SYS
2669 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2670 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2671 ; GFX12-NEXT: s_endpgm
2673 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_2x_12bit_max:
2674 ; GFX9-GISEL: ; %bb.0:
2675 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2676 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2677 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x1fff
2678 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0
2679 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
2680 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
2681 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
2682 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2683 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
2684 ; GFX9-GISEL-NEXT: s_endpgm
2686 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_2x_12bit_max:
2687 ; GFX11-GISEL: ; %bb.0:
2688 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2689 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2690 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x1fff
2691 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0
2692 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2693 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2694 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2695 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2696 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
2697 ; GFX11-GISEL-NEXT: s_endpgm
2698 %gep = getelementptr i8, ptr %p, i64 8191
2699 %load = load volatile i8, ptr %gep, align 1
2700 store i8 %load, ptr undef
2704 define amdgpu_kernel void @flat_inst_salu_offset_2x_13bit_max(ptr %p) {
2705 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_2x_13bit_max:
2706 ; GFX9-SDAG: ; %bb.0:
2707 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2708 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2709 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2710 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2711 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x3000, v0
2712 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 0, v1, vcc
2713 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095 glc
2714 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2715 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2716 ; GFX9-SDAG-NEXT: s_endpgm
2718 ; GFX10-LABEL: flat_inst_salu_offset_2x_13bit_max:
2720 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2721 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2722 ; GFX10-NEXT: s_add_u32 s0, s0, 0x3fff
2723 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
2724 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2725 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2726 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2727 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2728 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2729 ; GFX10-NEXT: s_endpgm
2731 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_2x_13bit_max:
2732 ; GFX11-SDAG: ; %bb.0:
2733 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2734 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2735 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0x3000, s0
2736 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2737 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 0, s1, s0
2738 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095 glc dlc
2739 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2740 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2741 ; GFX11-SDAG-NEXT: s_endpgm
2743 ; GFX12-LABEL: flat_inst_salu_offset_2x_13bit_max:
2745 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2746 ; GFX12-NEXT: s_wait_kmcnt 0x0
2747 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2748 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:16383 scope:SCOPE_SYS
2749 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2750 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2751 ; GFX12-NEXT: s_endpgm
2753 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_2x_13bit_max:
2754 ; GFX9-GISEL: ; %bb.0:
2755 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2756 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2757 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x3fff
2758 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0
2759 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
2760 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
2761 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
2762 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2763 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
2764 ; GFX9-GISEL-NEXT: s_endpgm
2766 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_2x_13bit_max:
2767 ; GFX11-GISEL: ; %bb.0:
2768 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2769 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2770 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x3fff
2771 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0
2772 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2773 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2774 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2775 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2776 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
2777 ; GFX11-GISEL-NEXT: s_endpgm
2778 %gep = getelementptr i8, ptr %p, i64 16383
2779 %load = load volatile i8, ptr %gep, align 1
2780 store i8 %load, ptr undef
2784 define amdgpu_kernel void @flat_inst_salu_offset_2x_neg_11bit_max(ptr %p) {
2785 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_2x_neg_11bit_max:
2786 ; GFX9-SDAG: ; %bb.0:
2787 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2788 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2789 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2790 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2791 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xfffff000, v0
2792 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
2793 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
2794 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2795 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2796 ; GFX9-SDAG-NEXT: s_endpgm
2798 ; GFX10-LABEL: flat_inst_salu_offset_2x_neg_11bit_max:
2800 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2801 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2802 ; GFX10-NEXT: s_add_u32 s0, s0, 0xfffff000
2803 ; GFX10-NEXT: s_addc_u32 s1, s1, -1
2804 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2805 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2806 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2807 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2808 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2809 ; GFX10-NEXT: s_endpgm
2811 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_2x_neg_11bit_max:
2812 ; GFX11-SDAG: ; %bb.0:
2813 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2814 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2815 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0xfffff000, s0
2816 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2817 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, -1, s1, s0
2818 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2819 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2820 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2821 ; GFX11-SDAG-NEXT: s_endpgm
2823 ; GFX12-LABEL: flat_inst_salu_offset_2x_neg_11bit_max:
2825 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2826 ; GFX12-NEXT: s_wait_kmcnt 0x0
2827 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2828 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-4096 scope:SCOPE_SYS
2829 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2830 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2831 ; GFX12-NEXT: s_endpgm
2833 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_2x_neg_11bit_max:
2834 ; GFX9-GISEL: ; %bb.0:
2835 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2836 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2837 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0xfffff000
2838 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, -1
2839 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
2840 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
2841 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
2842 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2843 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
2844 ; GFX9-GISEL-NEXT: s_endpgm
2846 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_2x_neg_11bit_max:
2847 ; GFX11-GISEL: ; %bb.0:
2848 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2849 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2850 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0xfffff000
2851 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, -1
2852 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2853 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2854 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2855 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2856 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
2857 ; GFX11-GISEL-NEXT: s_endpgm
2858 %gep = getelementptr i8, ptr %p, i64 -4096
2859 %load = load volatile i8, ptr %gep, align 1
2860 store i8 %load, ptr undef
2864 define amdgpu_kernel void @flat_inst_salu_offset_2x_neg_12bit_max(ptr %p) {
2865 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_2x_neg_12bit_max:
2866 ; GFX9-SDAG: ; %bb.0:
2867 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2868 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2869 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2870 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2871 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xffffe000, v0
2872 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
2873 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
2874 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2875 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2876 ; GFX9-SDAG-NEXT: s_endpgm
2878 ; GFX10-LABEL: flat_inst_salu_offset_2x_neg_12bit_max:
2880 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2881 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2882 ; GFX10-NEXT: s_add_u32 s0, s0, 0xffffe000
2883 ; GFX10-NEXT: s_addc_u32 s1, s1, -1
2884 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2885 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2886 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2887 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2888 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2889 ; GFX10-NEXT: s_endpgm
2891 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_2x_neg_12bit_max:
2892 ; GFX11-SDAG: ; %bb.0:
2893 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2894 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2895 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0xffffe000, s0
2896 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2897 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, -1, s1, s0
2898 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2899 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2900 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2901 ; GFX11-SDAG-NEXT: s_endpgm
2903 ; GFX12-LABEL: flat_inst_salu_offset_2x_neg_12bit_max:
2905 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2906 ; GFX12-NEXT: s_wait_kmcnt 0x0
2907 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2908 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-8192 scope:SCOPE_SYS
2909 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2910 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2911 ; GFX12-NEXT: s_endpgm
2913 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_2x_neg_12bit_max:
2914 ; GFX9-GISEL: ; %bb.0:
2915 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2916 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2917 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0xffffe000
2918 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, -1
2919 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
2920 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
2921 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
2922 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2923 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
2924 ; GFX9-GISEL-NEXT: s_endpgm
2926 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_2x_neg_12bit_max:
2927 ; GFX11-GISEL: ; %bb.0:
2928 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2929 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2930 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0xffffe000
2931 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, -1
2932 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
2933 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2934 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2935 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2936 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
2937 ; GFX11-GISEL-NEXT: s_endpgm
2938 %gep = getelementptr i8, ptr %p, i64 -8192
2939 %load = load volatile i8, ptr %gep, align 1
2940 store i8 %load, ptr undef
2944 define amdgpu_kernel void @flat_inst_salu_offset_2x_neg_13bit_max(ptr %p) {
2945 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_2x_neg_13bit_max:
2946 ; GFX9-SDAG: ; %bb.0:
2947 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2948 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2949 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
2950 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
2951 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xffffc000, v0
2952 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, -1, v1, vcc
2953 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
2954 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2955 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
2956 ; GFX9-SDAG-NEXT: s_endpgm
2958 ; GFX10-LABEL: flat_inst_salu_offset_2x_neg_13bit_max:
2960 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2961 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
2962 ; GFX10-NEXT: s_add_u32 s0, s0, 0xffffc000
2963 ; GFX10-NEXT: s_addc_u32 s1, s1, -1
2964 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2965 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2966 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
2967 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2968 ; GFX10-NEXT: flat_store_byte v[0:1], v0
2969 ; GFX10-NEXT: s_endpgm
2971 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_2x_neg_13bit_max:
2972 ; GFX11-SDAG: ; %bb.0:
2973 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2974 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
2975 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0xffffc000, s0
2976 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
2977 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, -1, s1, s0
2978 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
2979 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
2980 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
2981 ; GFX11-SDAG-NEXT: s_endpgm
2983 ; GFX12-LABEL: flat_inst_salu_offset_2x_neg_13bit_max:
2985 ; GFX12-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
2986 ; GFX12-NEXT: s_wait_kmcnt 0x0
2987 ; GFX12-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2988 ; GFX12-NEXT: flat_load_u8 v0, v[0:1] offset:-16384 scope:SCOPE_SYS
2989 ; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0
2990 ; GFX12-NEXT: flat_store_b8 v[0:1], v0
2991 ; GFX12-NEXT: s_endpgm
2993 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_2x_neg_13bit_max:
2994 ; GFX9-GISEL: ; %bb.0:
2995 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
2996 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
2997 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0xffffc000
2998 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, -1
2999 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3000 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3001 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3002 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3003 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3004 ; GFX9-GISEL-NEXT: s_endpgm
3006 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_2x_neg_13bit_max:
3007 ; GFX11-GISEL: ; %bb.0:
3008 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3009 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3010 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0xffffc000
3011 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, -1
3012 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3013 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3014 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3015 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3016 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3017 ; GFX11-GISEL-NEXT: s_endpgm
3018 %gep = getelementptr i8, ptr %p, i64 -16384
3019 %load = load volatile i8, ptr %gep, align 1
3020 store i8 %load, ptr undef
3024 ; Fill 11-bit low-bits (1ull << 33) | 2047
3025 define amdgpu_kernel void @flat_inst_salu_offset_64bit_11bit_split0(ptr %p) {
3026 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_split0:
3027 ; GFX9-SDAG: ; %bb.0:
3028 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3029 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3030 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
3031 ; GFX9-SDAG-NEXT: v_add_co_u32_e64 v0, vcc, 0, s0
3032 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
3033 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:2047 glc
3034 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3035 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3036 ; GFX9-SDAG-NEXT: s_endpgm
3038 ; GFX10-LABEL: flat_inst_salu_offset_64bit_11bit_split0:
3040 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3041 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3042 ; GFX10-NEXT: s_add_u32 s0, s0, 0x7ff
3043 ; GFX10-NEXT: s_addc_u32 s1, s1, 2
3044 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3045 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3046 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3047 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3048 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3049 ; GFX10-NEXT: s_endpgm
3051 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_split0:
3052 ; GFX11-SDAG: ; %bb.0:
3053 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3054 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3055 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3056 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3057 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3058 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:2047 glc dlc
3059 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3060 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3061 ; GFX11-SDAG-NEXT: s_endpgm
3063 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_split0:
3064 ; GFX12-SDAG: ; %bb.0:
3065 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3066 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3067 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3068 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3069 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3070 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:2047 scope:SCOPE_SYS
3071 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3072 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3073 ; GFX12-SDAG-NEXT: s_endpgm
3075 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_split0:
3076 ; GFX9-GISEL: ; %bb.0:
3077 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3078 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3079 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x7ff
3080 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 2
3081 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3082 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3083 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3084 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3085 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3086 ; GFX9-GISEL-NEXT: s_endpgm
3088 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_split0:
3089 ; GFX11-GISEL: ; %bb.0:
3090 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3091 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3092 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x7ff
3093 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 2
3094 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3095 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3096 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3097 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3098 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3099 ; GFX11-GISEL-NEXT: s_endpgm
3101 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_split0:
3102 ; GFX12-GISEL: ; %bb.0:
3103 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3104 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3105 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x7ff
3106 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 2
3107 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3108 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3109 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3110 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3111 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3112 ; GFX12-GISEL-NEXT: s_endpgm
3113 %gep = getelementptr i8, ptr %p, i64 8589936639
3114 %load = load volatile i8, ptr %gep, align 1
3115 store i8 %load, ptr undef
3119 ; Fill 11-bit low-bits (1ull << 33) | 2048
3120 define amdgpu_kernel void @flat_inst_salu_offset_64bit_11bit_split1(ptr %p) {
3121 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_split1:
3122 ; GFX9-SDAG: ; %bb.0:
3123 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3124 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3125 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
3126 ; GFX9-SDAG-NEXT: v_add_co_u32_e64 v0, vcc, 0, s0
3127 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
3128 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:2048 glc
3129 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3130 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3131 ; GFX9-SDAG-NEXT: s_endpgm
3133 ; GFX10-LABEL: flat_inst_salu_offset_64bit_11bit_split1:
3135 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3136 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3137 ; GFX10-NEXT: s_add_u32 s0, s0, 0x800
3138 ; GFX10-NEXT: s_addc_u32 s1, s1, 2
3139 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3140 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3141 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3142 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3143 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3144 ; GFX10-NEXT: s_endpgm
3146 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_split1:
3147 ; GFX11-SDAG: ; %bb.0:
3148 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3149 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3150 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3151 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3152 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3153 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:2048 glc dlc
3154 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3155 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3156 ; GFX11-SDAG-NEXT: s_endpgm
3158 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_split1:
3159 ; GFX12-SDAG: ; %bb.0:
3160 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3161 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3162 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3163 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3164 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3165 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:2048 scope:SCOPE_SYS
3166 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3167 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3168 ; GFX12-SDAG-NEXT: s_endpgm
3170 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_split1:
3171 ; GFX9-GISEL: ; %bb.0:
3172 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3173 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3174 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x800
3175 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 2
3176 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3177 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3178 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3179 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3180 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3181 ; GFX9-GISEL-NEXT: s_endpgm
3183 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_split1:
3184 ; GFX11-GISEL: ; %bb.0:
3185 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3186 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3187 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x800
3188 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 2
3189 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3190 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3191 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3192 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3193 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3194 ; GFX11-GISEL-NEXT: s_endpgm
3196 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_split1:
3197 ; GFX12-GISEL: ; %bb.0:
3198 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3199 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3200 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x800
3201 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 2
3202 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3203 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3204 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3205 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3206 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3207 ; GFX12-GISEL-NEXT: s_endpgm
3208 %gep = getelementptr i8, ptr %p, i64 8589936640
3209 %load = load volatile i8, ptr %gep, align 1
3210 store i8 %load, ptr undef
3214 ; Fill 12-bit low-bits (1ull << 33) | 4095
3215 define amdgpu_kernel void @flat_inst_salu_offset_64bit_12bit_split0(ptr %p) {
3216 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_split0:
3217 ; GFX9-SDAG: ; %bb.0:
3218 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3219 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3220 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
3221 ; GFX9-SDAG-NEXT: v_add_co_u32_e64 v0, vcc, 0, s0
3222 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
3223 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095 glc
3224 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3225 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3226 ; GFX9-SDAG-NEXT: s_endpgm
3228 ; GFX10-LABEL: flat_inst_salu_offset_64bit_12bit_split0:
3230 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3231 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3232 ; GFX10-NEXT: s_add_u32 s0, s0, 0xfff
3233 ; GFX10-NEXT: s_addc_u32 s1, s1, 2
3234 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3235 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3236 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3237 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3238 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3239 ; GFX10-NEXT: s_endpgm
3241 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_split0:
3242 ; GFX11-SDAG: ; %bb.0:
3243 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3244 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3245 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3246 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3247 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3248 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095 glc dlc
3249 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3250 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3251 ; GFX11-SDAG-NEXT: s_endpgm
3253 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_split0:
3254 ; GFX12-SDAG: ; %bb.0:
3255 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3256 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3257 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3258 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3259 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3260 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095 scope:SCOPE_SYS
3261 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3262 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3263 ; GFX12-SDAG-NEXT: s_endpgm
3265 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_split0:
3266 ; GFX9-GISEL: ; %bb.0:
3267 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3268 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3269 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0xfff
3270 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 2
3271 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3272 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3273 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3274 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3275 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3276 ; GFX9-GISEL-NEXT: s_endpgm
3278 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_split0:
3279 ; GFX11-GISEL: ; %bb.0:
3280 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3281 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3282 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0xfff
3283 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 2
3284 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3285 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3286 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3287 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3288 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3289 ; GFX11-GISEL-NEXT: s_endpgm
3291 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_split0:
3292 ; GFX12-GISEL: ; %bb.0:
3293 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3294 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3295 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0xfff
3296 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 2
3297 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3298 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3299 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3300 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3301 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3302 ; GFX12-GISEL-NEXT: s_endpgm
3303 %gep = getelementptr i8, ptr %p, i64 8589938687
3304 %load = load volatile i8, ptr %gep, align 1
3305 store i8 %load, ptr undef
3309 ; Fill 12-bit low-bits (1ull << 33) | 4096
3310 define amdgpu_kernel void @flat_inst_salu_offset_64bit_12bit_split1(ptr %p) {
3311 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_split1:
3312 ; GFX9-SDAG: ; %bb.0:
3313 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3314 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3315 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
3316 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
3317 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
3318 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
3319 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
3320 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3321 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3322 ; GFX9-SDAG-NEXT: s_endpgm
3324 ; GFX10-LABEL: flat_inst_salu_offset_64bit_12bit_split1:
3326 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3327 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3328 ; GFX10-NEXT: s_add_u32 s0, s0, 0x1000
3329 ; GFX10-NEXT: s_addc_u32 s1, s1, 2
3330 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3331 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3332 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3333 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3334 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3335 ; GFX10-NEXT: s_endpgm
3337 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_split1:
3338 ; GFX11-SDAG: ; %bb.0:
3339 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3340 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3341 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0x1000, s0
3342 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3343 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3344 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3345 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3346 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3347 ; GFX11-SDAG-NEXT: s_endpgm
3349 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_split1:
3350 ; GFX12-SDAG: ; %bb.0:
3351 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3352 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3353 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3354 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3355 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3356 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4096 scope:SCOPE_SYS
3357 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3358 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3359 ; GFX12-SDAG-NEXT: s_endpgm
3361 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_split1:
3362 ; GFX9-GISEL: ; %bb.0:
3363 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3364 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3365 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x1000
3366 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 2
3367 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3368 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3369 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3370 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3371 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3372 ; GFX9-GISEL-NEXT: s_endpgm
3374 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_split1:
3375 ; GFX11-GISEL: ; %bb.0:
3376 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3377 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3378 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x1000
3379 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 2
3380 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3381 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3382 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3383 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3384 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3385 ; GFX11-GISEL-NEXT: s_endpgm
3387 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_split1:
3388 ; GFX12-GISEL: ; %bb.0:
3389 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3390 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3391 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x1000
3392 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 2
3393 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3394 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3395 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3396 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3397 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3398 ; GFX12-GISEL-NEXT: s_endpgm
3399 %gep = getelementptr i8, ptr %p, i64 8589938688
3400 %load = load volatile i8, ptr %gep, align 1
3401 store i8 %load, ptr undef
3405 ; Fill 13-bit low-bits (1ull << 33) | 8191
3406 define amdgpu_kernel void @flat_inst_salu_offset_64bit_13bit_split0(ptr %p) {
3407 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_split0:
3408 ; GFX9-SDAG: ; %bb.0:
3409 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3410 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3411 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
3412 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
3413 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
3414 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
3415 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] offset:4095 glc
3416 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3417 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3418 ; GFX9-SDAG-NEXT: s_endpgm
3420 ; GFX10-LABEL: flat_inst_salu_offset_64bit_13bit_split0:
3422 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3423 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3424 ; GFX10-NEXT: s_add_u32 s0, s0, 0x1fff
3425 ; GFX10-NEXT: s_addc_u32 s1, s1, 2
3426 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3427 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3428 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3429 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3430 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3431 ; GFX10-NEXT: s_endpgm
3433 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_split0:
3434 ; GFX11-SDAG: ; %bb.0:
3435 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3436 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3437 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0x1000, s0
3438 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3439 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3440 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:4095 glc dlc
3441 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3442 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3443 ; GFX11-SDAG-NEXT: s_endpgm
3445 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_split0:
3446 ; GFX12-SDAG: ; %bb.0:
3447 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3448 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3449 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3450 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3451 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3452 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:8191 scope:SCOPE_SYS
3453 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3454 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3455 ; GFX12-SDAG-NEXT: s_endpgm
3457 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_split0:
3458 ; GFX9-GISEL: ; %bb.0:
3459 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3460 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3461 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x1fff
3462 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 2
3463 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3464 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3465 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3466 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3467 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3468 ; GFX9-GISEL-NEXT: s_endpgm
3470 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_split0:
3471 ; GFX11-GISEL: ; %bb.0:
3472 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3473 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3474 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x1fff
3475 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 2
3476 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3477 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3478 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3479 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3480 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3481 ; GFX11-GISEL-NEXT: s_endpgm
3483 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_split0:
3484 ; GFX12-GISEL: ; %bb.0:
3485 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3486 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3487 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x1fff
3488 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 2
3489 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3490 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3491 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3492 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3493 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3494 ; GFX12-GISEL-NEXT: s_endpgm
3495 %gep = getelementptr i8, ptr %p, i64 8589942783
3496 %load = load volatile i8, ptr %gep, align 1
3497 store i8 %load, ptr undef
3501 ; Fill 13-bit low-bits (1ull << 33) | 8192
3502 define amdgpu_kernel void @flat_inst_salu_offset_64bit_13bit_split1(ptr %p) {
3503 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_split1:
3504 ; GFX9-SDAG: ; %bb.0:
3505 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3506 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3507 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
3508 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v1, s1
3509 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x2000, v0
3510 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, 2, v1, vcc
3511 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
3512 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3513 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3514 ; GFX9-SDAG-NEXT: s_endpgm
3516 ; GFX10-LABEL: flat_inst_salu_offset_64bit_13bit_split1:
3518 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3519 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3520 ; GFX10-NEXT: s_add_u32 s0, s0, 0x2000
3521 ; GFX10-NEXT: s_addc_u32 s1, s1, 2
3522 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3523 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3524 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3525 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3526 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3527 ; GFX10-NEXT: s_endpgm
3529 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_split1:
3530 ; GFX11-SDAG: ; %bb.0:
3531 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3532 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3533 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, s0, 0x2000, s0
3534 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3535 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3536 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3537 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3538 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3539 ; GFX11-SDAG-NEXT: s_endpgm
3541 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_split1:
3542 ; GFX12-SDAG: ; %bb.0:
3543 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3544 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3545 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, s0, 0, s0
3546 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
3547 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e64 v1, null, 2, s1, s0
3548 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:8192 scope:SCOPE_SYS
3549 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3550 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3551 ; GFX12-SDAG-NEXT: s_endpgm
3553 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_split1:
3554 ; GFX9-GISEL: ; %bb.0:
3555 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3556 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3557 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x2000
3558 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 2
3559 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3560 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3561 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3562 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3563 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3564 ; GFX9-GISEL-NEXT: s_endpgm
3566 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_split1:
3567 ; GFX11-GISEL: ; %bb.0:
3568 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3569 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3570 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x2000
3571 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 2
3572 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3573 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3574 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3575 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3576 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3577 ; GFX11-GISEL-NEXT: s_endpgm
3579 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_split1:
3580 ; GFX12-GISEL: ; %bb.0:
3581 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3582 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3583 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x2000
3584 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 2
3585 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3586 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3587 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3588 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3589 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3590 ; GFX12-GISEL-NEXT: s_endpgm
3591 %gep = getelementptr i8, ptr %p, i64 8589942784
3592 %load = load volatile i8, ptr %gep, align 1
3593 store i8 %load, ptr undef
3597 ; Fill 11-bit low-bits, negative high bits (1ull << 63) | 2047
3598 define amdgpu_kernel void @flat_inst_salu_offset_64bit_11bit_neg_high_split0(ptr %p) {
3599 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split0:
3600 ; GFX9-SDAG: ; %bb.0:
3601 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3602 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v1, 1
3603 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3604 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
3605 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, s1
3606 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x7ff, v0
3607 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v2, vcc
3608 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
3609 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3610 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3611 ; GFX9-SDAG-NEXT: s_endpgm
3613 ; GFX10-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split0:
3615 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3616 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3617 ; GFX10-NEXT: s_add_u32 s0, s0, 0x7ff
3618 ; GFX10-NEXT: s_addc_u32 s1, s1, 0x80000000
3619 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3620 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3621 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3622 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3623 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3624 ; GFX10-NEXT: s_endpgm
3626 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split0:
3627 ; GFX11-SDAG: ; %bb.0:
3628 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3629 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3630 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v1, s1
3631 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x7ff, s0
3632 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
3633 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
3634 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3635 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3636 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3637 ; GFX11-SDAG-NEXT: s_endpgm
3639 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split0:
3640 ; GFX12-SDAG: ; %bb.0:
3641 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3642 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3643 ; GFX12-SDAG-NEXT: v_mov_b32_e32 v1, s1
3644 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, s0
3645 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
3646 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
3647 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8386561 scope:SCOPE_SYS
3648 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3649 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3650 ; GFX12-SDAG-NEXT: s_endpgm
3652 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split0:
3653 ; GFX9-GISEL: ; %bb.0:
3654 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3655 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3656 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x7ff
3657 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
3658 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3659 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3660 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3661 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3662 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3663 ; GFX9-GISEL-NEXT: s_endpgm
3665 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split0:
3666 ; GFX11-GISEL: ; %bb.0:
3667 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3668 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3669 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x7ff
3670 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
3671 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3672 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3673 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3674 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3675 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3676 ; GFX11-GISEL-NEXT: s_endpgm
3678 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split0:
3679 ; GFX12-GISEL: ; %bb.0:
3680 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3681 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3682 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x7ff
3683 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 0x80000000
3684 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3685 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3686 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3687 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3688 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3689 ; GFX12-GISEL-NEXT: s_endpgm
3690 %gep = getelementptr i8, ptr %p, i64 -9223372036854773761
3691 %load = load volatile i8, ptr %gep, align 1
3692 store i8 %load, ptr undef
3696 ; Fill 11-bit low-bits, negative high bits (1ull << 63) | 2048
3697 define amdgpu_kernel void @flat_inst_salu_offset_64bit_11bit_neg_high_split1(ptr %p) {
3698 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split1:
3699 ; GFX9-SDAG: ; %bb.0:
3700 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3701 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v1, 1
3702 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3703 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
3704 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, s1
3705 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x800, v0
3706 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v2, vcc
3707 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
3708 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3709 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3710 ; GFX9-SDAG-NEXT: s_endpgm
3712 ; GFX10-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split1:
3714 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3715 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3716 ; GFX10-NEXT: s_add_u32 s0, s0, 0x800
3717 ; GFX10-NEXT: s_addc_u32 s1, s1, 0x80000000
3718 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3719 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3720 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3721 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3722 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3723 ; GFX10-NEXT: s_endpgm
3725 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split1:
3726 ; GFX11-SDAG: ; %bb.0:
3727 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3728 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3729 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v1, s1
3730 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800, s0
3731 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
3732 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
3733 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3734 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3735 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3736 ; GFX11-SDAG-NEXT: s_endpgm
3738 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split1:
3739 ; GFX12-SDAG: ; %bb.0:
3740 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3741 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3742 ; GFX12-SDAG-NEXT: v_mov_b32_e32 v1, s1
3743 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, s0
3744 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
3745 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
3746 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8386560 scope:SCOPE_SYS
3747 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3748 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3749 ; GFX12-SDAG-NEXT: s_endpgm
3751 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split1:
3752 ; GFX9-GISEL: ; %bb.0:
3753 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3754 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3755 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x800
3756 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
3757 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3758 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3759 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3760 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3761 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3762 ; GFX9-GISEL-NEXT: s_endpgm
3764 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split1:
3765 ; GFX11-GISEL: ; %bb.0:
3766 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3767 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3768 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x800
3769 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
3770 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3771 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3772 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3773 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3774 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3775 ; GFX11-GISEL-NEXT: s_endpgm
3777 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_11bit_neg_high_split1:
3778 ; GFX12-GISEL: ; %bb.0:
3779 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3780 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3781 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x800
3782 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 0x80000000
3783 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3784 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3785 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3786 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3787 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3788 ; GFX12-GISEL-NEXT: s_endpgm
3789 %gep = getelementptr i8, ptr %p, i64 -9223372036854773760
3790 %load = load volatile i8, ptr %gep, align 1
3791 store i8 %load, ptr undef
3795 ; Fill 12-bit low-bits, negative high bits (1ull << 63) | 4095
3796 define amdgpu_kernel void @flat_inst_salu_offset_64bit_12bit_neg_high_split0(ptr %p) {
3797 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split0:
3798 ; GFX9-SDAG: ; %bb.0:
3799 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3800 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v1, 1
3801 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3802 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
3803 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, s1
3804 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0xfff, v0
3805 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v2, vcc
3806 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
3807 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3808 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3809 ; GFX9-SDAG-NEXT: s_endpgm
3811 ; GFX10-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split0:
3813 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3814 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3815 ; GFX10-NEXT: s_add_u32 s0, s0, 0xfff
3816 ; GFX10-NEXT: s_addc_u32 s1, s1, 0x80000000
3817 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3818 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3819 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3820 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3821 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3822 ; GFX10-NEXT: s_endpgm
3824 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split0:
3825 ; GFX11-SDAG: ; %bb.0:
3826 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3827 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3828 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v1, s1
3829 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0xfff, s0
3830 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
3831 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
3832 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3833 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3834 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3835 ; GFX11-SDAG-NEXT: s_endpgm
3837 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split0:
3838 ; GFX12-SDAG: ; %bb.0:
3839 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3840 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3841 ; GFX12-SDAG-NEXT: v_mov_b32_e32 v1, s1
3842 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, s0
3843 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
3844 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
3845 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8384513 scope:SCOPE_SYS
3846 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3847 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3848 ; GFX12-SDAG-NEXT: s_endpgm
3850 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split0:
3851 ; GFX9-GISEL: ; %bb.0:
3852 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3853 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3854 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0xfff
3855 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
3856 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3857 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3858 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3859 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3860 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3861 ; GFX9-GISEL-NEXT: s_endpgm
3863 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split0:
3864 ; GFX11-GISEL: ; %bb.0:
3865 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3866 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3867 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0xfff
3868 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
3869 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3870 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3871 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3872 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3873 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3874 ; GFX11-GISEL-NEXT: s_endpgm
3876 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split0:
3877 ; GFX12-GISEL: ; %bb.0:
3878 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3879 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3880 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0xfff
3881 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 0x80000000
3882 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3883 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3884 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3885 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3886 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3887 ; GFX12-GISEL-NEXT: s_endpgm
3888 %gep = getelementptr i8, ptr %p, i64 -9223372036854771713
3889 %load = load volatile i8, ptr %gep, align 1
3890 store i8 %load, ptr undef
3894 ; Fill 12-bit low-bits, negative high bits (1ull << 63) | 4096
3895 define amdgpu_kernel void @flat_inst_salu_offset_64bit_12bit_neg_high_split1(ptr %p) {
3896 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split1:
3897 ; GFX9-SDAG: ; %bb.0:
3898 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3899 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v1, 1
3900 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3901 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
3902 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, s1
3903 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1000, v0
3904 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v2, vcc
3905 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
3906 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3907 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
3908 ; GFX9-SDAG-NEXT: s_endpgm
3910 ; GFX10-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split1:
3912 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3913 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
3914 ; GFX10-NEXT: s_add_u32 s0, s0, 0x1000
3915 ; GFX10-NEXT: s_addc_u32 s1, s1, 0x80000000
3916 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3917 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3918 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
3919 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3920 ; GFX10-NEXT: flat_store_byte v[0:1], v0
3921 ; GFX10-NEXT: s_endpgm
3923 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split1:
3924 ; GFX11-SDAG: ; %bb.0:
3925 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3926 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
3927 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v1, s1
3928 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1000, s0
3929 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
3930 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
3931 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3932 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3933 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
3934 ; GFX11-SDAG-NEXT: s_endpgm
3936 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split1:
3937 ; GFX12-SDAG: ; %bb.0:
3938 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3939 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
3940 ; GFX12-SDAG-NEXT: v_mov_b32_e32 v1, s1
3941 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, s0
3942 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
3943 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
3944 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8384512 scope:SCOPE_SYS
3945 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
3946 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
3947 ; GFX12-SDAG-NEXT: s_endpgm
3949 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split1:
3950 ; GFX9-GISEL: ; %bb.0:
3951 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3952 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3953 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x1000
3954 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
3955 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
3956 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
3957 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
3958 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3959 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
3960 ; GFX9-GISEL-NEXT: s_endpgm
3962 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split1:
3963 ; GFX11-GISEL: ; %bb.0:
3964 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3965 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
3966 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x1000
3967 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
3968 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3969 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3970 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
3971 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
3972 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
3973 ; GFX11-GISEL-NEXT: s_endpgm
3975 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_12bit_neg_high_split1:
3976 ; GFX12-GISEL: ; %bb.0:
3977 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
3978 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
3979 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x1000
3980 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 0x80000000
3981 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
3982 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3983 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
3984 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
3985 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
3986 ; GFX12-GISEL-NEXT: s_endpgm
3987 %gep = getelementptr i8, ptr %p, i64 -9223372036854771712
3988 %load = load volatile i8, ptr %gep, align 1
3989 store i8 %load, ptr undef
3993 ; Fill 13-bit low-bits, negative high bits (1ull << 63) | 8191
3994 define amdgpu_kernel void @flat_inst_salu_offset_64bit_13bit_neg_high_split0(ptr %p) {
3995 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split0:
3996 ; GFX9-SDAG: ; %bb.0:
3997 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
3998 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v1, 1
3999 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
4000 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
4001 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, s1
4002 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x1fff, v0
4003 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v2, vcc
4004 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
4005 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4006 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
4007 ; GFX9-SDAG-NEXT: s_endpgm
4009 ; GFX10-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split0:
4011 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
4012 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
4013 ; GFX10-NEXT: s_add_u32 s0, s0, 0x1fff
4014 ; GFX10-NEXT: s_addc_u32 s1, s1, 0x80000000
4015 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
4016 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
4017 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
4018 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4019 ; GFX10-NEXT: flat_store_byte v[0:1], v0
4020 ; GFX10-NEXT: s_endpgm
4022 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split0:
4023 ; GFX11-SDAG: ; %bb.0:
4024 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
4025 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
4026 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v1, s1
4027 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x1fff, s0
4028 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
4029 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
4030 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
4031 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4032 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
4033 ; GFX11-SDAG-NEXT: s_endpgm
4035 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split0:
4036 ; GFX12-SDAG: ; %bb.0:
4037 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
4038 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
4039 ; GFX12-SDAG-NEXT: v_mov_b32_e32 v1, s1
4040 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, s0
4041 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
4042 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
4043 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8380417 scope:SCOPE_SYS
4044 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
4045 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
4046 ; GFX12-SDAG-NEXT: s_endpgm
4048 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split0:
4049 ; GFX9-GISEL: ; %bb.0:
4050 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
4051 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
4052 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x1fff
4053 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
4054 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
4055 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
4056 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
4057 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4058 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
4059 ; GFX9-GISEL-NEXT: s_endpgm
4061 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split0:
4062 ; GFX11-GISEL: ; %bb.0:
4063 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
4064 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
4065 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x1fff
4066 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
4067 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4068 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
4069 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
4070 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4071 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
4072 ; GFX11-GISEL-NEXT: s_endpgm
4074 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split0:
4075 ; GFX12-GISEL: ; %bb.0:
4076 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
4077 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
4078 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x1fff
4079 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 0x80000000
4080 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4081 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
4082 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
4083 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
4084 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
4085 ; GFX12-GISEL-NEXT: s_endpgm
4086 %gep = getelementptr i8, ptr %p, i64 -9223372036854767617
4087 %load = load volatile i8, ptr %gep, align 1
4088 store i8 %load, ptr undef
4092 ; Fill 13-bit low-bits, negative high bits (1ull << 63) | 8192
4093 define amdgpu_kernel void @flat_inst_salu_offset_64bit_13bit_neg_high_split1(ptr %p) {
4094 ; GFX9-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split1:
4095 ; GFX9-SDAG: ; %bb.0:
4096 ; GFX9-SDAG-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
4097 ; GFX9-SDAG-NEXT: v_bfrev_b32_e32 v1, 1
4098 ; GFX9-SDAG-NEXT: s_waitcnt lgkmcnt(0)
4099 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v0, s0
4100 ; GFX9-SDAG-NEXT: v_mov_b32_e32 v2, s1
4101 ; GFX9-SDAG-NEXT: v_add_co_u32_e32 v0, vcc, 0x2000, v0
4102 ; GFX9-SDAG-NEXT: v_addc_co_u32_e32 v1, vcc, v1, v2, vcc
4103 ; GFX9-SDAG-NEXT: flat_load_ubyte v0, v[0:1] glc
4104 ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4105 ; GFX9-SDAG-NEXT: flat_store_byte v[0:1], v0
4106 ; GFX9-SDAG-NEXT: s_endpgm
4108 ; GFX10-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split1:
4110 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
4111 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
4112 ; GFX10-NEXT: s_add_u32 s0, s0, 0x2000
4113 ; GFX10-NEXT: s_addc_u32 s1, s1, 0x80000000
4114 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
4115 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
4116 ; GFX10-NEXT: flat_load_ubyte v0, v[0:1] glc dlc
4117 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4118 ; GFX10-NEXT: flat_store_byte v[0:1], v0
4119 ; GFX10-NEXT: s_endpgm
4121 ; GFX11-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split1:
4122 ; GFX11-SDAG: ; %bb.0:
4123 ; GFX11-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
4124 ; GFX11-SDAG-NEXT: s_waitcnt lgkmcnt(0)
4125 ; GFX11-SDAG-NEXT: v_mov_b32_e32 v1, s1
4126 ; GFX11-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x2000, s0
4127 ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
4128 ; GFX11-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
4129 ; GFX11-SDAG-NEXT: flat_load_u8 v0, v[0:1] glc dlc
4130 ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4131 ; GFX11-SDAG-NEXT: flat_store_b8 v[0:1], v0
4132 ; GFX11-SDAG-NEXT: s_endpgm
4134 ; GFX12-SDAG-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split1:
4135 ; GFX12-SDAG: ; %bb.0:
4136 ; GFX12-SDAG-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
4137 ; GFX12-SDAG-NEXT: s_wait_kmcnt 0x0
4138 ; GFX12-SDAG-NEXT: v_mov_b32_e32 v1, s1
4139 ; GFX12-SDAG-NEXT: v_add_co_u32 v0, vcc_lo, 0x800000, s0
4140 ; GFX12-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_2)
4141 ; GFX12-SDAG-NEXT: v_add_co_ci_u32_e32 v1, vcc_lo, 0x80000000, v1, vcc_lo
4142 ; GFX12-SDAG-NEXT: flat_load_u8 v0, v[0:1] offset:-8380416 scope:SCOPE_SYS
4143 ; GFX12-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0
4144 ; GFX12-SDAG-NEXT: flat_store_b8 v[0:1], v0
4145 ; GFX12-SDAG-NEXT: s_endpgm
4147 ; GFX9-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split1:
4148 ; GFX9-GISEL: ; %bb.0:
4149 ; GFX9-GISEL-NEXT: s_load_dwordx2 s[0:1], s[2:3], 0x24
4150 ; GFX9-GISEL-NEXT: s_waitcnt lgkmcnt(0)
4151 ; GFX9-GISEL-NEXT: s_add_u32 s0, s0, 0x2000
4152 ; GFX9-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
4153 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s0
4154 ; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, s1
4155 ; GFX9-GISEL-NEXT: flat_load_ubyte v0, v[0:1] glc
4156 ; GFX9-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4157 ; GFX9-GISEL-NEXT: flat_store_byte v[0:1], v0
4158 ; GFX9-GISEL-NEXT: s_endpgm
4160 ; GFX11-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split1:
4161 ; GFX11-GISEL: ; %bb.0:
4162 ; GFX11-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
4163 ; GFX11-GISEL-NEXT: s_waitcnt lgkmcnt(0)
4164 ; GFX11-GISEL-NEXT: s_add_u32 s0, s0, 0x2000
4165 ; GFX11-GISEL-NEXT: s_addc_u32 s1, s1, 0x80000000
4166 ; GFX11-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4167 ; GFX11-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
4168 ; GFX11-GISEL-NEXT: flat_load_u8 v0, v[0:1] glc dlc
4169 ; GFX11-GISEL-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
4170 ; GFX11-GISEL-NEXT: flat_store_b8 v[0:1], v0
4171 ; GFX11-GISEL-NEXT: s_endpgm
4173 ; GFX12-GISEL-LABEL: flat_inst_salu_offset_64bit_13bit_neg_high_split1:
4174 ; GFX12-GISEL: ; %bb.0:
4175 ; GFX12-GISEL-NEXT: s_load_b64 s[0:1], s[2:3], 0x24
4176 ; GFX12-GISEL-NEXT: s_wait_kmcnt 0x0
4177 ; GFX12-GISEL-NEXT: s_add_co_u32 s0, s0, 0x2000
4178 ; GFX12-GISEL-NEXT: s_add_co_ci_u32 s1, s1, 0x80000000
4179 ; GFX12-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
4180 ; GFX12-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
4181 ; GFX12-GISEL-NEXT: flat_load_u8 v0, v[0:1] scope:SCOPE_SYS
4182 ; GFX12-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0
4183 ; GFX12-GISEL-NEXT: flat_store_b8 v[0:1], v0
4184 ; GFX12-GISEL-NEXT: s_endpgm
4185 %gep = getelementptr i8, ptr %p, i64 -9223372036854767616
4186 %load = load volatile i8, ptr %gep, align 1
4187 store i8 %load, ptr undef