1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -amdgpu-scalarize-global-loads=false -mtriple=amdgcn-- -mcpu=verde -verify-machineinstrs | FileCheck %s --check-prefixes=SI
3 ; RUN: llc < %s -mtriple=amdgcn-- -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs | FileCheck %s -check-prefixes=VI
4 ; RUN: llc < %s -amdgpu-scalarize-global-loads=false -march=r600 -mtriple=r600-- -mcpu=redwood -verify-machineinstrs | FileCheck %s --check-prefixes=EG
6 declare i32 @llvm.amdgcn.workitem.id.x() #0
8 declare i32 @llvm.amdgcn.workgroup.id.x() #0
10 define amdgpu_kernel void @shl_v2i32(ptr addrspace(1) %out, ptr addrspace(1) %in) {
11 ; SI-LABEL: shl_v2i32:
13 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
14 ; SI-NEXT: s_mov_b32 s7, 0xf000
15 ; SI-NEXT: s_mov_b32 s6, -1
16 ; SI-NEXT: s_mov_b32 s10, s6
17 ; SI-NEXT: s_mov_b32 s11, s7
18 ; SI-NEXT: s_waitcnt lgkmcnt(0)
19 ; SI-NEXT: s_mov_b32 s8, s2
20 ; SI-NEXT: s_mov_b32 s9, s3
21 ; SI-NEXT: buffer_load_dwordx4 v[0:3], off, s[8:11], 0
22 ; SI-NEXT: s_mov_b32 s4, s0
23 ; SI-NEXT: s_mov_b32 s5, s1
24 ; SI-NEXT: s_waitcnt vmcnt(0)
25 ; SI-NEXT: v_lshl_b32_e32 v1, v1, v3
26 ; SI-NEXT: v_lshl_b32_e32 v0, v0, v2
27 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
30 ; VI-LABEL: shl_v2i32:
32 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
33 ; VI-NEXT: s_waitcnt lgkmcnt(0)
34 ; VI-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x0
35 ; VI-NEXT: s_mov_b32 s3, 0xf000
36 ; VI-NEXT: s_mov_b32 s2, -1
37 ; VI-NEXT: s_waitcnt lgkmcnt(0)
38 ; VI-NEXT: s_lshl_b32 s5, s5, s7
39 ; VI-NEXT: s_lshl_b32 s4, s4, s6
40 ; VI-NEXT: v_mov_b32_e32 v0, s4
41 ; VI-NEXT: v_mov_b32_e32 v1, s5
42 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
45 ; EG-LABEL: shl_v2i32:
47 ; EG-NEXT: ALU 0, @8, KC0[CB0:0-32], KC1[]
49 ; EG-NEXT: ALU 3, @9, KC0[CB0:0-32], KC1[]
50 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
53 ; EG-NEXT: Fetch clause starting at 6:
54 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
55 ; EG-NEXT: ALU clause starting at 8:
56 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
57 ; EG-NEXT: ALU clause starting at 9:
58 ; EG-NEXT: LSHL * T0.Y, T0.Y, T0.W,
59 ; EG-NEXT: LSHL T0.X, T0.X, T0.Z,
60 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
61 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
62 %b_ptr = getelementptr <2 x i32>, ptr addrspace(1) %in, i32 1
63 %a = load <2 x i32>, ptr addrspace(1) %in
64 %b = load <2 x i32>, ptr addrspace(1) %b_ptr
65 %result = shl <2 x i32> %a, %b
66 store <2 x i32> %result, ptr addrspace(1) %out
70 define amdgpu_kernel void @shl_v4i32(ptr addrspace(1) %out, ptr addrspace(1) %in) {
71 ; SI-LABEL: shl_v4i32:
73 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
74 ; SI-NEXT: s_mov_b32 s7, 0xf000
75 ; SI-NEXT: s_mov_b32 s6, -1
76 ; SI-NEXT: s_mov_b32 s10, s6
77 ; SI-NEXT: s_mov_b32 s11, s7
78 ; SI-NEXT: s_waitcnt lgkmcnt(0)
79 ; SI-NEXT: s_mov_b32 s8, s2
80 ; SI-NEXT: s_mov_b32 s9, s3
81 ; SI-NEXT: buffer_load_dwordx4 v[0:3], off, s[8:11], 0
82 ; SI-NEXT: buffer_load_dwordx4 v[4:7], off, s[8:11], 0 offset:16
83 ; SI-NEXT: s_mov_b32 s4, s0
84 ; SI-NEXT: s_mov_b32 s5, s1
85 ; SI-NEXT: s_waitcnt vmcnt(0)
86 ; SI-NEXT: v_lshl_b32_e32 v3, v3, v7
87 ; SI-NEXT: v_lshl_b32_e32 v2, v2, v6
88 ; SI-NEXT: v_lshl_b32_e32 v1, v1, v5
89 ; SI-NEXT: v_lshl_b32_e32 v0, v0, v4
90 ; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
93 ; VI-LABEL: shl_v4i32:
95 ; VI-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x24
96 ; VI-NEXT: s_waitcnt lgkmcnt(0)
97 ; VI-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
98 ; VI-NEXT: s_mov_b32 s11, 0xf000
99 ; VI-NEXT: s_mov_b32 s10, -1
100 ; VI-NEXT: s_waitcnt lgkmcnt(0)
101 ; VI-NEXT: s_lshl_b32 s3, s3, s7
102 ; VI-NEXT: s_lshl_b32 s2, s2, s6
103 ; VI-NEXT: s_lshl_b32 s1, s1, s5
104 ; VI-NEXT: s_lshl_b32 s0, s0, s4
105 ; VI-NEXT: v_mov_b32_e32 v0, s0
106 ; VI-NEXT: v_mov_b32_e32 v1, s1
107 ; VI-NEXT: v_mov_b32_e32 v2, s2
108 ; VI-NEXT: v_mov_b32_e32 v3, s3
109 ; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
112 ; EG-LABEL: shl_v4i32:
114 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
116 ; EG-NEXT: ALU 5, @11, KC0[CB0:0-32], KC1[]
117 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
120 ; EG-NEXT: Fetch clause starting at 6:
121 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 16, #1
122 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
123 ; EG-NEXT: ALU clause starting at 10:
124 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
125 ; EG-NEXT: ALU clause starting at 11:
126 ; EG-NEXT: LSHL * T0.W, T0.W, T1.W,
127 ; EG-NEXT: LSHL * T0.Z, T0.Z, T1.Z,
128 ; EG-NEXT: LSHL * T0.Y, T0.Y, T1.Y,
129 ; EG-NEXT: LSHL T0.X, T0.X, T1.X,
130 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
131 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
132 %b_ptr = getelementptr <4 x i32>, ptr addrspace(1) %in, i32 1
133 %a = load <4 x i32>, ptr addrspace(1) %in
134 %b = load <4 x i32>, ptr addrspace(1) %b_ptr
135 %result = shl <4 x i32> %a, %b
136 store <4 x i32> %result, ptr addrspace(1) %out
140 define amdgpu_kernel void @shl_i16(ptr addrspace(1) %out, ptr addrspace(1) %in) {
143 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
144 ; SI-NEXT: s_mov_b32 s7, 0xf000
145 ; SI-NEXT: s_mov_b32 s6, -1
146 ; SI-NEXT: s_mov_b32 s10, s6
147 ; SI-NEXT: s_mov_b32 s11, s7
148 ; SI-NEXT: s_waitcnt lgkmcnt(0)
149 ; SI-NEXT: s_mov_b32 s8, s2
150 ; SI-NEXT: s_mov_b32 s9, s3
151 ; SI-NEXT: buffer_load_ushort v0, off, s[8:11], 0
152 ; SI-NEXT: buffer_load_ushort v1, off, s[8:11], 0 offset:2
153 ; SI-NEXT: s_mov_b32 s4, s0
154 ; SI-NEXT: s_mov_b32 s5, s1
155 ; SI-NEXT: s_waitcnt vmcnt(0)
156 ; SI-NEXT: v_lshl_b32_e32 v0, v0, v1
157 ; SI-NEXT: buffer_store_short v0, off, s[4:7], 0
162 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
163 ; VI-NEXT: s_mov_b32 s7, 0xf000
164 ; VI-NEXT: s_mov_b32 s6, -1
165 ; VI-NEXT: s_mov_b32 s10, s6
166 ; VI-NEXT: s_mov_b32 s11, s7
167 ; VI-NEXT: s_waitcnt lgkmcnt(0)
168 ; VI-NEXT: s_mov_b32 s8, s2
169 ; VI-NEXT: s_mov_b32 s9, s3
170 ; VI-NEXT: buffer_load_ushort v0, off, s[8:11], 0
171 ; VI-NEXT: buffer_load_ushort v1, off, s[8:11], 0 offset:2
172 ; VI-NEXT: s_mov_b32 s4, s0
173 ; VI-NEXT: s_mov_b32 s5, s1
174 ; VI-NEXT: s_waitcnt vmcnt(0)
175 ; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
176 ; VI-NEXT: buffer_store_short v0, off, s[4:7], 0
181 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
183 ; EG-NEXT: ALU 12, @11, KC0[CB0:0-32], KC1[]
184 ; EG-NEXT: MEM_RAT MSKOR T0.XW, T1.X
187 ; EG-NEXT: Fetch clause starting at 6:
188 ; EG-NEXT: VTX_READ_16 T1.X, T0.X, 2, #1
189 ; EG-NEXT: VTX_READ_16 T0.X, T0.X, 0, #1
190 ; EG-NEXT: ALU clause starting at 10:
191 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
192 ; EG-NEXT: ALU clause starting at 11:
193 ; EG-NEXT: AND_INT T0.W, KC0[2].Y, literal.x,
194 ; EG-NEXT: LSHL * T1.W, T0.X, T1.X,
195 ; EG-NEXT: 3(4.203895e-45), 0(0.000000e+00)
196 ; EG-NEXT: AND_INT T1.W, PS, literal.x,
197 ; EG-NEXT: LSHL * T0.W, PV.W, literal.y,
198 ; EG-NEXT: 65535(9.183409e-41), 3(4.203895e-45)
199 ; EG-NEXT: LSHL T0.X, PV.W, PS,
200 ; EG-NEXT: LSHL * T0.W, literal.x, PS,
201 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
202 ; EG-NEXT: MOV T0.Y, 0.0,
203 ; EG-NEXT: MOV * T0.Z, 0.0,
204 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
205 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
206 %b_ptr = getelementptr i16, ptr addrspace(1) %in, i16 1
207 %a = load i16, ptr addrspace(1) %in
208 %b = load i16, ptr addrspace(1) %b_ptr
209 %result = shl i16 %a, %b
210 store i16 %result, ptr addrspace(1) %out
214 define amdgpu_kernel void @shl_i16_v_s(ptr addrspace(1) %out, ptr addrspace(1) %in, i16 %b) {
215 ; SI-LABEL: shl_i16_v_s:
217 ; SI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
218 ; SI-NEXT: s_load_dword s12, s[0:1], 0xd
219 ; SI-NEXT: s_mov_b32 s3, 0xf000
220 ; SI-NEXT: s_mov_b32 s2, -1
221 ; SI-NEXT: s_mov_b32 s10, s2
222 ; SI-NEXT: s_waitcnt lgkmcnt(0)
223 ; SI-NEXT: s_mov_b32 s8, s6
224 ; SI-NEXT: s_mov_b32 s9, s7
225 ; SI-NEXT: s_mov_b32 s11, s3
226 ; SI-NEXT: buffer_load_ushort v0, off, s[8:11], 0
227 ; SI-NEXT: s_mov_b32 s0, s4
228 ; SI-NEXT: s_mov_b32 s1, s5
229 ; SI-NEXT: s_waitcnt vmcnt(0)
230 ; SI-NEXT: v_lshlrev_b32_e32 v0, s12, v0
231 ; SI-NEXT: buffer_store_short v0, off, s[0:3], 0
234 ; VI-LABEL: shl_i16_v_s:
236 ; VI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
237 ; VI-NEXT: s_load_dword s12, s[0:1], 0x34
238 ; VI-NEXT: s_mov_b32 s3, 0xf000
239 ; VI-NEXT: s_mov_b32 s2, -1
240 ; VI-NEXT: s_mov_b32 s10, s2
241 ; VI-NEXT: s_waitcnt lgkmcnt(0)
242 ; VI-NEXT: s_mov_b32 s8, s6
243 ; VI-NEXT: s_mov_b32 s9, s7
244 ; VI-NEXT: s_mov_b32 s11, s3
245 ; VI-NEXT: buffer_load_ushort v0, off, s[8:11], 0
246 ; VI-NEXT: s_mov_b32 s0, s4
247 ; VI-NEXT: s_mov_b32 s1, s5
248 ; VI-NEXT: s_waitcnt vmcnt(0)
249 ; VI-NEXT: v_lshlrev_b32_e32 v0, s12, v0
250 ; VI-NEXT: buffer_store_short v0, off, s[0:3], 0
253 ; EG-LABEL: shl_i16_v_s:
255 ; EG-NEXT: ALU 1, @10, KC0[CB0:0-32], KC1[]
257 ; EG-NEXT: ALU 12, @12, KC0[CB0:0-32], KC1[]
258 ; EG-NEXT: MEM_RAT MSKOR T0.XW, T1.X
261 ; EG-NEXT: Fetch clause starting at 6:
262 ; EG-NEXT: VTX_READ_16 T1.X, T1.X, 0, #1
263 ; EG-NEXT: VTX_READ_16 T0.X, T0.X, 44, #3
264 ; EG-NEXT: ALU clause starting at 10:
265 ; EG-NEXT: MOV T0.X, 0.0,
266 ; EG-NEXT: MOV * T1.X, KC0[2].Z,
267 ; EG-NEXT: ALU clause starting at 12:
268 ; EG-NEXT: AND_INT T0.W, KC0[2].Y, literal.x,
269 ; EG-NEXT: LSHL * T1.W, T1.X, T0.X,
270 ; EG-NEXT: 3(4.203895e-45), 0(0.000000e+00)
271 ; EG-NEXT: AND_INT T1.W, PS, literal.x,
272 ; EG-NEXT: LSHL * T0.W, PV.W, literal.y,
273 ; EG-NEXT: 65535(9.183409e-41), 3(4.203895e-45)
274 ; EG-NEXT: LSHL T0.X, PV.W, PS,
275 ; EG-NEXT: LSHL * T0.W, literal.x, PS,
276 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
277 ; EG-NEXT: MOV T0.Y, 0.0,
278 ; EG-NEXT: MOV * T0.Z, 0.0,
279 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
280 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
281 %a = load i16, ptr addrspace(1) %in
282 %result = shl i16 %a, %b
283 store i16 %result, ptr addrspace(1) %out
287 define amdgpu_kernel void @shl_i16_v_compute_s(ptr addrspace(1) %out, ptr addrspace(1) %in, i16 %b) {
288 ; SI-LABEL: shl_i16_v_compute_s:
290 ; SI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
291 ; SI-NEXT: s_load_dword s12, s[0:1], 0xd
292 ; SI-NEXT: s_mov_b32 s3, 0xf000
293 ; SI-NEXT: s_mov_b32 s2, -1
294 ; SI-NEXT: s_mov_b32 s10, s2
295 ; SI-NEXT: s_waitcnt lgkmcnt(0)
296 ; SI-NEXT: s_mov_b32 s8, s6
297 ; SI-NEXT: s_mov_b32 s9, s7
298 ; SI-NEXT: s_mov_b32 s11, s3
299 ; SI-NEXT: buffer_load_ushort v0, off, s[8:11], 0
300 ; SI-NEXT: s_add_i32 s12, s12, 3
301 ; SI-NEXT: s_mov_b32 s0, s4
302 ; SI-NEXT: s_mov_b32 s1, s5
303 ; SI-NEXT: s_waitcnt vmcnt(0)
304 ; SI-NEXT: v_lshlrev_b32_e32 v0, s12, v0
305 ; SI-NEXT: buffer_store_short v0, off, s[0:3], 0
308 ; VI-LABEL: shl_i16_v_compute_s:
310 ; VI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
311 ; VI-NEXT: s_load_dword s12, s[0:1], 0x34
312 ; VI-NEXT: s_mov_b32 s3, 0xf000
313 ; VI-NEXT: s_mov_b32 s2, -1
314 ; VI-NEXT: s_mov_b32 s10, s2
315 ; VI-NEXT: s_waitcnt lgkmcnt(0)
316 ; VI-NEXT: s_mov_b32 s8, s6
317 ; VI-NEXT: s_mov_b32 s9, s7
318 ; VI-NEXT: s_mov_b32 s11, s3
319 ; VI-NEXT: buffer_load_ushort v0, off, s[8:11], 0
320 ; VI-NEXT: s_add_i32 s12, s12, 3
321 ; VI-NEXT: s_mov_b32 s0, s4
322 ; VI-NEXT: s_mov_b32 s1, s5
323 ; VI-NEXT: s_waitcnt vmcnt(0)
324 ; VI-NEXT: v_lshlrev_b32_e32 v0, s12, v0
325 ; VI-NEXT: buffer_store_short v0, off, s[0:3], 0
328 ; EG-LABEL: shl_i16_v_compute_s:
330 ; EG-NEXT: ALU 0, @12, KC0[], KC1[]
332 ; EG-NEXT: ALU 0, @13, KC0[CB0:0-32], KC1[]
334 ; EG-NEXT: ALU 15, @14, KC0[CB0:0-32], KC1[]
335 ; EG-NEXT: MEM_RAT MSKOR T0.XW, T1.X
338 ; EG-NEXT: Fetch clause starting at 8:
339 ; EG-NEXT: VTX_READ_16 T0.X, T0.X, 44, #3
340 ; EG-NEXT: Fetch clause starting at 10:
341 ; EG-NEXT: VTX_READ_16 T1.X, T1.X, 0, #1
342 ; EG-NEXT: ALU clause starting at 12:
343 ; EG-NEXT: MOV * T0.X, 0.0,
344 ; EG-NEXT: ALU clause starting at 13:
345 ; EG-NEXT: MOV * T1.X, KC0[2].Z,
346 ; EG-NEXT: ALU clause starting at 14:
347 ; EG-NEXT: ADD_INT * T0.W, T0.X, literal.x,
348 ; EG-NEXT: 3(4.203895e-45), 0(0.000000e+00)
349 ; EG-NEXT: AND_INT T0.W, PV.W, literal.x,
350 ; EG-NEXT: AND_INT * T1.W, KC0[2].Y, literal.y,
351 ; EG-NEXT: 65535(9.183409e-41), 3(4.203895e-45)
352 ; EG-NEXT: LSHL * T0.W, T1.X, PV.W,
353 ; EG-NEXT: AND_INT T0.W, PV.W, literal.x,
354 ; EG-NEXT: LSHL * T1.W, T1.W, literal.y,
355 ; EG-NEXT: 65535(9.183409e-41), 3(4.203895e-45)
356 ; EG-NEXT: LSHL T0.X, PV.W, PS,
357 ; EG-NEXT: LSHL * T0.W, literal.x, PS,
358 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
359 ; EG-NEXT: MOV T0.Y, 0.0,
360 ; EG-NEXT: MOV * T0.Z, 0.0,
361 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
362 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
363 %a = load i16, ptr addrspace(1) %in
364 %b.add = add i16 %b, 3
365 %result = shl i16 %a, %b.add
366 store i16 %result, ptr addrspace(1) %out
370 define amdgpu_kernel void @shl_i16_computed_amount(ptr addrspace(1) %out, ptr addrspace(1) %in) {
371 ; SI-LABEL: shl_i16_computed_amount:
373 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
374 ; SI-NEXT: s_mov_b32 s7, 0xf000
375 ; SI-NEXT: s_mov_b32 s6, -1
376 ; SI-NEXT: s_mov_b32 s10, s6
377 ; SI-NEXT: s_mov_b32 s11, s7
378 ; SI-NEXT: s_waitcnt lgkmcnt(0)
379 ; SI-NEXT: s_mov_b32 s8, s2
380 ; SI-NEXT: s_mov_b32 s9, s3
381 ; SI-NEXT: v_lshlrev_b32_e32 v0, 1, v0
382 ; SI-NEXT: v_mov_b32_e32 v1, 0
383 ; SI-NEXT: s_mov_b32 s14, 0
384 ; SI-NEXT: s_mov_b32 s15, s7
385 ; SI-NEXT: s_mov_b64 s[12:13], s[2:3]
386 ; SI-NEXT: buffer_load_ushort v2, off, s[8:11], 0 glc
387 ; SI-NEXT: s_waitcnt vmcnt(0)
388 ; SI-NEXT: buffer_load_ushort v0, v[0:1], s[12:15], 0 addr64 offset:2 glc
389 ; SI-NEXT: s_waitcnt vmcnt(0)
390 ; SI-NEXT: s_mov_b32 s4, s0
391 ; SI-NEXT: s_mov_b32 s5, s1
392 ; SI-NEXT: v_add_i32_e32 v0, vcc, 3, v0
393 ; SI-NEXT: v_lshlrev_b32_e32 v0, v0, v2
394 ; SI-NEXT: buffer_store_short v0, off, s[4:7], 0
397 ; VI-LABEL: shl_i16_computed_amount:
399 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
400 ; VI-NEXT: v_lshlrev_b32_e32 v0, 1, v0
401 ; VI-NEXT: s_mov_b32 s7, 0xf000
402 ; VI-NEXT: s_mov_b32 s6, -1
403 ; VI-NEXT: s_mov_b32 s10, s6
404 ; VI-NEXT: s_waitcnt lgkmcnt(0)
405 ; VI-NEXT: v_mov_b32_e32 v1, s3
406 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
407 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
408 ; VI-NEXT: v_add_u32_e32 v0, vcc, 2, v0
409 ; VI-NEXT: s_mov_b32 s8, s2
410 ; VI-NEXT: s_mov_b32 s9, s3
411 ; VI-NEXT: s_mov_b32 s11, s7
412 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
413 ; VI-NEXT: buffer_load_ushort v2, off, s[8:11], 0 glc
414 ; VI-NEXT: s_waitcnt vmcnt(0)
415 ; VI-NEXT: flat_load_ushort v0, v[0:1] glc
416 ; VI-NEXT: s_waitcnt vmcnt(0)
417 ; VI-NEXT: s_mov_b32 s4, s0
418 ; VI-NEXT: s_mov_b32 s5, s1
419 ; VI-NEXT: v_add_u16_e32 v0, 3, v0
420 ; VI-NEXT: v_lshlrev_b16_e32 v0, v0, v2
421 ; VI-NEXT: buffer_store_short v0, off, s[4:7], 0
424 ; EG-LABEL: shl_i16_computed_amount:
426 ; EG-NEXT: ALU 0, @12, KC0[CB0:0-32], KC1[]
428 ; EG-NEXT: ALU 1, @13, KC0[CB0:0-32], KC1[]
430 ; EG-NEXT: ALU 15, @15, KC0[CB0:0-32], KC1[]
431 ; EG-NEXT: MEM_RAT MSKOR T0.XW, T1.X
434 ; EG-NEXT: Fetch clause starting at 8:
435 ; EG-NEXT: VTX_READ_16 T1.X, T1.X, 0, #1
436 ; EG-NEXT: Fetch clause starting at 10:
437 ; EG-NEXT: VTX_READ_16 T0.X, T0.X, 2, #1
438 ; EG-NEXT: ALU clause starting at 12:
439 ; EG-NEXT: MOV * T1.X, KC0[2].Z,
440 ; EG-NEXT: ALU clause starting at 13:
441 ; EG-NEXT: LSHL * T0.W, T0.X, 1,
442 ; EG-NEXT: ADD_INT * T0.X, KC0[2].Z, PV.W,
443 ; EG-NEXT: ALU clause starting at 15:
444 ; EG-NEXT: ADD_INT * T0.W, T0.X, literal.x,
445 ; EG-NEXT: 3(4.203895e-45), 0(0.000000e+00)
446 ; EG-NEXT: AND_INT T0.W, PV.W, literal.x,
447 ; EG-NEXT: AND_INT * T1.W, KC0[2].Y, literal.y,
448 ; EG-NEXT: 65535(9.183409e-41), 3(4.203895e-45)
449 ; EG-NEXT: LSHL * T0.W, T1.X, PV.W,
450 ; EG-NEXT: AND_INT T0.W, PV.W, literal.x,
451 ; EG-NEXT: LSHL * T1.W, T1.W, literal.y,
452 ; EG-NEXT: 65535(9.183409e-41), 3(4.203895e-45)
453 ; EG-NEXT: LSHL T0.X, PV.W, PS,
454 ; EG-NEXT: LSHL * T0.W, literal.x, PS,
455 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
456 ; EG-NEXT: MOV T0.Y, 0.0,
457 ; EG-NEXT: MOV * T0.Z, 0.0,
458 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
459 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
460 %tid = call i32 @llvm.amdgcn.workitem.id.x() #0
461 %gep = getelementptr inbounds i16, ptr addrspace(1) %in, i32 %tid
462 %gep.out = getelementptr inbounds i16, ptr addrspace(1) %out, i32 %tid
463 %b_ptr = getelementptr i16, ptr addrspace(1) %gep, i16 1
464 %a = load volatile i16, ptr addrspace(1) %in
465 %b = load volatile i16, ptr addrspace(1) %b_ptr
466 %b.add = add i16 %b, 3
467 %result = shl i16 %a, %b.add
468 store i16 %result, ptr addrspace(1) %out
472 define amdgpu_kernel void @shl_i16_i_s(ptr addrspace(1) %out, i16 zeroext %a) {
473 ; SI-LABEL: shl_i16_i_s:
475 ; SI-NEXT: s_load_dword s4, s[0:1], 0xb
476 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
477 ; SI-NEXT: s_mov_b32 s3, 0xf000
478 ; SI-NEXT: s_mov_b32 s2, -1
479 ; SI-NEXT: s_waitcnt lgkmcnt(0)
480 ; SI-NEXT: s_lshl_b32 s4, s4, 12
481 ; SI-NEXT: v_mov_b32_e32 v0, s4
482 ; SI-NEXT: buffer_store_short v0, off, s[0:3], 0
485 ; VI-LABEL: shl_i16_i_s:
487 ; VI-NEXT: s_load_dword s4, s[0:1], 0x2c
488 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
489 ; VI-NEXT: s_mov_b32 s3, 0xf000
490 ; VI-NEXT: s_mov_b32 s2, -1
491 ; VI-NEXT: s_waitcnt lgkmcnt(0)
492 ; VI-NEXT: s_lshl_b32 s4, s4, 12
493 ; VI-NEXT: v_mov_b32_e32 v0, s4
494 ; VI-NEXT: buffer_store_short v0, off, s[0:3], 0
497 ; EG-LABEL: shl_i16_i_s:
499 ; EG-NEXT: ALU 0, @8, KC0[], KC1[]
501 ; EG-NEXT: ALU 14, @9, KC0[CB0:0-32], KC1[]
502 ; EG-NEXT: MEM_RAT MSKOR T0.XW, T1.X
505 ; EG-NEXT: Fetch clause starting at 6:
506 ; EG-NEXT: VTX_READ_16 T0.X, T0.X, 40, #3
507 ; EG-NEXT: ALU clause starting at 8:
508 ; EG-NEXT: MOV * T0.X, 0.0,
509 ; EG-NEXT: ALU clause starting at 9:
510 ; EG-NEXT: BFE_INT T0.W, T0.X, 0.0, literal.x,
511 ; EG-NEXT: AND_INT * T1.W, KC0[2].Y, literal.y,
512 ; EG-NEXT: 16(2.242078e-44), 3(4.203895e-45)
513 ; EG-NEXT: LSHL * T0.W, PV.W, literal.x,
514 ; EG-NEXT: 12(1.681558e-44), 0(0.000000e+00)
515 ; EG-NEXT: AND_INT T0.W, PV.W, literal.x,
516 ; EG-NEXT: LSHL * T1.W, T1.W, literal.y,
517 ; EG-NEXT: 61440(8.609578e-41), 3(4.203895e-45)
518 ; EG-NEXT: LSHL T0.X, PV.W, PS,
519 ; EG-NEXT: LSHL * T0.W, literal.x, PS,
520 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
521 ; EG-NEXT: MOV T0.Y, 0.0,
522 ; EG-NEXT: MOV * T0.Z, 0.0,
523 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
524 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
525 %result = shl i16 %a, 12
526 store i16 %result, ptr addrspace(1) %out
530 define amdgpu_kernel void @shl_v2i16(ptr addrspace(1) %out, ptr addrspace(1) %in) {
531 ; SI-LABEL: shl_v2i16:
533 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
534 ; SI-NEXT: s_mov_b32 s7, 0xf000
535 ; SI-NEXT: s_mov_b32 s6, -1
536 ; SI-NEXT: s_mov_b32 s10, s6
537 ; SI-NEXT: s_mov_b32 s11, s7
538 ; SI-NEXT: s_waitcnt lgkmcnt(0)
539 ; SI-NEXT: s_mov_b32 s8, s2
540 ; SI-NEXT: s_mov_b32 s9, s3
541 ; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
542 ; SI-NEXT: v_mov_b32_e32 v1, 0
543 ; SI-NEXT: s_mov_b32 s14, 0
544 ; SI-NEXT: s_mov_b32 s15, s7
545 ; SI-NEXT: s_mov_b64 s[12:13], s[2:3]
546 ; SI-NEXT: buffer_load_dword v2, off, s[8:11], 0
547 ; SI-NEXT: buffer_load_dword v0, v[0:1], s[12:15], 0 addr64 offset:4
548 ; SI-NEXT: s_mov_b32 s4, s0
549 ; SI-NEXT: s_mov_b32 s5, s1
550 ; SI-NEXT: s_waitcnt vmcnt(1)
551 ; SI-NEXT: v_lshrrev_b32_e32 v1, 16, v2
552 ; SI-NEXT: s_waitcnt vmcnt(0)
553 ; SI-NEXT: v_lshrrev_b32_e32 v3, 16, v0
554 ; SI-NEXT: v_lshlrev_b32_e32 v0, v0, v2
555 ; SI-NEXT: v_lshlrev_b32_e32 v1, v3, v1
556 ; SI-NEXT: v_and_b32_e32 v0, 0xffff, v0
557 ; SI-NEXT: v_lshlrev_b32_e32 v1, 16, v1
558 ; SI-NEXT: v_or_b32_e32 v0, v0, v1
559 ; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
562 ; VI-LABEL: shl_v2i16:
564 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
565 ; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
566 ; VI-NEXT: s_waitcnt lgkmcnt(0)
567 ; VI-NEXT: v_mov_b32_e32 v1, s3
568 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v0
569 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
570 ; VI-NEXT: v_add_u32_e32 v0, vcc, 4, v0
571 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
572 ; VI-NEXT: flat_load_dword v0, v[0:1]
573 ; VI-NEXT: s_load_dword s4, s[2:3], 0x0
574 ; VI-NEXT: s_mov_b32 s3, 0xf000
575 ; VI-NEXT: s_mov_b32 s2, -1
576 ; VI-NEXT: s_waitcnt lgkmcnt(0)
577 ; VI-NEXT: s_lshr_b32 s5, s4, 16
578 ; VI-NEXT: v_mov_b32_e32 v1, s5
579 ; VI-NEXT: s_waitcnt vmcnt(0)
580 ; VI-NEXT: v_lshlrev_b16_e64 v2, v0, s4
581 ; VI-NEXT: v_lshlrev_b16_sdwa v0, v0, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
582 ; VI-NEXT: v_or_b32_e32 v0, v2, v0
583 ; VI-NEXT: buffer_store_dword v0, off, s[0:3], 0
586 ; EG-LABEL: shl_v2i16:
588 ; EG-NEXT: ALU 2, @12, KC0[CB0:0-32], KC1[]
590 ; EG-NEXT: ALU 0, @15, KC0[CB0:0-32], KC1[]
592 ; EG-NEXT: ALU 11, @16, KC0[CB0:0-32], KC1[]
593 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T7.X, 1
596 ; EG-NEXT: Fetch clause starting at 8:
597 ; EG-NEXT: VTX_READ_32 T0.X, T0.X, 4, #1
598 ; EG-NEXT: Fetch clause starting at 10:
599 ; EG-NEXT: VTX_READ_32 T7.X, T7.X, 0, #1
600 ; EG-NEXT: ALU clause starting at 12:
601 ; EG-NEXT: LSHL * T0.W, T0.X, literal.x,
602 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
603 ; EG-NEXT: ADD_INT * T0.X, KC0[2].Z, PV.W,
604 ; EG-NEXT: ALU clause starting at 15:
605 ; EG-NEXT: MOV * T7.X, KC0[2].Z,
606 ; EG-NEXT: ALU clause starting at 16:
607 ; EG-NEXT: AND_INT T0.Z, T0.X, literal.x,
608 ; EG-NEXT: LSHR T0.W, T0.X, literal.y,
609 ; EG-NEXT: LSHR * T1.W, T7.X, literal.y,
610 ; EG-NEXT: 65535(9.183409e-41), 16(2.242078e-44)
611 ; EG-NEXT: LSHL T0.W, PS, PV.W,
612 ; EG-NEXT: LSHL * T1.W, T7.X, PV.Z,
613 ; EG-NEXT: AND_INT T1.W, PS, literal.x,
614 ; EG-NEXT: LSHL * T0.W, PV.W, literal.y,
615 ; EG-NEXT: 65535(9.183409e-41), 16(2.242078e-44)
616 ; EG-NEXT: OR_INT T0.X, PV.W, PS,
617 ; EG-NEXT: LSHR * T7.X, KC0[2].Y, literal.x,
618 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
619 %tid = call i32 @llvm.amdgcn.workitem.id.x() #0
620 %gep = getelementptr inbounds <2 x i16>, ptr addrspace(1) %in, i32 %tid
621 %gep.out = getelementptr inbounds <2 x i16>, ptr addrspace(1) %out, i32 %tid
622 %b_ptr = getelementptr <2 x i16>, ptr addrspace(1) %gep, i16 1
623 %a = load <2 x i16>, ptr addrspace(1) %in
624 %b = load <2 x i16>, ptr addrspace(1) %b_ptr
625 %result = shl <2 x i16> %a, %b
626 store <2 x i16> %result, ptr addrspace(1) %out
630 define amdgpu_kernel void @shl_v4i16(ptr addrspace(1) %out, ptr addrspace(1) %in) {
631 ; SI-LABEL: shl_v4i16:
633 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
634 ; SI-NEXT: s_mov_b32 s7, 0xf000
635 ; SI-NEXT: s_mov_b32 s6, 0
636 ; SI-NEXT: v_lshlrev_b32_e32 v4, 3, v0
637 ; SI-NEXT: v_mov_b32_e32 v5, 0
638 ; SI-NEXT: s_waitcnt lgkmcnt(0)
639 ; SI-NEXT: s_mov_b64 s[4:5], s[2:3]
640 ; SI-NEXT: buffer_load_dwordx4 v[0:3], v[4:5], s[4:7], 0 addr64
641 ; SI-NEXT: s_mov_b64 s[2:3], s[6:7]
642 ; SI-NEXT: s_waitcnt vmcnt(0)
643 ; SI-NEXT: v_lshrrev_b32_e32 v6, 16, v0
644 ; SI-NEXT: v_lshrrev_b32_e32 v7, 16, v1
645 ; SI-NEXT: v_lshrrev_b32_e32 v8, 16, v2
646 ; SI-NEXT: v_lshrrev_b32_e32 v9, 16, v3
647 ; SI-NEXT: v_lshlrev_b32_e32 v1, v3, v1
648 ; SI-NEXT: v_lshlrev_b32_e32 v0, v2, v0
649 ; SI-NEXT: v_lshlrev_b32_e32 v2, v9, v7
650 ; SI-NEXT: v_lshlrev_b32_e32 v3, v8, v6
651 ; SI-NEXT: v_and_b32_e32 v1, 0xffff, v1
652 ; SI-NEXT: v_and_b32_e32 v0, 0xffff, v0
653 ; SI-NEXT: v_lshlrev_b32_e32 v2, 16, v2
654 ; SI-NEXT: v_lshlrev_b32_e32 v3, 16, v3
655 ; SI-NEXT: v_or_b32_e32 v1, v1, v2
656 ; SI-NEXT: v_or_b32_e32 v0, v0, v3
657 ; SI-NEXT: buffer_store_dwordx2 v[0:1], v[4:5], s[0:3], 0 addr64
660 ; VI-LABEL: shl_v4i16:
662 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
663 ; VI-NEXT: v_lshlrev_b32_e32 v4, 3, v0
664 ; VI-NEXT: s_waitcnt lgkmcnt(0)
665 ; VI-NEXT: v_mov_b32_e32 v1, s3
666 ; VI-NEXT: v_add_u32_e32 v0, vcc, s2, v4
667 ; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
668 ; VI-NEXT: flat_load_dwordx4 v[0:3], v[0:1]
669 ; VI-NEXT: v_mov_b32_e32 v5, s1
670 ; VI-NEXT: v_add_u32_e32 v4, vcc, s0, v4
671 ; VI-NEXT: v_addc_u32_e32 v5, vcc, 0, v5, vcc
672 ; VI-NEXT: s_waitcnt vmcnt(0)
673 ; VI-NEXT: v_lshlrev_b16_e32 v6, v3, v1
674 ; VI-NEXT: v_lshlrev_b16_sdwa v1, v3, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_1
675 ; VI-NEXT: v_lshlrev_b16_e32 v3, v2, v0
676 ; VI-NEXT: v_lshlrev_b16_sdwa v0, v2, v0 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:WORD_1
677 ; VI-NEXT: v_or_b32_e32 v1, v6, v1
678 ; VI-NEXT: v_or_b32_e32 v0, v3, v0
679 ; VI-NEXT: flat_store_dwordx2 v[4:5], v[0:1]
682 ; EG-LABEL: shl_v4i16:
684 ; EG-NEXT: ALU 3, @8, KC0[CB0:0-32], KC1[]
686 ; EG-NEXT: ALU 42, @12, KC0[CB0:0-32], KC1[]
687 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T10.XY, T0.X, 1
690 ; EG-NEXT: Fetch clause starting at 6:
691 ; EG-NEXT: VTX_READ_128 T10.XYZW, T0.X, 0, #1
692 ; EG-NEXT: ALU clause starting at 8:
693 ; EG-NEXT: MOV T0.Y, T6.X,
694 ; EG-NEXT: LSHL * T0.W, T0.X, literal.x, BS:VEC_120/SCL_212
695 ; EG-NEXT: 3(4.203895e-45), 0(0.000000e+00)
696 ; EG-NEXT: ADD_INT * T0.X, KC0[2].Z, PV.W,
697 ; EG-NEXT: ALU clause starting at 12:
698 ; EG-NEXT: AND_INT * T1.W, T10.Z, literal.x,
699 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
700 ; EG-NEXT: LSHL * T1.W, T10.X, PV.W,
701 ; EG-NEXT: AND_INT T1.W, PV.W, literal.x,
702 ; EG-NEXT: AND_INT * T2.W, T0.Y, literal.y,
703 ; EG-NEXT: 65535(9.183409e-41), -65536(nan)
704 ; EG-NEXT: OR_INT * T1.W, PS, PV.W,
705 ; EG-NEXT: MOV * T6.X, PV.W,
706 ; EG-NEXT: MOV T0.X, PV.X,
707 ; EG-NEXT: LSHR T1.W, T10.Z, literal.x,
708 ; EG-NEXT: LSHR * T2.W, T10.X, literal.x,
709 ; EG-NEXT: 16(2.242078e-44), 0(0.000000e+00)
710 ; EG-NEXT: LSHL T1.W, PS, PV.W,
711 ; EG-NEXT: AND_INT * T2.W, PV.X, literal.x,
712 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
713 ; EG-NEXT: LSHL * T1.W, PV.W, literal.x,
714 ; EG-NEXT: 16(2.242078e-44), 0(0.000000e+00)
715 ; EG-NEXT: OR_INT * T1.W, T2.W, PV.W,
716 ; EG-NEXT: MOV T6.X, PV.W,
717 ; EG-NEXT: MOV * T0.X, T7.X,
718 ; EG-NEXT: AND_INT * T1.W, T10.W, literal.x,
719 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
720 ; EG-NEXT: LSHL T1.W, T10.Y, PV.W,
721 ; EG-NEXT: AND_INT * T2.W, T0.X, literal.x,
722 ; EG-NEXT: -65536(nan), 0(0.000000e+00)
723 ; EG-NEXT: AND_INT * T1.W, PV.W, literal.x,
724 ; EG-NEXT: 65535(9.183409e-41), 0(0.000000e+00)
725 ; EG-NEXT: OR_INT * T1.W, T2.W, PV.W,
726 ; EG-NEXT: MOV * T7.X, PV.W,
727 ; EG-NEXT: MOV T0.X, PV.X,
728 ; EG-NEXT: LSHR T1.W, T10.W, literal.x,
729 ; EG-NEXT: LSHR * T2.W, T10.Y, literal.x,
730 ; EG-NEXT: 16(2.242078e-44), 0(0.000000e+00)
731 ; EG-NEXT: LSHL * T1.W, PS, PV.W,
732 ; EG-NEXT: AND_INT T0.Z, T0.X, literal.x,
733 ; EG-NEXT: LSHL T1.W, PV.W, literal.y,
734 ; EG-NEXT: ADD_INT * T0.W, KC0[2].Y, T0.W,
735 ; EG-NEXT: 65535(9.183409e-41), 16(2.242078e-44)
736 ; EG-NEXT: LSHR T0.X, PS, literal.x,
737 ; EG-NEXT: OR_INT * T10.Y, PV.Z, PV.W,
738 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
739 ; EG-NEXT: MOV T7.X, PV.Y,
740 ; EG-NEXT: MOV * T10.X, T6.X,
741 %tid = call i32 @llvm.amdgcn.workitem.id.x() #0
742 %gep = getelementptr inbounds <4 x i16>, ptr addrspace(1) %in, i32 %tid
743 %gep.out = getelementptr inbounds <4 x i16>, ptr addrspace(1) %out, i32 %tid
744 %b_ptr = getelementptr <4 x i16>, ptr addrspace(1) %gep, i16 1
745 %a = load <4 x i16>, ptr addrspace(1) %gep
746 %b = load <4 x i16>, ptr addrspace(1) %b_ptr
747 %result = shl <4 x i16> %a, %b
748 store <4 x i16> %result, ptr addrspace(1) %gep.out
752 define amdgpu_kernel void @shl_i64(ptr addrspace(1) %out, ptr addrspace(1) %in) {
755 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
756 ; SI-NEXT: s_mov_b32 s7, 0xf000
757 ; SI-NEXT: s_mov_b32 s6, -1
758 ; SI-NEXT: s_mov_b32 s10, s6
759 ; SI-NEXT: s_mov_b32 s11, s7
760 ; SI-NEXT: s_waitcnt lgkmcnt(0)
761 ; SI-NEXT: s_mov_b32 s8, s2
762 ; SI-NEXT: s_mov_b32 s9, s3
763 ; SI-NEXT: buffer_load_dwordx4 v[0:3], off, s[8:11], 0
764 ; SI-NEXT: s_mov_b32 s4, s0
765 ; SI-NEXT: s_mov_b32 s5, s1
766 ; SI-NEXT: s_waitcnt vmcnt(0)
767 ; SI-NEXT: v_lshl_b64 v[0:1], v[0:1], v2
768 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
773 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
774 ; VI-NEXT: s_waitcnt lgkmcnt(0)
775 ; VI-NEXT: s_load_dwordx4 s[4:7], s[2:3], 0x0
776 ; VI-NEXT: s_mov_b32 s3, 0xf000
777 ; VI-NEXT: s_mov_b32 s2, -1
778 ; VI-NEXT: s_waitcnt lgkmcnt(0)
779 ; VI-NEXT: s_lshl_b64 s[4:5], s[4:5], s6
780 ; VI-NEXT: v_mov_b32_e32 v0, s4
781 ; VI-NEXT: v_mov_b32_e32 v1, s5
782 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
787 ; EG-NEXT: ALU 0, @8, KC0[CB0:0-32], KC1[]
789 ; EG-NEXT: ALU 12, @9, KC0[CB0:0-32], KC1[]
790 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
793 ; EG-NEXT: Fetch clause starting at 6:
794 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
795 ; EG-NEXT: ALU clause starting at 8:
796 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
797 ; EG-NEXT: ALU clause starting at 9:
798 ; EG-NEXT: AND_INT T1.Y, T0.Z, literal.x,
799 ; EG-NEXT: LSHR T1.Z, T0.Y, 1,
800 ; EG-NEXT: BIT_ALIGN_INT T0.W, T0.Y, T0.X, 1,
801 ; EG-NEXT: NOT_INT * T1.W, T0.Z,
802 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
803 ; EG-NEXT: BIT_ALIGN_INT T1.Z, PV.Z, PV.W, PS,
804 ; EG-NEXT: LSHL T0.W, T0.X, PV.Y,
805 ; EG-NEXT: AND_INT * T1.W, T0.Z, literal.x,
806 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
807 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.Z, PV.W,
808 ; EG-NEXT: CNDE_INT T0.X, T1.W, T0.W, 0.0,
809 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
810 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
811 %b_ptr = getelementptr i64, ptr addrspace(1) %in, i64 1
812 %a = load i64, ptr addrspace(1) %in
813 %b = load i64, ptr addrspace(1) %b_ptr
814 %result = shl i64 %a, %b
815 store i64 %result, ptr addrspace(1) %out
819 define amdgpu_kernel void @shl_v2i64(ptr addrspace(1) %out, ptr addrspace(1) %in) {
820 ; SI-LABEL: shl_v2i64:
822 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
823 ; SI-NEXT: s_mov_b32 s7, 0xf000
824 ; SI-NEXT: s_mov_b32 s6, -1
825 ; SI-NEXT: s_mov_b32 s10, s6
826 ; SI-NEXT: s_mov_b32 s11, s7
827 ; SI-NEXT: s_waitcnt lgkmcnt(0)
828 ; SI-NEXT: s_mov_b32 s8, s2
829 ; SI-NEXT: s_mov_b32 s9, s3
830 ; SI-NEXT: buffer_load_dwordx4 v[0:3], off, s[8:11], 0
831 ; SI-NEXT: buffer_load_dwordx4 v[4:7], off, s[8:11], 0 offset:16
832 ; SI-NEXT: s_mov_b32 s4, s0
833 ; SI-NEXT: s_mov_b32 s5, s1
834 ; SI-NEXT: s_waitcnt vmcnt(0)
835 ; SI-NEXT: v_lshl_b64 v[2:3], v[2:3], v6
836 ; SI-NEXT: v_lshl_b64 v[0:1], v[0:1], v4
837 ; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
840 ; VI-LABEL: shl_v2i64:
842 ; VI-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x24
843 ; VI-NEXT: s_waitcnt lgkmcnt(0)
844 ; VI-NEXT: s_load_dwordx8 s[0:7], s[10:11], 0x0
845 ; VI-NEXT: s_mov_b32 s11, 0xf000
846 ; VI-NEXT: s_mov_b32 s10, -1
847 ; VI-NEXT: s_waitcnt lgkmcnt(0)
848 ; VI-NEXT: s_lshl_b64 s[2:3], s[2:3], s6
849 ; VI-NEXT: s_lshl_b64 s[0:1], s[0:1], s4
850 ; VI-NEXT: v_mov_b32_e32 v0, s0
851 ; VI-NEXT: v_mov_b32_e32 v1, s1
852 ; VI-NEXT: v_mov_b32_e32 v2, s2
853 ; VI-NEXT: v_mov_b32_e32 v3, s3
854 ; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[8:11], 0
857 ; EG-LABEL: shl_v2i64:
859 ; EG-NEXT: ALU 0, @10, KC0[CB0:0-32], KC1[]
861 ; EG-NEXT: ALU 22, @11, KC0[CB0:0-32], KC1[]
862 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T3.XYZW, T0.X, 1
865 ; EG-NEXT: Fetch clause starting at 6:
866 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 16, #1
867 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 0, #1
868 ; EG-NEXT: ALU clause starting at 10:
869 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
870 ; EG-NEXT: ALU clause starting at 11:
871 ; EG-NEXT: AND_INT T1.Y, T1.Z, literal.x,
872 ; EG-NEXT: LSHR T2.Z, T0.W, 1,
873 ; EG-NEXT: BIT_ALIGN_INT T0.W, T0.W, T0.Z, 1,
874 ; EG-NEXT: NOT_INT * T1.W, T1.Z,
875 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
876 ; EG-NEXT: BIT_ALIGN_INT T0.W, PV.Z, PV.W, PS,
877 ; EG-NEXT: LSHL * T1.W, T0.Z, PV.Y,
878 ; EG-NEXT: AND_INT T2.X, T1.Z, literal.x,
879 ; EG-NEXT: AND_INT T1.Y, T1.X, literal.y,
880 ; EG-NEXT: LSHR T0.Z, T0.Y, 1,
881 ; EG-NEXT: BIT_ALIGN_INT T2.W, T0.Y, T0.X, 1,
882 ; EG-NEXT: NOT_INT * T3.W, T1.X,
883 ; EG-NEXT: 32(4.484155e-44), 31(4.344025e-44)
884 ; EG-NEXT: BIT_ALIGN_INT T0.Y, PV.Z, PV.W, PS,
885 ; EG-NEXT: LSHL T0.Z, T0.X, PV.Y,
886 ; EG-NEXT: AND_INT T2.W, T1.X, literal.x, BS:VEC_120/SCL_212
887 ; EG-NEXT: CNDE_INT * T3.W, PV.X, T0.W, T1.W,
888 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
889 ; EG-NEXT: CNDE_INT T3.Y, PV.W, PV.Y, PV.Z,
890 ; EG-NEXT: CNDE_INT * T3.Z, T2.X, T1.W, 0.0,
891 ; EG-NEXT: CNDE_INT T3.X, T2.W, T0.Z, 0.0,
892 ; EG-NEXT: LSHR * T0.X, KC0[2].Y, literal.x,
893 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
894 %b_ptr = getelementptr <2 x i64>, ptr addrspace(1) %in, i64 1
895 %a = load <2 x i64>, ptr addrspace(1) %in
896 %b = load <2 x i64>, ptr addrspace(1) %b_ptr
897 %result = shl <2 x i64> %a, %b
898 store <2 x i64> %result, ptr addrspace(1) %out
902 define amdgpu_kernel void @shl_v4i64(ptr addrspace(1) %out, ptr addrspace(1) %in) {
903 ; SI-LABEL: shl_v4i64:
905 ; SI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
906 ; SI-NEXT: s_mov_b32 s3, 0xf000
907 ; SI-NEXT: s_mov_b32 s2, -1
908 ; SI-NEXT: s_mov_b32 s10, s2
909 ; SI-NEXT: s_mov_b32 s11, s3
910 ; SI-NEXT: s_waitcnt lgkmcnt(0)
911 ; SI-NEXT: s_mov_b32 s8, s6
912 ; SI-NEXT: s_mov_b32 s9, s7
913 ; SI-NEXT: buffer_load_dwordx4 v[0:3], off, s[8:11], 0
914 ; SI-NEXT: buffer_load_dwordx4 v[4:7], off, s[8:11], 0 offset:16
915 ; SI-NEXT: buffer_load_dwordx4 v[8:11], off, s[8:11], 0 offset:32
916 ; SI-NEXT: buffer_load_dwordx4 v[11:14], off, s[8:11], 0 offset:48
917 ; SI-NEXT: s_mov_b32 s0, s4
918 ; SI-NEXT: s_mov_b32 s1, s5
919 ; SI-NEXT: s_waitcnt vmcnt(1)
920 ; SI-NEXT: v_lshl_b64 v[2:3], v[2:3], v10
921 ; SI-NEXT: s_waitcnt vmcnt(0)
922 ; SI-NEXT: v_lshl_b64 v[6:7], v[6:7], v13
923 ; SI-NEXT: v_lshl_b64 v[4:5], v[4:5], v11
924 ; SI-NEXT: v_lshl_b64 v[0:1], v[0:1], v8
925 ; SI-NEXT: buffer_store_dwordx4 v[4:7], off, s[0:3], 0 offset:16
926 ; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[0:3], 0
929 ; VI-LABEL: shl_v4i64:
931 ; VI-NEXT: s_load_dwordx4 s[16:19], s[0:1], 0x24
932 ; VI-NEXT: s_waitcnt lgkmcnt(0)
933 ; VI-NEXT: s_load_dwordx16 s[0:15], s[18:19], 0x0
934 ; VI-NEXT: s_mov_b32 s19, 0xf000
935 ; VI-NEXT: s_mov_b32 s18, -1
936 ; VI-NEXT: s_waitcnt lgkmcnt(0)
937 ; VI-NEXT: s_lshl_b64 s[6:7], s[6:7], s14
938 ; VI-NEXT: s_lshl_b64 s[4:5], s[4:5], s12
939 ; VI-NEXT: s_lshl_b64 s[2:3], s[2:3], s10
940 ; VI-NEXT: s_lshl_b64 s[0:1], s[0:1], s8
941 ; VI-NEXT: v_mov_b32_e32 v0, s4
942 ; VI-NEXT: v_mov_b32_e32 v1, s5
943 ; VI-NEXT: v_mov_b32_e32 v2, s6
944 ; VI-NEXT: v_mov_b32_e32 v3, s7
945 ; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[16:19], 0 offset:16
947 ; VI-NEXT: v_mov_b32_e32 v0, s0
948 ; VI-NEXT: v_mov_b32_e32 v1, s1
949 ; VI-NEXT: v_mov_b32_e32 v2, s2
950 ; VI-NEXT: v_mov_b32_e32 v3, s3
951 ; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[16:19], 0
954 ; EG-LABEL: shl_v4i64:
956 ; EG-NEXT: ALU 0, @14, KC0[CB0:0-32], KC1[]
958 ; EG-NEXT: ALU 47, @15, KC0[CB0:0-32], KC1[]
959 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.XYZW, T2.X, 0
960 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T4.XYZW, T0.X, 1
962 ; EG-NEXT: Fetch clause starting at 6:
963 ; EG-NEXT: VTX_READ_128 T1.XYZW, T0.X, 48, #1
964 ; EG-NEXT: VTX_READ_128 T2.XYZW, T0.X, 0, #1
965 ; EG-NEXT: VTX_READ_128 T3.XYZW, T0.X, 32, #1
966 ; EG-NEXT: VTX_READ_128 T0.XYZW, T0.X, 16, #1
967 ; EG-NEXT: ALU clause starting at 14:
968 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
969 ; EG-NEXT: ALU clause starting at 15:
970 ; EG-NEXT: AND_INT T4.Z, T1.Z, literal.x,
971 ; EG-NEXT: LSHR T1.W, T0.W, 1,
972 ; EG-NEXT: NOT_INT * T3.W, T1.Z,
973 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
974 ; EG-NEXT: BIT_ALIGN_INT T4.X, T0.W, T0.Z, 1,
975 ; EG-NEXT: AND_INT T1.Y, T3.Z, literal.x, BS:VEC_201
976 ; EG-NEXT: LSHR T5.Z, T2.W, 1, BS:VEC_120/SCL_212
977 ; EG-NEXT: BIT_ALIGN_INT T0.W, T2.W, T2.Z, 1, BS:VEC_102/SCL_221
978 ; EG-NEXT: NOT_INT * T2.W, T3.Z,
979 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
980 ; EG-NEXT: BIT_ALIGN_INT T3.Y, PV.Z, PV.W, PS,
981 ; EG-NEXT: LSHL T2.Z, T2.Z, PV.Y,
982 ; EG-NEXT: BIT_ALIGN_INT T0.W, T1.W, PV.X, T3.W,
983 ; EG-NEXT: LSHL * T1.W, T0.Z, T4.Z,
984 ; EG-NEXT: AND_INT T4.X, T1.Z, literal.x,
985 ; EG-NEXT: AND_INT T1.Y, T1.X, literal.y,
986 ; EG-NEXT: LSHR T0.Z, T0.Y, 1,
987 ; EG-NEXT: BIT_ALIGN_INT T2.W, T0.Y, T0.X, 1,
988 ; EG-NEXT: NOT_INT * T3.W, T1.X,
989 ; EG-NEXT: 32(4.484155e-44), 31(4.344025e-44)
990 ; EG-NEXT: AND_INT T5.X, T3.Z, literal.x,
991 ; EG-NEXT: BIT_ALIGN_INT T0.Y, PV.Z, PV.W, PS,
992 ; EG-NEXT: LSHL T0.Z, T0.X, PV.Y,
993 ; EG-NEXT: AND_INT T2.W, T1.X, literal.x, BS:VEC_120/SCL_212
994 ; EG-NEXT: CNDE_INT * T4.W, PV.X, T0.W, T1.W,
995 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
996 ; EG-NEXT: AND_INT T0.X, T3.X, literal.x,
997 ; EG-NEXT: CNDE_INT T4.Y, PV.W, PV.Y, PV.Z,
998 ; EG-NEXT: LSHR T1.Z, T2.Y, 1,
999 ; EG-NEXT: BIT_ALIGN_INT T0.W, T2.Y, T2.X, 1,
1000 ; EG-NEXT: NOT_INT * T3.W, T3.X,
1001 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
1002 ; EG-NEXT: BIT_ALIGN_INT T1.X, PV.Z, PV.W, PS,
1003 ; EG-NEXT: LSHL T0.Y, T2.X, PV.X,
1004 ; EG-NEXT: CNDE_INT T4.Z, T4.X, T1.W, 0.0, BS:VEC_120/SCL_212
1005 ; EG-NEXT: AND_INT * T0.W, T3.X, literal.x, BS:VEC_201
1006 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
1007 ; EG-NEXT: CNDE_INT * T1.W, T5.X, T3.Y, T2.Z,
1008 ; EG-NEXT: CNDE_INT T4.X, T2.W, T0.Z, 0.0,
1009 ; EG-NEXT: CNDE_INT T1.Y, T0.W, T1.X, T0.Y, BS:VEC_120/SCL_212
1010 ; EG-NEXT: ADD_INT * T2.W, KC0[2].Y, literal.x,
1011 ; EG-NEXT: 16(2.242078e-44), 0(0.000000e+00)
1012 ; EG-NEXT: LSHR T0.X, PV.W, literal.x,
1013 ; EG-NEXT: CNDE_INT T1.Z, T5.X, T2.Z, 0.0,
1014 ; EG-NEXT: CNDE_INT * T1.X, T0.W, T0.Y, 0.0,
1015 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1016 ; EG-NEXT: LSHR * T2.X, KC0[2].Y, literal.x,
1017 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1018 %b_ptr = getelementptr <4 x i64>, ptr addrspace(1) %in, i64 1
1019 %a = load <4 x i64>, ptr addrspace(1) %in
1020 %b = load <4 x i64>, ptr addrspace(1) %b_ptr
1021 %result = shl <4 x i64> %a, %b
1022 store <4 x i64> %result, ptr addrspace(1) %out
1026 ; Make sure load width gets reduced to i32 load.
1027 define amdgpu_kernel void @s_shl_32_i64(ptr addrspace(1) %out, [8 x i32], i64 %a) {
1028 ; SI-LABEL: s_shl_32_i64:
1030 ; SI-NEXT: s_load_dword s4, s[0:1], 0x13
1031 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1032 ; SI-NEXT: s_mov_b32 s3, 0xf000
1033 ; SI-NEXT: s_mov_b32 s2, -1
1034 ; SI-NEXT: v_mov_b32_e32 v0, 0
1035 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1036 ; SI-NEXT: v_mov_b32_e32 v1, s4
1037 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1040 ; VI-LABEL: s_shl_32_i64:
1042 ; VI-NEXT: s_load_dword s4, s[0:1], 0x4c
1043 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1044 ; VI-NEXT: s_mov_b32 s3, 0xf000
1045 ; VI-NEXT: s_mov_b32 s2, -1
1046 ; VI-NEXT: v_mov_b32_e32 v0, 0
1047 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1048 ; VI-NEXT: v_mov_b32_e32 v1, s4
1049 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1052 ; EG-LABEL: s_shl_32_i64:
1054 ; EG-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
1055 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1058 ; EG-NEXT: ALU clause starting at 4:
1059 ; EG-NEXT: MOV * T0.Y, KC0[4].W,
1060 ; EG-NEXT: MOV T0.X, 0.0,
1061 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1062 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1063 %result = shl i64 %a, 32
1064 store i64 %result, ptr addrspace(1) %out
1068 define amdgpu_kernel void @v_shl_32_i64(ptr addrspace(1) %out, ptr addrspace(1) %in) {
1069 ; SI-LABEL: v_shl_32_i64:
1071 ; SI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
1072 ; SI-NEXT: s_ashr_i32 s3, s2, 31
1073 ; SI-NEXT: s_lshl_b64 s[0:1], s[2:3], 3
1074 ; SI-NEXT: v_mov_b32_e32 v0, s0
1075 ; SI-NEXT: s_mov_b32 s11, 0xf000
1076 ; SI-NEXT: s_mov_b32 s10, 0
1077 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1078 ; SI-NEXT: s_mov_b64 s[8:9], s[6:7]
1079 ; SI-NEXT: v_mov_b32_e32 v1, s1
1080 ; SI-NEXT: buffer_load_dword v3, v[0:1], s[8:11], 0 addr64
1081 ; SI-NEXT: s_mov_b64 s[6:7], s[10:11]
1082 ; SI-NEXT: v_mov_b32_e32 v2, 0
1083 ; SI-NEXT: s_waitcnt vmcnt(0)
1084 ; SI-NEXT: buffer_store_dwordx2 v[2:3], v[0:1], s[4:7], 0 addr64
1087 ; VI-LABEL: v_shl_32_i64:
1089 ; VI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
1090 ; VI-NEXT: s_ashr_i32 s3, s2, 31
1091 ; VI-NEXT: s_lshl_b64 s[0:1], s[2:3], 3
1092 ; VI-NEXT: v_mov_b32_e32 v0, 0
1093 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1094 ; VI-NEXT: s_add_u32 s2, s6, s0
1095 ; VI-NEXT: s_addc_u32 s3, s7, s1
1096 ; VI-NEXT: s_load_dword s2, s[2:3], 0x0
1097 ; VI-NEXT: s_add_u32 s0, s4, s0
1098 ; VI-NEXT: s_addc_u32 s1, s5, s1
1099 ; VI-NEXT: v_mov_b32_e32 v3, s1
1100 ; VI-NEXT: v_mov_b32_e32 v2, s0
1101 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1102 ; VI-NEXT: v_mov_b32_e32 v1, s2
1103 ; VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1106 ; EG-LABEL: v_shl_32_i64:
1108 ; EG-NEXT: ALU 2, @8, KC0[CB0:0-32], KC1[]
1110 ; EG-NEXT: ALU 4, @11, KC0[CB0:0-32], KC1[]
1111 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.XY, T2.X, 1
1114 ; EG-NEXT: Fetch clause starting at 6:
1115 ; EG-NEXT: VTX_READ_32 T0.X, T0.X, 0, #1
1116 ; EG-NEXT: ALU clause starting at 8:
1117 ; EG-NEXT: LSHL * T0.W, T1.X, literal.x,
1118 ; EG-NEXT: 3(4.203895e-45), 0(0.000000e+00)
1119 ; EG-NEXT: ADD_INT * T0.X, KC0[2].Z, PV.W,
1120 ; EG-NEXT: ALU clause starting at 11:
1121 ; EG-NEXT: MOV T1.X, 0.0,
1122 ; EG-NEXT: ADD_INT * T0.W, KC0[2].Y, T0.W,
1123 ; EG-NEXT: LSHR T2.X, PV.W, literal.x,
1124 ; EG-NEXT: MOV * T1.Y, T0.X,
1125 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1126 %tid = call i32 @llvm.amdgcn.workgroup.id.x() #0
1127 %gep.in = getelementptr i64, ptr addrspace(1) %in, i32 %tid
1128 %gep.out = getelementptr i64, ptr addrspace(1) %out, i32 %tid
1129 %a = load i64, ptr addrspace(1) %gep.in
1130 %result = shl i64 %a, 32
1131 store i64 %result, ptr addrspace(1) %gep.out
1135 define amdgpu_kernel void @s_shl_constant_i64(ptr addrspace(1) %out, i64 %a) {
1136 ; SI-LABEL: s_shl_constant_i64:
1138 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
1139 ; SI-NEXT: s_mov_b32 s6, -1
1140 ; SI-NEXT: s_mov_b32 s9, 0xffff
1141 ; SI-NEXT: s_mov_b32 s8, s6
1142 ; SI-NEXT: s_mov_b32 s7, 0xf000
1143 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1144 ; SI-NEXT: s_mov_b32 s4, s0
1145 ; SI-NEXT: s_mov_b32 s5, s1
1146 ; SI-NEXT: s_lshl_b64 s[0:1], s[8:9], s2
1147 ; SI-NEXT: v_mov_b32_e32 v0, s0
1148 ; SI-NEXT: v_mov_b32_e32 v1, s1
1149 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1152 ; VI-LABEL: s_shl_constant_i64:
1154 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1155 ; VI-NEXT: s_mov_b32 s6, -1
1156 ; VI-NEXT: s_mov_b32 s9, 0xffff
1157 ; VI-NEXT: s_mov_b32 s8, s6
1158 ; VI-NEXT: s_mov_b32 s7, 0xf000
1159 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1160 ; VI-NEXT: s_mov_b32 s4, s0
1161 ; VI-NEXT: s_mov_b32 s5, s1
1162 ; VI-NEXT: s_lshl_b64 s[0:1], s[8:9], s2
1163 ; VI-NEXT: v_mov_b32_e32 v0, s0
1164 ; VI-NEXT: v_mov_b32_e32 v1, s1
1165 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1168 ; EG-LABEL: s_shl_constant_i64:
1170 ; EG-NEXT: ALU 12, @4, KC0[CB0:0-32], KC1[]
1171 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1174 ; EG-NEXT: ALU clause starting at 4:
1175 ; EG-NEXT: AND_INT T0.Z, KC0[2].W, literal.x,
1176 ; EG-NEXT: MOV T0.W, literal.y,
1177 ; EG-NEXT: NOT_INT * T1.W, KC0[2].W,
1178 ; EG-NEXT: 31(4.344025e-44), -1(nan)
1179 ; EG-NEXT: BIT_ALIGN_INT T1.Z, literal.x, PV.W, PS,
1180 ; EG-NEXT: LSHL T0.W, literal.y, PV.Z,
1181 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.z,
1182 ; EG-NEXT: 32767(4.591635e-41), -1(nan)
1183 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
1184 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.Z, PV.W,
1185 ; EG-NEXT: CNDE_INT T0.X, T1.W, T0.W, 0.0,
1186 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1187 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1188 %shl = shl i64 281474976710655, %a
1189 store i64 %shl, ptr addrspace(1) %out, align 8
1193 define amdgpu_kernel void @v_shl_constant_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr) {
1194 ; SI-LABEL: v_shl_constant_i64:
1196 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
1197 ; SI-NEXT: s_mov_b32 s7, 0xf000
1198 ; SI-NEXT: s_mov_b32 s6, -1
1199 ; SI-NEXT: s_mov_b32 s10, s6
1200 ; SI-NEXT: s_mov_b32 s11, s7
1201 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1202 ; SI-NEXT: s_mov_b32 s8, s2
1203 ; SI-NEXT: s_mov_b32 s9, s3
1204 ; SI-NEXT: buffer_load_dword v0, off, s[8:11], 0
1205 ; SI-NEXT: s_mov_b32 s2, 0xab19b207
1206 ; SI-NEXT: s_movk_i32 s3, 0x11e
1207 ; SI-NEXT: s_mov_b32 s4, s0
1208 ; SI-NEXT: s_mov_b32 s5, s1
1209 ; SI-NEXT: s_waitcnt vmcnt(0)
1210 ; SI-NEXT: v_lshl_b64 v[0:1], s[2:3], v0
1211 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1214 ; VI-LABEL: v_shl_constant_i64:
1216 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1217 ; VI-NEXT: s_mov_b32 s7, 0xf000
1218 ; VI-NEXT: s_mov_b32 s6, -1
1219 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1220 ; VI-NEXT: s_load_dword s2, s[2:3], 0x0
1221 ; VI-NEXT: s_mov_b32 s4, s0
1222 ; VI-NEXT: s_mov_b32 s5, s1
1223 ; VI-NEXT: s_mov_b32 s0, 0xab19b207
1224 ; VI-NEXT: s_movk_i32 s1, 0x11e
1225 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1226 ; VI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
1227 ; VI-NEXT: v_mov_b32_e32 v0, s0
1228 ; VI-NEXT: v_mov_b32_e32 v1, s1
1229 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1232 ; EG-LABEL: v_shl_constant_i64:
1234 ; EG-NEXT: ALU 0, @8, KC0[CB0:0-32], KC1[]
1236 ; EG-NEXT: ALU 12, @9, KC0[CB0:0-32], KC1[]
1237 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1240 ; EG-NEXT: Fetch clause starting at 6:
1241 ; EG-NEXT: VTX_READ_32 T0.X, T0.X, 0, #1
1242 ; EG-NEXT: ALU clause starting at 8:
1243 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
1244 ; EG-NEXT: ALU clause starting at 9:
1245 ; EG-NEXT: NOT_INT T0.Z, T0.X,
1246 ; EG-NEXT: MOV T0.W, literal.x,
1247 ; EG-NEXT: AND_INT * T1.W, T0.X, literal.y,
1248 ; EG-NEXT: 1435293955(1.935796e+13), 31(4.344025e-44)
1249 ; EG-NEXT: LSHL T1.Z, literal.x, PS,
1250 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.y, PV.W, PV.Z,
1251 ; EG-NEXT: AND_INT * T1.W, T0.X, literal.z,
1252 ; EG-NEXT: -1424379385(-5.460358e-13), 143(2.003857e-43)
1253 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
1254 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, PV.Z,
1255 ; EG-NEXT: CNDE_INT T0.X, T1.W, T1.Z, 0.0,
1256 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1257 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1258 %a = load i64, ptr addrspace(1) %aptr, align 8
1259 %shl = shl i64 1231231234567, %a
1260 store i64 %shl, ptr addrspace(1) %out, align 8
1264 define amdgpu_kernel void @v_shl_i64_32_bit_constant(ptr addrspace(1) %out, ptr addrspace(1) %aptr) {
1265 ; SI-LABEL: v_shl_i64_32_bit_constant:
1267 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
1268 ; SI-NEXT: s_mov_b32 s7, 0xf000
1269 ; SI-NEXT: s_mov_b32 s6, -1
1270 ; SI-NEXT: s_mov_b32 s10, s6
1271 ; SI-NEXT: s_mov_b32 s11, s7
1272 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1273 ; SI-NEXT: s_mov_b32 s8, s2
1274 ; SI-NEXT: s_mov_b32 s9, s3
1275 ; SI-NEXT: buffer_load_dword v0, off, s[8:11], 0
1276 ; SI-NEXT: s_mov_b64 s[2:3], 0x12d687
1277 ; SI-NEXT: s_mov_b32 s4, s0
1278 ; SI-NEXT: s_mov_b32 s5, s1
1279 ; SI-NEXT: s_waitcnt vmcnt(0)
1280 ; SI-NEXT: v_lshl_b64 v[0:1], s[2:3], v0
1281 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1284 ; VI-LABEL: v_shl_i64_32_bit_constant:
1286 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1287 ; VI-NEXT: s_mov_b32 s7, 0xf000
1288 ; VI-NEXT: s_mov_b32 s6, -1
1289 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1290 ; VI-NEXT: s_load_dword s2, s[2:3], 0x0
1291 ; VI-NEXT: s_mov_b32 s4, s0
1292 ; VI-NEXT: s_mov_b32 s5, s1
1293 ; VI-NEXT: s_mov_b64 s[0:1], 0x12d687
1294 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1295 ; VI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
1296 ; VI-NEXT: v_mov_b32_e32 v0, s0
1297 ; VI-NEXT: v_mov_b32_e32 v1, s1
1298 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1301 ; EG-LABEL: v_shl_i64_32_bit_constant:
1303 ; EG-NEXT: ALU 0, @8, KC0[CB0:0-32], KC1[]
1305 ; EG-NEXT: ALU 11, @9, KC0[CB0:0-32], KC1[]
1306 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1309 ; EG-NEXT: Fetch clause starting at 6:
1310 ; EG-NEXT: VTX_READ_32 T0.X, T0.X, 0, #1
1311 ; EG-NEXT: ALU clause starting at 8:
1312 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
1313 ; EG-NEXT: ALU clause starting at 9:
1314 ; EG-NEXT: AND_INT T0.W, T0.X, literal.x,
1315 ; EG-NEXT: NOT_INT * T1.W, T0.X,
1316 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
1317 ; EG-NEXT: BIT_ALIGN_INT T0.Z, 0.0, literal.x, PS,
1318 ; EG-NEXT: LSHL T0.W, literal.y, PV.W,
1319 ; EG-NEXT: AND_INT * T1.W, T0.X, literal.z,
1320 ; EG-NEXT: 617283(8.649977e-40), 1234567(1.729997e-39)
1321 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
1322 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.Z, PV.W,
1323 ; EG-NEXT: CNDE_INT T0.X, T1.W, T0.W, 0.0,
1324 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1325 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1326 %a = load i64, ptr addrspace(1) %aptr, align 8
1327 %shl = shl i64 1234567, %a
1328 store i64 %shl, ptr addrspace(1) %out, align 8
1332 define amdgpu_kernel void @v_shl_inline_imm_64_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr) {
1333 ; SI-LABEL: v_shl_inline_imm_64_i64:
1335 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
1336 ; SI-NEXT: s_mov_b32 s7, 0xf000
1337 ; SI-NEXT: s_mov_b32 s6, -1
1338 ; SI-NEXT: s_mov_b32 s10, s6
1339 ; SI-NEXT: s_mov_b32 s11, s7
1340 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1341 ; SI-NEXT: s_mov_b32 s8, s2
1342 ; SI-NEXT: s_mov_b32 s9, s3
1343 ; SI-NEXT: buffer_load_dword v0, off, s[8:11], 0
1344 ; SI-NEXT: s_mov_b32 s4, s0
1345 ; SI-NEXT: s_mov_b32 s5, s1
1346 ; SI-NEXT: s_waitcnt vmcnt(0)
1347 ; SI-NEXT: v_lshl_b64 v[0:1], 64, v0
1348 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1351 ; VI-LABEL: v_shl_inline_imm_64_i64:
1353 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1354 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1355 ; VI-NEXT: s_load_dword s4, s[2:3], 0x0
1356 ; VI-NEXT: s_mov_b32 s3, 0xf000
1357 ; VI-NEXT: s_mov_b32 s2, -1
1358 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1359 ; VI-NEXT: s_lshl_b64 s[4:5], 64, s4
1360 ; VI-NEXT: v_mov_b32_e32 v0, s4
1361 ; VI-NEXT: v_mov_b32_e32 v1, s5
1362 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1365 ; EG-LABEL: v_shl_inline_imm_64_i64:
1367 ; EG-NEXT: ALU 0, @8, KC0[CB0:0-32], KC1[]
1369 ; EG-NEXT: ALU 10, @9, KC0[CB0:0-32], KC1[]
1370 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1373 ; EG-NEXT: Fetch clause starting at 6:
1374 ; EG-NEXT: VTX_READ_32 T0.X, T0.X, 0, #1
1375 ; EG-NEXT: ALU clause starting at 8:
1376 ; EG-NEXT: MOV * T0.X, KC0[2].Z,
1377 ; EG-NEXT: ALU clause starting at 9:
1378 ; EG-NEXT: AND_INT T0.W, T0.X, literal.x,
1379 ; EG-NEXT: NOT_INT * T1.W, T0.X,
1380 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
1381 ; EG-NEXT: BIT_ALIGN_INT T0.Z, 0.0, literal.x, PS,
1382 ; EG-NEXT: LSHL T0.W, literal.y, PV.W,
1383 ; EG-NEXT: AND_INT * T1.W, T0.X, literal.x,
1384 ; EG-NEXT: 32(4.484155e-44), 64(8.968310e-44)
1385 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.Z, PV.W,
1386 ; EG-NEXT: CNDE_INT T0.X, T1.W, T0.W, 0.0,
1387 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1388 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1389 %a = load i64, ptr addrspace(1) %aptr, align 8
1390 %shl = shl i64 64, %a
1391 store i64 %shl, ptr addrspace(1) %out, align 8
1395 define amdgpu_kernel void @s_shl_inline_imm_64_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1396 ; SI-LABEL: s_shl_inline_imm_64_i64:
1398 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1399 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1400 ; SI-NEXT: s_mov_b32 s3, 0xf000
1401 ; SI-NEXT: s_mov_b32 s2, -1
1402 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1403 ; SI-NEXT: s_lshl_b64 s[4:5], 64, s4
1404 ; SI-NEXT: v_mov_b32_e32 v0, s4
1405 ; SI-NEXT: v_mov_b32_e32 v1, s5
1406 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1409 ; VI-LABEL: s_shl_inline_imm_64_i64:
1411 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1412 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1413 ; VI-NEXT: s_mov_b32 s3, 0xf000
1414 ; VI-NEXT: s_mov_b32 s2, -1
1415 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1416 ; VI-NEXT: s_lshl_b64 s[4:5], 64, s4
1417 ; VI-NEXT: v_mov_b32_e32 v0, s4
1418 ; VI-NEXT: v_mov_b32_e32 v1, s5
1419 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1422 ; EG-LABEL: s_shl_inline_imm_64_i64:
1424 ; EG-NEXT: ALU 10, @4, KC0[CB0:0-32], KC1[]
1425 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1428 ; EG-NEXT: ALU clause starting at 4:
1429 ; EG-NEXT: NOT_INT T0.W, KC0[2].W,
1430 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.x,
1431 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
1432 ; EG-NEXT: LSHL T0.Z, literal.x, PS,
1433 ; EG-NEXT: BIT_ALIGN_INT T0.W, 0.0, literal.y, PV.W,
1434 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1435 ; EG-NEXT: 64(8.968310e-44), 32(4.484155e-44)
1436 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, PV.Z,
1437 ; EG-NEXT: CNDE_INT T0.X, T1.W, T0.Z, 0.0,
1438 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1439 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1440 %shl = shl i64 64, %a
1441 store i64 %shl, ptr addrspace(1) %out, align 8
1445 define amdgpu_kernel void @s_shl_inline_imm_1_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1446 ; SI-LABEL: s_shl_inline_imm_1_i64:
1448 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1449 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1450 ; SI-NEXT: s_mov_b32 s3, 0xf000
1451 ; SI-NEXT: s_mov_b32 s2, -1
1452 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1453 ; SI-NEXT: s_lshl_b64 s[4:5], 1, s4
1454 ; SI-NEXT: v_mov_b32_e32 v0, s4
1455 ; SI-NEXT: v_mov_b32_e32 v1, s5
1456 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1459 ; VI-LABEL: s_shl_inline_imm_1_i64:
1461 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1462 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1463 ; VI-NEXT: s_mov_b32 s3, 0xf000
1464 ; VI-NEXT: s_mov_b32 s2, -1
1465 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1466 ; VI-NEXT: s_lshl_b64 s[4:5], 1, s4
1467 ; VI-NEXT: v_mov_b32_e32 v0, s4
1468 ; VI-NEXT: v_mov_b32_e32 v1, s5
1469 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1472 ; EG-LABEL: s_shl_inline_imm_1_i64:
1474 ; EG-NEXT: ALU 11, @4, KC0[CB0:0-32], KC1[]
1475 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1478 ; EG-NEXT: ALU clause starting at 4:
1479 ; EG-NEXT: AND_INT T0.W, KC0[2].W, literal.x,
1480 ; EG-NEXT: LSHL * T1.W, KC0[2].W, literal.y,
1481 ; EG-NEXT: 31(4.344025e-44), 26(3.643376e-44)
1482 ; EG-NEXT: ASHR T1.W, PS, literal.x,
1483 ; EG-NEXT: LSHL * T0.W, 1, PV.W,
1484 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
1485 ; EG-NEXT: AND_INT T0.Y, PV.W, PS,
1486 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.x,
1487 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
1488 ; EG-NEXT: CNDE_INT T0.X, PV.W, T0.W, 0.0,
1489 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1490 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1491 %shl = shl i64 1, %a
1492 store i64 %shl, ptr addrspace(1) %out, align 8
1496 define amdgpu_kernel void @s_shl_inline_imm_1_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1497 ; SI-LABEL: s_shl_inline_imm_1_0_i64:
1499 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1500 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1501 ; SI-NEXT: s_mov_b32 s3, 0xf000
1502 ; SI-NEXT: s_mov_b32 s2, -1
1503 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1504 ; SI-NEXT: s_lshl_b64 s[4:5], 1.0, s4
1505 ; SI-NEXT: v_mov_b32_e32 v0, s4
1506 ; SI-NEXT: v_mov_b32_e32 v1, s5
1507 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1510 ; VI-LABEL: s_shl_inline_imm_1_0_i64:
1512 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1513 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1514 ; VI-NEXT: s_mov_b32 s3, 0xf000
1515 ; VI-NEXT: s_mov_b32 s2, -1
1516 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1517 ; VI-NEXT: s_lshl_b64 s[4:5], 1.0, s4
1518 ; VI-NEXT: v_mov_b32_e32 v0, s4
1519 ; VI-NEXT: v_mov_b32_e32 v1, s5
1520 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1523 ; EG-LABEL: s_shl_inline_imm_1_0_i64:
1525 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
1526 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1529 ; EG-NEXT: ALU clause starting at 4:
1530 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
1531 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
1532 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1533 ; EG-NEXT: 536346624(1.050321e-19), 32(4.484155e-44)
1534 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
1535 ; EG-NEXT: MOV T0.X, 0.0,
1536 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1537 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1538 %shl = shl i64 4607182418800017408, %a
1539 store i64 %shl, ptr addrspace(1) %out, align 8
1543 define amdgpu_kernel void @s_shl_inline_imm_neg_1_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1544 ; SI-LABEL: s_shl_inline_imm_neg_1_0_i64:
1546 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1547 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1548 ; SI-NEXT: s_mov_b32 s3, 0xf000
1549 ; SI-NEXT: s_mov_b32 s2, -1
1550 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1551 ; SI-NEXT: s_lshl_b64 s[4:5], -1.0, s4
1552 ; SI-NEXT: v_mov_b32_e32 v0, s4
1553 ; SI-NEXT: v_mov_b32_e32 v1, s5
1554 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1557 ; VI-LABEL: s_shl_inline_imm_neg_1_0_i64:
1559 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1560 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1561 ; VI-NEXT: s_mov_b32 s3, 0xf000
1562 ; VI-NEXT: s_mov_b32 s2, -1
1563 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1564 ; VI-NEXT: s_lshl_b64 s[4:5], -1.0, s4
1565 ; VI-NEXT: v_mov_b32_e32 v0, s4
1566 ; VI-NEXT: v_mov_b32_e32 v1, s5
1567 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1570 ; EG-LABEL: s_shl_inline_imm_neg_1_0_i64:
1572 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
1573 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1576 ; EG-NEXT: ALU clause starting at 4:
1577 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
1578 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
1579 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1580 ; EG-NEXT: 1610088448(3.574057e+19), 32(4.484155e-44)
1581 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
1582 ; EG-NEXT: MOV T0.X, 0.0,
1583 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1584 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1585 %shl = shl i64 13830554455654793216, %a
1586 store i64 %shl, ptr addrspace(1) %out, align 8
1590 define amdgpu_kernel void @s_shl_inline_imm_0_5_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1591 ; SI-LABEL: s_shl_inline_imm_0_5_i64:
1593 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1594 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1595 ; SI-NEXT: s_mov_b32 s3, 0xf000
1596 ; SI-NEXT: s_mov_b32 s2, -1
1597 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1598 ; SI-NEXT: s_lshl_b64 s[4:5], 0.5, s4
1599 ; SI-NEXT: v_mov_b32_e32 v0, s4
1600 ; SI-NEXT: v_mov_b32_e32 v1, s5
1601 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1604 ; VI-LABEL: s_shl_inline_imm_0_5_i64:
1606 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1607 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1608 ; VI-NEXT: s_mov_b32 s3, 0xf000
1609 ; VI-NEXT: s_mov_b32 s2, -1
1610 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1611 ; VI-NEXT: s_lshl_b64 s[4:5], 0.5, s4
1612 ; VI-NEXT: v_mov_b32_e32 v0, s4
1613 ; VI-NEXT: v_mov_b32_e32 v1, s5
1614 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1617 ; EG-LABEL: s_shl_inline_imm_0_5_i64:
1619 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
1620 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1623 ; EG-NEXT: ALU clause starting at 4:
1624 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
1625 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
1626 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1627 ; EG-NEXT: 535822336(1.016440e-19), 32(4.484155e-44)
1628 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
1629 ; EG-NEXT: MOV T0.X, 0.0,
1630 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1631 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1632 %shl = shl i64 4602678819172646912, %a
1633 store i64 %shl, ptr addrspace(1) %out, align 8
1637 define amdgpu_kernel void @s_shl_inline_imm_neg_0_5_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1638 ; SI-LABEL: s_shl_inline_imm_neg_0_5_i64:
1640 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1641 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1642 ; SI-NEXT: s_mov_b32 s3, 0xf000
1643 ; SI-NEXT: s_mov_b32 s2, -1
1644 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1645 ; SI-NEXT: s_lshl_b64 s[4:5], -0.5, s4
1646 ; SI-NEXT: v_mov_b32_e32 v0, s4
1647 ; SI-NEXT: v_mov_b32_e32 v1, s5
1648 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1651 ; VI-LABEL: s_shl_inline_imm_neg_0_5_i64:
1653 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1654 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1655 ; VI-NEXT: s_mov_b32 s3, 0xf000
1656 ; VI-NEXT: s_mov_b32 s2, -1
1657 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1658 ; VI-NEXT: s_lshl_b64 s[4:5], -0.5, s4
1659 ; VI-NEXT: v_mov_b32_e32 v0, s4
1660 ; VI-NEXT: v_mov_b32_e32 v1, s5
1661 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1664 ; EG-LABEL: s_shl_inline_imm_neg_0_5_i64:
1666 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
1667 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1670 ; EG-NEXT: ALU clause starting at 4:
1671 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
1672 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
1673 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1674 ; EG-NEXT: 1609564160(3.458765e+19), 32(4.484155e-44)
1675 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
1676 ; EG-NEXT: MOV T0.X, 0.0,
1677 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1678 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1679 %shl = shl i64 13826050856027422720, %a
1680 store i64 %shl, ptr addrspace(1) %out, align 8
1684 define amdgpu_kernel void @s_shl_inline_imm_2_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1685 ; SI-LABEL: s_shl_inline_imm_2_0_i64:
1687 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1688 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1689 ; SI-NEXT: s_mov_b32 s3, 0xf000
1690 ; SI-NEXT: s_mov_b32 s2, -1
1691 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1692 ; SI-NEXT: s_lshl_b64 s[4:5], 2.0, s4
1693 ; SI-NEXT: v_mov_b32_e32 v0, s4
1694 ; SI-NEXT: v_mov_b32_e32 v1, s5
1695 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1698 ; VI-LABEL: s_shl_inline_imm_2_0_i64:
1700 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1701 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1702 ; VI-NEXT: s_mov_b32 s3, 0xf000
1703 ; VI-NEXT: s_mov_b32 s2, -1
1704 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1705 ; VI-NEXT: s_lshl_b64 s[4:5], 2.0, s4
1706 ; VI-NEXT: v_mov_b32_e32 v0, s4
1707 ; VI-NEXT: v_mov_b32_e32 v1, s5
1708 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1711 ; EG-LABEL: s_shl_inline_imm_2_0_i64:
1713 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
1714 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1717 ; EG-NEXT: ALU clause starting at 4:
1718 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
1719 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
1720 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1721 ; EG-NEXT: 536870912(1.084202e-19), 32(4.484155e-44)
1722 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
1723 ; EG-NEXT: MOV T0.X, 0.0,
1724 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1725 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1726 %shl = shl i64 4611686018427387904, %a
1727 store i64 %shl, ptr addrspace(1) %out, align 8
1731 define amdgpu_kernel void @s_shl_inline_imm_neg_2_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1732 ; SI-LABEL: s_shl_inline_imm_neg_2_0_i64:
1734 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1735 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1736 ; SI-NEXT: s_mov_b32 s3, 0xf000
1737 ; SI-NEXT: s_mov_b32 s2, -1
1738 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1739 ; SI-NEXT: s_lshl_b64 s[4:5], -2.0, s4
1740 ; SI-NEXT: v_mov_b32_e32 v0, s4
1741 ; SI-NEXT: v_mov_b32_e32 v1, s5
1742 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1745 ; VI-LABEL: s_shl_inline_imm_neg_2_0_i64:
1747 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1748 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1749 ; VI-NEXT: s_mov_b32 s3, 0xf000
1750 ; VI-NEXT: s_mov_b32 s2, -1
1751 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1752 ; VI-NEXT: s_lshl_b64 s[4:5], -2.0, s4
1753 ; VI-NEXT: v_mov_b32_e32 v0, s4
1754 ; VI-NEXT: v_mov_b32_e32 v1, s5
1755 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1758 ; EG-LABEL: s_shl_inline_imm_neg_2_0_i64:
1760 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
1761 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1764 ; EG-NEXT: ALU clause starting at 4:
1765 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
1766 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
1767 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1768 ; EG-NEXT: 1610612736(3.689349e+19), 32(4.484155e-44)
1769 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
1770 ; EG-NEXT: MOV T0.X, 0.0,
1771 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1772 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1773 %shl = shl i64 13835058055282163712, %a
1774 store i64 %shl, ptr addrspace(1) %out, align 8
1778 define amdgpu_kernel void @s_shl_inline_imm_4_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1779 ; SI-LABEL: s_shl_inline_imm_4_0_i64:
1781 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1782 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1783 ; SI-NEXT: s_mov_b32 s3, 0xf000
1784 ; SI-NEXT: s_mov_b32 s2, -1
1785 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1786 ; SI-NEXT: s_lshl_b64 s[4:5], 4.0, s4
1787 ; SI-NEXT: v_mov_b32_e32 v0, s4
1788 ; SI-NEXT: v_mov_b32_e32 v1, s5
1789 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1792 ; VI-LABEL: s_shl_inline_imm_4_0_i64:
1794 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1795 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1796 ; VI-NEXT: s_mov_b32 s3, 0xf000
1797 ; VI-NEXT: s_mov_b32 s2, -1
1798 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1799 ; VI-NEXT: s_lshl_b64 s[4:5], 4.0, s4
1800 ; VI-NEXT: v_mov_b32_e32 v0, s4
1801 ; VI-NEXT: v_mov_b32_e32 v1, s5
1802 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1805 ; EG-LABEL: s_shl_inline_imm_4_0_i64:
1807 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
1808 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1811 ; EG-NEXT: ALU clause starting at 4:
1812 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
1813 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
1814 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1815 ; EG-NEXT: 537395200(1.151965e-19), 32(4.484155e-44)
1816 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
1817 ; EG-NEXT: MOV T0.X, 0.0,
1818 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1819 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1820 %shl = shl i64 4616189618054758400, %a
1821 store i64 %shl, ptr addrspace(1) %out, align 8
1825 define amdgpu_kernel void @s_shl_inline_imm_neg_4_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1826 ; SI-LABEL: s_shl_inline_imm_neg_4_0_i64:
1828 ; SI-NEXT: s_load_dword s4, s[0:1], 0xd
1829 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
1830 ; SI-NEXT: s_mov_b32 s3, 0xf000
1831 ; SI-NEXT: s_mov_b32 s2, -1
1832 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1833 ; SI-NEXT: s_lshl_b64 s[4:5], -4.0, s4
1834 ; SI-NEXT: v_mov_b32_e32 v0, s4
1835 ; SI-NEXT: v_mov_b32_e32 v1, s5
1836 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1839 ; VI-LABEL: s_shl_inline_imm_neg_4_0_i64:
1841 ; VI-NEXT: s_load_dword s4, s[0:1], 0x34
1842 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1843 ; VI-NEXT: s_mov_b32 s3, 0xf000
1844 ; VI-NEXT: s_mov_b32 s2, -1
1845 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1846 ; VI-NEXT: s_lshl_b64 s[4:5], -4.0, s4
1847 ; VI-NEXT: v_mov_b32_e32 v0, s4
1848 ; VI-NEXT: v_mov_b32_e32 v1, s5
1849 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
1852 ; EG-LABEL: s_shl_inline_imm_neg_4_0_i64:
1854 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
1855 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1858 ; EG-NEXT: ALU clause starting at 4:
1859 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
1860 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
1861 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
1862 ; EG-NEXT: 1611137024(3.919933e+19), 32(4.484155e-44)
1863 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
1864 ; EG-NEXT: MOV T0.X, 0.0,
1865 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1866 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1867 %shl = shl i64 13839561654909534208, %a
1868 store i64 %shl, ptr addrspace(1) %out, align 8
1873 ; Test with the 64-bit integer bitpattern for a 32-bit float in the
1874 ; low 32-bits, which is not a valid 64-bit inline immmediate.
1875 define amdgpu_kernel void @s_shl_inline_imm_f32_4_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1876 ; SI-LABEL: s_shl_inline_imm_f32_4_0_i64:
1878 ; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
1879 ; SI-NEXT: s_load_dword s2, s[0:1], 0xd
1880 ; SI-NEXT: s_mov_b64 s[0:1], 0x40800000
1881 ; SI-NEXT: s_mov_b32 s7, 0xf000
1882 ; SI-NEXT: s_mov_b32 s6, -1
1883 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1884 ; SI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
1885 ; SI-NEXT: v_mov_b32_e32 v0, s0
1886 ; SI-NEXT: v_mov_b32_e32 v1, s1
1887 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1890 ; VI-LABEL: s_shl_inline_imm_f32_4_0_i64:
1892 ; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
1893 ; VI-NEXT: s_load_dword s2, s[0:1], 0x34
1894 ; VI-NEXT: s_mov_b64 s[0:1], 0x40800000
1895 ; VI-NEXT: s_mov_b32 s7, 0xf000
1896 ; VI-NEXT: s_mov_b32 s6, -1
1897 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1898 ; VI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
1899 ; VI-NEXT: v_mov_b32_e32 v0, s0
1900 ; VI-NEXT: v_mov_b32_e32 v1, s1
1901 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1904 ; EG-LABEL: s_shl_inline_imm_f32_4_0_i64:
1906 ; EG-NEXT: ALU 11, @4, KC0[CB0:0-32], KC1[]
1907 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1910 ; EG-NEXT: ALU clause starting at 4:
1911 ; EG-NEXT: NOT_INT T0.W, KC0[2].W,
1912 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.x,
1913 ; EG-NEXT: 31(4.344025e-44), 0(0.000000e+00)
1914 ; EG-NEXT: LSHL T0.Z, literal.x, PS,
1915 ; EG-NEXT: BIT_ALIGN_INT T0.W, 0.0, literal.y, PV.W,
1916 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.z,
1917 ; EG-NEXT: 1082130432(4.000000e+00), 541065216(1.626303e-19)
1918 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
1919 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, PV.Z,
1920 ; EG-NEXT: CNDE_INT T0.X, T1.W, T0.Z, 0.0,
1921 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1922 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1923 %shl = shl i64 1082130432, %a
1924 store i64 %shl, ptr addrspace(1) %out, align 8
1928 ; FIXME: Copy of -1 register
1929 define amdgpu_kernel void @s_shl_inline_imm_f32_neg_4_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1930 ; SI-LABEL: s_shl_inline_imm_f32_neg_4_0_i64:
1932 ; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
1933 ; SI-NEXT: s_load_dword s2, s[0:1], 0xd
1934 ; SI-NEXT: s_mov_b32 s6, -1
1935 ; SI-NEXT: s_mov_b32 s0, -4.0
1936 ; SI-NEXT: s_mov_b32 s1, s6
1937 ; SI-NEXT: s_mov_b32 s7, 0xf000
1938 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1939 ; SI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
1940 ; SI-NEXT: v_mov_b32_e32 v0, s0
1941 ; SI-NEXT: v_mov_b32_e32 v1, s1
1942 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1945 ; VI-LABEL: s_shl_inline_imm_f32_neg_4_0_i64:
1947 ; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
1948 ; VI-NEXT: s_load_dword s2, s[0:1], 0x34
1949 ; VI-NEXT: s_mov_b32 s6, -1
1950 ; VI-NEXT: s_mov_b32 s0, -4.0
1951 ; VI-NEXT: s_mov_b32 s1, s6
1952 ; VI-NEXT: s_mov_b32 s7, 0xf000
1953 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1954 ; VI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
1955 ; VI-NEXT: v_mov_b32_e32 v0, s0
1956 ; VI-NEXT: v_mov_b32_e32 v1, s1
1957 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
1960 ; EG-LABEL: s_shl_inline_imm_f32_neg_4_0_i64:
1962 ; EG-NEXT: ALU 12, @4, KC0[CB0:0-32], KC1[]
1963 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
1966 ; EG-NEXT: ALU clause starting at 4:
1967 ; EG-NEXT: AND_INT T0.Z, KC0[2].W, literal.x,
1968 ; EG-NEXT: MOV T0.W, literal.y,
1969 ; EG-NEXT: NOT_INT * T1.W, KC0[2].W,
1970 ; EG-NEXT: 31(4.344025e-44), -532676608(-5.534023e+19)
1971 ; EG-NEXT: BIT_ALIGN_INT T1.Z, literal.x, PV.W, PS,
1972 ; EG-NEXT: LSHL T0.W, literal.y, PV.Z,
1973 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.z,
1974 ; EG-NEXT: 2147483647(nan), -1065353216(-4.000000e+00)
1975 ; EG-NEXT: 32(4.484155e-44), 0(0.000000e+00)
1976 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.Z, PV.W,
1977 ; EG-NEXT: CNDE_INT T0.X, T1.W, T0.W, 0.0,
1978 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
1979 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
1980 %shl = shl i64 -1065353216, %a
1981 store i64 %shl, ptr addrspace(1) %out, align 8
1985 define amdgpu_kernel void @s_shl_inline_high_imm_f32_4_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
1986 ; SI-LABEL: s_shl_inline_high_imm_f32_4_0_i64:
1988 ; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
1989 ; SI-NEXT: s_load_dword s2, s[0:1], 0xd
1990 ; SI-NEXT: s_mov_b32 s0, 0
1991 ; SI-NEXT: s_mov_b32 s1, 4.0
1992 ; SI-NEXT: s_mov_b32 s7, 0xf000
1993 ; SI-NEXT: s_mov_b32 s6, -1
1994 ; SI-NEXT: s_waitcnt lgkmcnt(0)
1995 ; SI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
1996 ; SI-NEXT: v_mov_b32_e32 v0, s0
1997 ; SI-NEXT: v_mov_b32_e32 v1, s1
1998 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
2001 ; VI-LABEL: s_shl_inline_high_imm_f32_4_0_i64:
2003 ; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
2004 ; VI-NEXT: s_load_dword s2, s[0:1], 0x34
2005 ; VI-NEXT: s_mov_b32 s0, 0
2006 ; VI-NEXT: s_mov_b32 s1, 4.0
2007 ; VI-NEXT: s_mov_b32 s7, 0xf000
2008 ; VI-NEXT: s_mov_b32 s6, -1
2009 ; VI-NEXT: s_waitcnt lgkmcnt(0)
2010 ; VI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
2011 ; VI-NEXT: v_mov_b32_e32 v0, s0
2012 ; VI-NEXT: v_mov_b32_e32 v1, s1
2013 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
2016 ; EG-LABEL: s_shl_inline_high_imm_f32_4_0_i64:
2018 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
2019 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
2022 ; EG-NEXT: ALU clause starting at 4:
2023 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
2024 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
2025 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
2026 ; EG-NEXT: 541065216(1.626303e-19), 32(4.484155e-44)
2027 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
2028 ; EG-NEXT: MOV T0.X, 0.0,
2029 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
2030 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2031 %shl = shl i64 4647714815446351872, %a
2032 store i64 %shl, ptr addrspace(1) %out, align 8
2036 define amdgpu_kernel void @s_shl_inline_high_imm_f32_neg_4_0_i64(ptr addrspace(1) %out, ptr addrspace(1) %aptr, i64 %a) {
2037 ; SI-LABEL: s_shl_inline_high_imm_f32_neg_4_0_i64:
2039 ; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
2040 ; SI-NEXT: s_load_dword s2, s[0:1], 0xd
2041 ; SI-NEXT: s_mov_b32 s0, 0
2042 ; SI-NEXT: s_mov_b32 s1, -4.0
2043 ; SI-NEXT: s_mov_b32 s7, 0xf000
2044 ; SI-NEXT: s_mov_b32 s6, -1
2045 ; SI-NEXT: s_waitcnt lgkmcnt(0)
2046 ; SI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
2047 ; SI-NEXT: v_mov_b32_e32 v0, s0
2048 ; SI-NEXT: v_mov_b32_e32 v1, s1
2049 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
2052 ; VI-LABEL: s_shl_inline_high_imm_f32_neg_4_0_i64:
2054 ; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
2055 ; VI-NEXT: s_load_dword s2, s[0:1], 0x34
2056 ; VI-NEXT: s_mov_b32 s0, 0
2057 ; VI-NEXT: s_mov_b32 s1, -4.0
2058 ; VI-NEXT: s_mov_b32 s7, 0xf000
2059 ; VI-NEXT: s_mov_b32 s6, -1
2060 ; VI-NEXT: s_waitcnt lgkmcnt(0)
2061 ; VI-NEXT: s_lshl_b64 s[0:1], s[0:1], s2
2062 ; VI-NEXT: v_mov_b32_e32 v0, s0
2063 ; VI-NEXT: v_mov_b32_e32 v1, s1
2064 ; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
2067 ; EG-LABEL: s_shl_inline_high_imm_f32_neg_4_0_i64:
2069 ; EG-NEXT: ALU 7, @4, KC0[CB0:0-32], KC1[]
2070 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
2073 ; EG-NEXT: ALU clause starting at 4:
2074 ; EG-NEXT: NOT_INT * T0.W, KC0[2].W,
2075 ; EG-NEXT: BIT_ALIGN_INT T0.W, literal.x, 0.0, PV.W,
2076 ; EG-NEXT: AND_INT * T1.W, KC0[2].W, literal.y,
2077 ; EG-NEXT: 1614807040(5.534023e+19), 32(4.484155e-44)
2078 ; EG-NEXT: CNDE_INT * T0.Y, PS, PV.W, 0.0,
2079 ; EG-NEXT: MOV T0.X, 0.0,
2080 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
2081 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2082 %shl = shl i64 13871086852301127680, %a
2083 store i64 %shl, ptr addrspace(1) %out, align 8
2087 define amdgpu_kernel void @test_mul2(i32 %p) {
2088 ; SI-LABEL: test_mul2:
2090 ; SI-NEXT: s_load_dword s0, s[0:1], 0x9
2091 ; SI-NEXT: s_mov_b32 s3, 0xf000
2092 ; SI-NEXT: s_mov_b32 s2, -1
2093 ; SI-NEXT: s_waitcnt lgkmcnt(0)
2094 ; SI-NEXT: s_lshl_b32 s0, s0, 1
2095 ; SI-NEXT: v_mov_b32_e32 v0, s0
2096 ; SI-NEXT: buffer_store_dword v0, off, s[0:3], 0
2097 ; SI-NEXT: s_waitcnt vmcnt(0)
2100 ; VI-LABEL: test_mul2:
2102 ; VI-NEXT: s_load_dword s0, s[0:1], 0x24
2103 ; VI-NEXT: s_mov_b32 s3, 0xf000
2104 ; VI-NEXT: s_mov_b32 s2, -1
2105 ; VI-NEXT: s_waitcnt lgkmcnt(0)
2106 ; VI-NEXT: s_lshl_b32 s0, s0, 1
2107 ; VI-NEXT: v_mov_b32_e32 v0, s0
2108 ; VI-NEXT: buffer_store_dword v0, off, s[0:3], 0
2109 ; VI-NEXT: s_waitcnt vmcnt(0)
2112 ; EG-LABEL: test_mul2:
2114 ; EG-NEXT: ALU 2, @4, KC0[CB0:0-32], KC1[]
2115 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.X, T0.X, 1
2118 ; EG-NEXT: ALU clause starting at 4:
2119 ; EG-NEXT: MOV T0.X, literal.x,
2120 ; EG-NEXT: LSHL * T1.X, KC0[2].Y, 1,
2121 ; EG-NEXT: 0(0.000000e+00), 0(0.000000e+00)
2123 store volatile i32 %i, ptr addrspace(1) undef
2127 define void @shl_or_k(ptr addrspace(1) %out, i32 %in) {
2128 ; SI-LABEL: shl_or_k:
2130 ; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2131 ; SI-NEXT: s_mov_b32 s6, 0
2132 ; SI-NEXT: v_lshlrev_b32_e32 v2, 2, v2
2133 ; SI-NEXT: s_mov_b32 s7, 0xf000
2134 ; SI-NEXT: s_mov_b32 s4, s6
2135 ; SI-NEXT: s_mov_b32 s5, s6
2136 ; SI-NEXT: v_or_b32_e32 v2, 4, v2
2137 ; SI-NEXT: buffer_store_dword v2, v[0:1], s[4:7], 0 addr64
2138 ; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)
2139 ; SI-NEXT: s_setpc_b64 s[30:31]
2141 ; VI-LABEL: shl_or_k:
2143 ; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2144 ; VI-NEXT: v_lshlrev_b32_e32 v2, 2, v2
2145 ; VI-NEXT: v_or_b32_e32 v2, 4, v2
2146 ; VI-NEXT: flat_store_dword v[0:1], v2
2147 ; VI-NEXT: s_waitcnt vmcnt(0)
2148 ; VI-NEXT: s_setpc_b64 s[30:31]
2150 ; EG-LABEL: shl_or_k:
2152 ; EG-NEXT: ALU 4, @4, KC0[CB0:0-32], KC1[]
2153 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
2156 ; EG-NEXT: ALU clause starting at 4:
2157 ; EG-NEXT: LSHL * T0.W, KC0[2].Z, literal.x,
2158 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2159 ; EG-NEXT: OR_INT T0.X, PV.W, literal.x,
2160 ; EG-NEXT: LSHR * T1.X, KC0[2].Y, literal.y,
2161 ; EG-NEXT: 4(5.605194e-45), 2(2.802597e-45)
2162 %tmp0 = or i32 %in, 1
2163 %tmp2 = shl i32 %tmp0, 2
2164 store i32 %tmp2, ptr addrspace(1) %out
2168 define void @shl_or_k_two_uses(ptr addrspace(1) %out0, ptr addrspace(1) %out1, i32 %in) {
2169 ; SI-LABEL: shl_or_k_two_uses:
2171 ; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2172 ; SI-NEXT: s_mov_b32 s6, 0
2173 ; SI-NEXT: v_or_b32_e32 v4, 1, v4
2174 ; SI-NEXT: s_mov_b32 s7, 0xf000
2175 ; SI-NEXT: s_mov_b32 s4, s6
2176 ; SI-NEXT: s_mov_b32 s5, s6
2177 ; SI-NEXT: v_lshlrev_b32_e32 v5, 2, v4
2178 ; SI-NEXT: buffer_store_dword v5, v[0:1], s[4:7], 0 addr64
2179 ; SI-NEXT: buffer_store_dword v4, v[2:3], s[4:7], 0 addr64
2180 ; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)
2181 ; SI-NEXT: s_setpc_b64 s[30:31]
2183 ; VI-LABEL: shl_or_k_two_uses:
2185 ; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2186 ; VI-NEXT: v_or_b32_e32 v4, 1, v4
2187 ; VI-NEXT: v_lshlrev_b32_e32 v5, 2, v4
2188 ; VI-NEXT: flat_store_dword v[0:1], v5
2189 ; VI-NEXT: flat_store_dword v[2:3], v4
2190 ; VI-NEXT: s_waitcnt vmcnt(0)
2191 ; VI-NEXT: s_setpc_b64 s[30:31]
2193 ; EG-LABEL: shl_or_k_two_uses:
2195 ; EG-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
2196 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T2.X, T3.X, 0
2197 ; EG-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.X, T0.X, 1
2199 ; EG-NEXT: ALU clause starting at 4:
2200 ; EG-NEXT: LSHR T0.X, KC0[2].Z, literal.x,
2201 ; EG-NEXT: OR_INT * T1.X, KC0[2].W, 1,
2202 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2203 ; EG-NEXT: LSHL T2.X, PS, literal.x,
2204 ; EG-NEXT: LSHR * T3.X, KC0[2].Y, literal.x,
2205 ; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00)
2206 %tmp0 = or i32 %in, 1
2207 %tmp2 = shl i32 %tmp0, 2
2208 store i32 %tmp2, ptr addrspace(1) %out0
2209 store i32 %tmp0, ptr addrspace(1) %out1
2213 attributes #0 = { nounwind readnone }