1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -march=amdgcn -mcpu=tahiti -verify-machineinstrs | FileCheck %s --check-prefix=SI
3 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s --check-prefix=VI
4 ; RUN: llc < %s -march=amdgcn -mcpu=gfx900 -verify-machineinstrs | FileCheck %s --check-prefix=GFX9
5 ; RUN: llc < %s -march=r600 -mcpu=redwood -verify-machineinstrs | FileCheck %s --check-prefix=R600
6 ; RUN: llc < %s -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs | FileCheck %s --check-prefix=GFX10
7 ; RUN: llc < %s -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs | FileCheck %s --check-prefix=GFX11
9 declare i32 @llvm.fshl.i32(i32, i32, i32) nounwind readnone
10 declare <2 x i32> @llvm.fshl.v2i32(<2 x i32>, <2 x i32>, <2 x i32>) nounwind readnone
11 declare <4 x i32> @llvm.fshl.v4i32(<4 x i32>, <4 x i32>, <4 x i32>) nounwind readnone
13 define amdgpu_kernel void @fshl_i32(ptr addrspace(1) %in, i32 %x, i32 %y, i32 %z) {
15 ; SI: ; %bb.0: ; %entry
16 ; SI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
17 ; SI-NEXT: s_load_dword s8, s[0:1], 0xd
18 ; SI-NEXT: s_mov_b32 s3, 0xf000
19 ; SI-NEXT: s_mov_b32 s2, -1
20 ; SI-NEXT: s_waitcnt lgkmcnt(0)
21 ; SI-NEXT: s_mov_b32 s1, s5
22 ; SI-NEXT: v_mov_b32_e32 v0, s7
23 ; SI-NEXT: s_not_b32 s5, s8
24 ; SI-NEXT: s_mov_b32 s0, s4
25 ; SI-NEXT: v_alignbit_b32 v0, s6, v0, 1
26 ; SI-NEXT: s_lshr_b32 s4, s6, 1
27 ; SI-NEXT: v_mov_b32_e32 v1, s5
28 ; SI-NEXT: v_alignbit_b32 v0, s4, v0, v1
29 ; SI-NEXT: buffer_store_dword v0, off, s[0:3], 0
33 ; VI: ; %bb.0: ; %entry
34 ; VI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
35 ; VI-NEXT: s_load_dword s0, s[0:1], 0x34
36 ; VI-NEXT: s_waitcnt lgkmcnt(0)
37 ; VI-NEXT: v_mov_b32_e32 v0, s7
38 ; VI-NEXT: s_not_b32 s0, s0
39 ; VI-NEXT: s_lshr_b32 s1, s6, 1
40 ; VI-NEXT: v_alignbit_b32 v0, s6, v0, 1
41 ; VI-NEXT: v_mov_b32_e32 v1, s0
42 ; VI-NEXT: v_alignbit_b32 v2, s1, v0, v1
43 ; VI-NEXT: v_mov_b32_e32 v0, s4
44 ; VI-NEXT: v_mov_b32_e32 v1, s5
45 ; VI-NEXT: flat_store_dword v[0:1], v2
48 ; GFX9-LABEL: fshl_i32:
49 ; GFX9: ; %bb.0: ; %entry
50 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
51 ; GFX9-NEXT: s_load_dword s2, s[0:1], 0x34
52 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
53 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
54 ; GFX9-NEXT: v_mov_b32_e32 v1, s7
55 ; GFX9-NEXT: s_not_b32 s1, s2
56 ; GFX9-NEXT: s_lshr_b32 s0, s6, 1
57 ; GFX9-NEXT: v_alignbit_b32 v1, s6, v1, 1
58 ; GFX9-NEXT: v_mov_b32_e32 v2, s1
59 ; GFX9-NEXT: v_alignbit_b32 v1, s0, v1, v2
60 ; GFX9-NEXT: global_store_dword v0, v1, s[4:5]
63 ; R600-LABEL: fshl_i32:
64 ; R600: ; %bb.0: ; %entry
65 ; R600-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
66 ; R600-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
69 ; R600-NEXT: ALU clause starting at 4:
70 ; R600-NEXT: LSHR T0.Z, KC0[2].Z, 1,
71 ; R600-NEXT: BIT_ALIGN_INT T0.W, KC0[2].Z, KC0[2].W, 1,
72 ; R600-NEXT: NOT_INT * T1.W, KC0[3].X,
73 ; R600-NEXT: BIT_ALIGN_INT T0.X, PV.Z, PV.W, PS,
74 ; R600-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
75 ; R600-NEXT: 2(2.802597e-45), 0(0.000000e+00)
77 ; GFX10-LABEL: fshl_i32:
78 ; GFX10: ; %bb.0: ; %entry
79 ; GFX10-NEXT: s_clause 0x1
80 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
81 ; GFX10-NEXT: s_load_dword s2, s[0:1], 0x34
82 ; GFX10-NEXT: v_mov_b32_e32 v1, 0
83 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
84 ; GFX10-NEXT: v_alignbit_b32 v0, s6, s7, 1
85 ; GFX10-NEXT: s_lshr_b32 s0, s6, 1
86 ; GFX10-NEXT: s_not_b32 s1, s2
87 ; GFX10-NEXT: v_alignbit_b32 v0, s0, v0, s1
88 ; GFX10-NEXT: global_store_dword v1, v0, s[4:5]
89 ; GFX10-NEXT: s_endpgm
91 ; GFX11-LABEL: fshl_i32:
92 ; GFX11: ; %bb.0: ; %entry
93 ; GFX11-NEXT: s_clause 0x1
94 ; GFX11-NEXT: s_load_b128 s[4:7], s[0:1], 0x24
95 ; GFX11-NEXT: s_load_b32 s0, s[0:1], 0x34
96 ; GFX11-NEXT: v_mov_b32_e32 v1, 0
97 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
98 ; GFX11-NEXT: v_alignbit_b32 v0, s6, s7, 1
99 ; GFX11-NEXT: s_lshr_b32 s1, s6, 1
100 ; GFX11-NEXT: s_not_b32 s0, s0
101 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
102 ; GFX11-NEXT: v_alignbit_b32 v0, s1, v0, s0
103 ; GFX11-NEXT: global_store_b32 v1, v0, s[4:5]
104 ; GFX11-NEXT: s_nop 0
105 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
106 ; GFX11-NEXT: s_endpgm
108 %0 = call i32 @llvm.fshl.i32(i32 %x, i32 %y, i32 %z)
109 store i32 %0, ptr addrspace(1) %in
113 define amdgpu_kernel void @fshl_i32_imm(ptr addrspace(1) %in, i32 %x, i32 %y) {
114 ; SI-LABEL: fshl_i32_imm:
115 ; SI: ; %bb.0: ; %entry
116 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
117 ; SI-NEXT: s_mov_b32 s7, 0xf000
118 ; SI-NEXT: s_mov_b32 s6, -1
119 ; SI-NEXT: s_waitcnt lgkmcnt(0)
120 ; SI-NEXT: v_mov_b32_e32 v0, s3
121 ; SI-NEXT: s_mov_b32 s4, s0
122 ; SI-NEXT: s_mov_b32 s5, s1
123 ; SI-NEXT: v_alignbit_b32 v0, s2, v0, 25
124 ; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
127 ; VI-LABEL: fshl_i32_imm:
128 ; VI: ; %bb.0: ; %entry
129 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
130 ; VI-NEXT: s_waitcnt lgkmcnt(0)
131 ; VI-NEXT: v_mov_b32_e32 v0, s3
132 ; VI-NEXT: v_alignbit_b32 v2, s2, v0, 25
133 ; VI-NEXT: v_mov_b32_e32 v0, s0
134 ; VI-NEXT: v_mov_b32_e32 v1, s1
135 ; VI-NEXT: flat_store_dword v[0:1], v2
138 ; GFX9-LABEL: fshl_i32_imm:
139 ; GFX9: ; %bb.0: ; %entry
140 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
141 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
142 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
143 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
144 ; GFX9-NEXT: v_alignbit_b32 v1, s2, v1, 25
145 ; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
146 ; GFX9-NEXT: s_endpgm
148 ; R600-LABEL: fshl_i32_imm:
149 ; R600: ; %bb.0: ; %entry
150 ; R600-NEXT: ALU 3, @4, KC0[CB0:0-32], KC1[]
151 ; R600-NEXT: MEM_RAT_CACHELESS STORE_RAW T1.X, T0.X, 1
154 ; R600-NEXT: ALU clause starting at 4:
155 ; R600-NEXT: LSHR * T0.X, KC0[2].Y, literal.x,
156 ; R600-NEXT: 2(2.802597e-45), 0(0.000000e+00)
157 ; R600-NEXT: BIT_ALIGN_INT * T1.X, KC0[2].Z, KC0[2].W, literal.x,
158 ; R600-NEXT: 25(3.503246e-44), 0(0.000000e+00)
160 ; GFX10-LABEL: fshl_i32_imm:
161 ; GFX10: ; %bb.0: ; %entry
162 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
163 ; GFX10-NEXT: v_mov_b32_e32 v0, 0
164 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
165 ; GFX10-NEXT: v_alignbit_b32 v1, s2, s3, 25
166 ; GFX10-NEXT: global_store_dword v0, v1, s[0:1]
167 ; GFX10-NEXT: s_endpgm
169 ; GFX11-LABEL: fshl_i32_imm:
170 ; GFX11: ; %bb.0: ; %entry
171 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
172 ; GFX11-NEXT: v_mov_b32_e32 v0, 0
173 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
174 ; GFX11-NEXT: v_alignbit_b32 v1, s2, s3, 25
175 ; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
176 ; GFX11-NEXT: s_nop 0
177 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
178 ; GFX11-NEXT: s_endpgm
180 %0 = call i32 @llvm.fshl.i32(i32 %x, i32 %y, i32 7)
181 store i32 %0, ptr addrspace(1) %in
185 define amdgpu_kernel void @fshl_v2i32(ptr addrspace(1) %in, <2 x i32> %x, <2 x i32> %y, <2 x i32> %z) {
186 ; SI-LABEL: fshl_v2i32:
187 ; SI: ; %bb.0: ; %entry
188 ; SI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0xb
189 ; SI-NEXT: s_load_dwordx2 s[8:9], s[0:1], 0x9
190 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xf
191 ; SI-NEXT: s_mov_b32 s11, 0xf000
192 ; SI-NEXT: s_mov_b32 s10, -1
193 ; SI-NEXT: s_waitcnt lgkmcnt(0)
194 ; SI-NEXT: v_mov_b32_e32 v0, s7
195 ; SI-NEXT: v_alignbit_b32 v0, s5, v0, 1
196 ; SI-NEXT: s_not_b32 s1, s1
197 ; SI-NEXT: s_lshr_b32 s2, s5, 1
198 ; SI-NEXT: v_mov_b32_e32 v1, s1
199 ; SI-NEXT: v_alignbit_b32 v1, s2, v0, v1
200 ; SI-NEXT: v_mov_b32_e32 v0, s6
201 ; SI-NEXT: s_not_b32 s0, s0
202 ; SI-NEXT: v_alignbit_b32 v0, s4, v0, 1
203 ; SI-NEXT: s_lshr_b32 s1, s4, 1
204 ; SI-NEXT: v_mov_b32_e32 v2, s0
205 ; SI-NEXT: v_alignbit_b32 v0, s1, v0, v2
206 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[8:11], 0
209 ; VI-LABEL: fshl_v2i32:
210 ; VI: ; %bb.0: ; %entry
211 ; VI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
212 ; VI-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x3c
213 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
214 ; VI-NEXT: s_waitcnt lgkmcnt(0)
215 ; VI-NEXT: v_mov_b32_e32 v0, s7
216 ; VI-NEXT: s_not_b32 s3, s3
217 ; VI-NEXT: s_lshr_b32 s7, s5, 1
218 ; VI-NEXT: v_alignbit_b32 v0, s5, v0, 1
219 ; VI-NEXT: v_mov_b32_e32 v1, s3
220 ; VI-NEXT: v_alignbit_b32 v1, s7, v0, v1
221 ; VI-NEXT: v_mov_b32_e32 v0, s6
222 ; VI-NEXT: s_not_b32 s2, s2
223 ; VI-NEXT: v_alignbit_b32 v0, s4, v0, 1
224 ; VI-NEXT: s_lshr_b32 s3, s4, 1
225 ; VI-NEXT: v_mov_b32_e32 v2, s2
226 ; VI-NEXT: v_alignbit_b32 v0, s3, v0, v2
227 ; VI-NEXT: v_mov_b32_e32 v3, s1
228 ; VI-NEXT: v_mov_b32_e32 v2, s0
229 ; VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
232 ; GFX9-LABEL: fshl_v2i32:
233 ; GFX9: ; %bb.0: ; %entry
234 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
235 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
236 ; GFX9-NEXT: s_load_dwordx2 s[8:9], s[0:1], 0x3c
237 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
238 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
239 ; GFX9-NEXT: v_mov_b32_e32 v0, s7
240 ; GFX9-NEXT: s_lshr_b32 s0, s5, 1
241 ; GFX9-NEXT: s_not_b32 s1, s9
242 ; GFX9-NEXT: v_alignbit_b32 v0, s5, v0, 1
243 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
244 ; GFX9-NEXT: v_alignbit_b32 v1, s0, v0, v1
245 ; GFX9-NEXT: v_mov_b32_e32 v0, s6
246 ; GFX9-NEXT: s_not_b32 s1, s8
247 ; GFX9-NEXT: v_alignbit_b32 v0, s4, v0, 1
248 ; GFX9-NEXT: s_lshr_b32 s0, s4, 1
249 ; GFX9-NEXT: v_mov_b32_e32 v3, s1
250 ; GFX9-NEXT: v_alignbit_b32 v0, s0, v0, v3
251 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
252 ; GFX9-NEXT: s_endpgm
254 ; R600-LABEL: fshl_v2i32:
255 ; R600: ; %bb.0: ; %entry
256 ; R600-NEXT: ALU 9, @4, KC0[CB0:0-32], KC1[]
257 ; R600-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
260 ; R600-NEXT: ALU clause starting at 4:
261 ; R600-NEXT: LSHR T0.Z, KC0[3].X, 1,
262 ; R600-NEXT: BIT_ALIGN_INT * T0.W, KC0[3].X, KC0[3].Z, 1,
263 ; R600-NEXT: NOT_INT * T1.W, KC0[4].X,
264 ; R600-NEXT: BIT_ALIGN_INT T0.Y, T0.Z, T0.W, PV.W,
265 ; R600-NEXT: LSHR T0.Z, KC0[2].W, 1,
266 ; R600-NEXT: BIT_ALIGN_INT * T0.W, KC0[2].W, KC0[3].Y, 1,
267 ; R600-NEXT: NOT_INT * T1.W, KC0[3].W,
268 ; R600-NEXT: BIT_ALIGN_INT T0.X, T0.Z, T0.W, PV.W,
269 ; R600-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
270 ; R600-NEXT: 2(2.802597e-45), 0(0.000000e+00)
272 ; GFX10-LABEL: fshl_v2i32:
273 ; GFX10: ; %bb.0: ; %entry
274 ; GFX10-NEXT: s_clause 0x2
275 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
276 ; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x3c
277 ; GFX10-NEXT: s_load_dwordx2 s[8:9], s[0:1], 0x24
278 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
279 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
280 ; GFX10-NEXT: v_alignbit_b32 v0, s5, s7, 1
281 ; GFX10-NEXT: v_alignbit_b32 v3, s4, s6, 1
282 ; GFX10-NEXT: s_lshr_b32 s0, s5, 1
283 ; GFX10-NEXT: s_not_b32 s1, s3
284 ; GFX10-NEXT: s_lshr_b32 s3, s4, 1
285 ; GFX10-NEXT: s_not_b32 s2, s2
286 ; GFX10-NEXT: v_alignbit_b32 v1, s0, v0, s1
287 ; GFX10-NEXT: v_alignbit_b32 v0, s3, v3, s2
288 ; GFX10-NEXT: global_store_dwordx2 v2, v[0:1], s[8:9]
289 ; GFX10-NEXT: s_endpgm
291 ; GFX11-LABEL: fshl_v2i32:
292 ; GFX11: ; %bb.0: ; %entry
293 ; GFX11-NEXT: s_clause 0x2
294 ; GFX11-NEXT: s_load_b128 s[4:7], s[0:1], 0x2c
295 ; GFX11-NEXT: s_load_b64 s[2:3], s[0:1], 0x3c
296 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
297 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
298 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
299 ; GFX11-NEXT: v_alignbit_b32 v0, s5, s7, 1
300 ; GFX11-NEXT: v_alignbit_b32 v3, s4, s6, 1
301 ; GFX11-NEXT: s_lshr_b32 s5, s5, 1
302 ; GFX11-NEXT: s_not_b32 s3, s3
303 ; GFX11-NEXT: s_lshr_b32 s4, s4, 1
304 ; GFX11-NEXT: s_not_b32 s2, s2
305 ; GFX11-NEXT: v_alignbit_b32 v1, s5, v0, s3
306 ; GFX11-NEXT: v_alignbit_b32 v0, s4, v3, s2
307 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
308 ; GFX11-NEXT: s_nop 0
309 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
310 ; GFX11-NEXT: s_endpgm
312 %0 = call <2 x i32> @llvm.fshl.v2i32(<2 x i32> %x, <2 x i32> %y, <2 x i32> %z)
313 store <2 x i32> %0, ptr addrspace(1) %in
317 define amdgpu_kernel void @fshl_v2i32_imm(ptr addrspace(1) %in, <2 x i32> %x, <2 x i32> %y) {
318 ; SI-LABEL: fshl_v2i32_imm:
319 ; SI: ; %bb.0: ; %entry
320 ; SI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0xb
321 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
322 ; SI-NEXT: s_mov_b32 s3, 0xf000
323 ; SI-NEXT: s_mov_b32 s2, -1
324 ; SI-NEXT: s_waitcnt lgkmcnt(0)
325 ; SI-NEXT: v_mov_b32_e32 v0, s7
326 ; SI-NEXT: v_mov_b32_e32 v2, s6
327 ; SI-NEXT: v_alignbit_b32 v1, s5, v0, 23
328 ; SI-NEXT: v_alignbit_b32 v0, s4, v2, 25
329 ; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
332 ; VI-LABEL: fshl_v2i32_imm:
333 ; VI: ; %bb.0: ; %entry
334 ; VI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
335 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
336 ; VI-NEXT: s_waitcnt lgkmcnt(0)
337 ; VI-NEXT: v_mov_b32_e32 v0, s7
338 ; VI-NEXT: v_mov_b32_e32 v2, s6
339 ; VI-NEXT: v_alignbit_b32 v1, s5, v0, 23
340 ; VI-NEXT: v_alignbit_b32 v0, s4, v2, 25
341 ; VI-NEXT: v_mov_b32_e32 v3, s1
342 ; VI-NEXT: v_mov_b32_e32 v2, s0
343 ; VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
346 ; GFX9-LABEL: fshl_v2i32_imm:
347 ; GFX9: ; %bb.0: ; %entry
348 ; GFX9-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
349 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
350 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
351 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
352 ; GFX9-NEXT: v_mov_b32_e32 v0, s7
353 ; GFX9-NEXT: v_mov_b32_e32 v3, s6
354 ; GFX9-NEXT: v_alignbit_b32 v1, s5, v0, 23
355 ; GFX9-NEXT: v_alignbit_b32 v0, s4, v3, 25
356 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
357 ; GFX9-NEXT: s_endpgm
359 ; R600-LABEL: fshl_v2i32_imm:
360 ; R600: ; %bb.0: ; %entry
361 ; R600-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
362 ; R600-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XY, T1.X, 1
365 ; R600-NEXT: ALU clause starting at 4:
366 ; R600-NEXT: BIT_ALIGN_INT * T0.Y, KC0[3].X, KC0[3].Z, literal.x,
367 ; R600-NEXT: 23(3.222986e-44), 0(0.000000e+00)
368 ; R600-NEXT: BIT_ALIGN_INT * T0.X, KC0[2].W, KC0[3].Y, literal.x,
369 ; R600-NEXT: 25(3.503246e-44), 0(0.000000e+00)
370 ; R600-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
371 ; R600-NEXT: 2(2.802597e-45), 0(0.000000e+00)
373 ; GFX10-LABEL: fshl_v2i32_imm:
374 ; GFX10: ; %bb.0: ; %entry
375 ; GFX10-NEXT: s_clause 0x1
376 ; GFX10-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x2c
377 ; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
378 ; GFX10-NEXT: v_mov_b32_e32 v2, 0
379 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
380 ; GFX10-NEXT: v_alignbit_b32 v1, s5, s7, 23
381 ; GFX10-NEXT: v_alignbit_b32 v0, s4, s6, 25
382 ; GFX10-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
383 ; GFX10-NEXT: s_endpgm
385 ; GFX11-LABEL: fshl_v2i32_imm:
386 ; GFX11: ; %bb.0: ; %entry
387 ; GFX11-NEXT: s_clause 0x1
388 ; GFX11-NEXT: s_load_b128 s[4:7], s[0:1], 0x2c
389 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
390 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
391 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
392 ; GFX11-NEXT: v_alignbit_b32 v1, s5, s7, 23
393 ; GFX11-NEXT: v_alignbit_b32 v0, s4, s6, 25
394 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
395 ; GFX11-NEXT: s_nop 0
396 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
397 ; GFX11-NEXT: s_endpgm
399 %0 = call <2 x i32> @llvm.fshl.v2i32(<2 x i32> %x, <2 x i32> %y, <2 x i32> <i32 7, i32 9>)
400 store <2 x i32> %0, ptr addrspace(1) %in
404 define amdgpu_kernel void @fshl_v4i32(ptr addrspace(1) %in, <4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
405 ; SI-LABEL: fshl_v4i32:
406 ; SI: ; %bb.0: ; %entry
407 ; SI-NEXT: s_load_dwordx8 s[4:11], s[0:1], 0xd
408 ; SI-NEXT: s_load_dwordx4 s[12:15], s[0:1], 0x15
409 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
410 ; SI-NEXT: s_mov_b32 s3, 0xf000
411 ; SI-NEXT: s_mov_b32 s2, -1
412 ; SI-NEXT: s_waitcnt lgkmcnt(0)
413 ; SI-NEXT: v_mov_b32_e32 v0, s11
414 ; SI-NEXT: s_not_b32 s11, s15
415 ; SI-NEXT: v_alignbit_b32 v0, s7, v0, 1
416 ; SI-NEXT: s_lshr_b32 s7, s7, 1
417 ; SI-NEXT: v_mov_b32_e32 v1, s11
418 ; SI-NEXT: v_alignbit_b32 v3, s7, v0, v1
419 ; SI-NEXT: v_mov_b32_e32 v0, s10
420 ; SI-NEXT: s_not_b32 s7, s14
421 ; SI-NEXT: v_alignbit_b32 v0, s6, v0, 1
422 ; SI-NEXT: s_lshr_b32 s6, s6, 1
423 ; SI-NEXT: v_mov_b32_e32 v1, s7
424 ; SI-NEXT: v_alignbit_b32 v2, s6, v0, v1
425 ; SI-NEXT: v_mov_b32_e32 v0, s9
426 ; SI-NEXT: s_not_b32 s6, s13
427 ; SI-NEXT: v_alignbit_b32 v0, s5, v0, 1
428 ; SI-NEXT: s_lshr_b32 s5, s5, 1
429 ; SI-NEXT: v_mov_b32_e32 v1, s6
430 ; SI-NEXT: v_alignbit_b32 v1, s5, v0, v1
431 ; SI-NEXT: v_mov_b32_e32 v0, s8
432 ; SI-NEXT: s_not_b32 s5, s12
433 ; SI-NEXT: v_alignbit_b32 v0, s4, v0, 1
434 ; SI-NEXT: s_lshr_b32 s4, s4, 1
435 ; SI-NEXT: v_mov_b32_e32 v4, s5
436 ; SI-NEXT: v_alignbit_b32 v0, s4, v0, v4
437 ; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[0:3], 0
440 ; VI-LABEL: fshl_v4i32:
441 ; VI: ; %bb.0: ; %entry
442 ; VI-NEXT: s_load_dwordx8 s[4:11], s[0:1], 0x34
443 ; VI-NEXT: s_load_dwordx4 s[12:15], s[0:1], 0x54
444 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
445 ; VI-NEXT: s_waitcnt lgkmcnt(0)
446 ; VI-NEXT: v_mov_b32_e32 v0, s11
447 ; VI-NEXT: s_not_b32 s3, s15
448 ; VI-NEXT: s_lshr_b32 s2, s7, 1
449 ; VI-NEXT: v_alignbit_b32 v0, s7, v0, 1
450 ; VI-NEXT: v_mov_b32_e32 v1, s3
451 ; VI-NEXT: v_alignbit_b32 v3, s2, v0, v1
452 ; VI-NEXT: v_mov_b32_e32 v0, s10
453 ; VI-NEXT: s_not_b32 s3, s14
454 ; VI-NEXT: v_alignbit_b32 v0, s6, v0, 1
455 ; VI-NEXT: s_lshr_b32 s2, s6, 1
456 ; VI-NEXT: v_mov_b32_e32 v1, s3
457 ; VI-NEXT: v_alignbit_b32 v2, s2, v0, v1
458 ; VI-NEXT: v_mov_b32_e32 v0, s9
459 ; VI-NEXT: s_not_b32 s3, s13
460 ; VI-NEXT: v_alignbit_b32 v0, s5, v0, 1
461 ; VI-NEXT: s_lshr_b32 s2, s5, 1
462 ; VI-NEXT: v_mov_b32_e32 v1, s3
463 ; VI-NEXT: v_alignbit_b32 v1, s2, v0, v1
464 ; VI-NEXT: v_mov_b32_e32 v0, s8
465 ; VI-NEXT: s_not_b32 s3, s12
466 ; VI-NEXT: v_alignbit_b32 v0, s4, v0, 1
467 ; VI-NEXT: s_lshr_b32 s2, s4, 1
468 ; VI-NEXT: v_mov_b32_e32 v4, s3
469 ; VI-NEXT: v_alignbit_b32 v0, s2, v0, v4
470 ; VI-NEXT: v_mov_b32_e32 v5, s1
471 ; VI-NEXT: v_mov_b32_e32 v4, s0
472 ; VI-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
475 ; GFX9-LABEL: fshl_v4i32:
476 ; GFX9: ; %bb.0: ; %entry
477 ; GFX9-NEXT: s_load_dwordx8 s[4:11], s[0:1], 0x34
478 ; GFX9-NEXT: s_load_dwordx4 s[12:15], s[0:1], 0x54
479 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
480 ; GFX9-NEXT: v_mov_b32_e32 v4, 0
481 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
482 ; GFX9-NEXT: s_not_b32 s1, s15
483 ; GFX9-NEXT: v_mov_b32_e32 v0, s11
484 ; GFX9-NEXT: s_lshr_b32 s0, s7, 1
485 ; GFX9-NEXT: v_alignbit_b32 v0, s7, v0, 1
486 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
487 ; GFX9-NEXT: v_alignbit_b32 v3, s0, v0, v1
488 ; GFX9-NEXT: v_mov_b32_e32 v0, s10
489 ; GFX9-NEXT: s_not_b32 s1, s14
490 ; GFX9-NEXT: v_alignbit_b32 v0, s6, v0, 1
491 ; GFX9-NEXT: s_lshr_b32 s0, s6, 1
492 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
493 ; GFX9-NEXT: v_alignbit_b32 v2, s0, v0, v1
494 ; GFX9-NEXT: v_mov_b32_e32 v0, s9
495 ; GFX9-NEXT: s_not_b32 s1, s13
496 ; GFX9-NEXT: v_alignbit_b32 v0, s5, v0, 1
497 ; GFX9-NEXT: s_lshr_b32 s0, s5, 1
498 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
499 ; GFX9-NEXT: v_alignbit_b32 v1, s0, v0, v1
500 ; GFX9-NEXT: v_mov_b32_e32 v0, s8
501 ; GFX9-NEXT: s_not_b32 s1, s12
502 ; GFX9-NEXT: v_alignbit_b32 v0, s4, v0, 1
503 ; GFX9-NEXT: s_lshr_b32 s0, s4, 1
504 ; GFX9-NEXT: v_mov_b32_e32 v5, s1
505 ; GFX9-NEXT: v_alignbit_b32 v0, s0, v0, v5
506 ; GFX9-NEXT: global_store_dwordx4 v4, v[0:3], s[2:3]
507 ; GFX9-NEXT: s_endpgm
509 ; R600-LABEL: fshl_v4i32:
510 ; R600: ; %bb.0: ; %entry
511 ; R600-NEXT: ALU 17, @4, KC0[CB0:0-32], KC1[]
512 ; R600-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
515 ; R600-NEXT: ALU clause starting at 4:
516 ; R600-NEXT: LSHR T0.Z, KC0[4].X, 1,
517 ; R600-NEXT: BIT_ALIGN_INT * T0.W, KC0[4].X, KC0[5].X, 1,
518 ; R600-NEXT: NOT_INT * T1.W, KC0[6].X,
519 ; R600-NEXT: LSHR T0.Y, KC0[3].W, 1,
520 ; R600-NEXT: BIT_ALIGN_INT T1.Z, KC0[3].W, KC0[4].W, 1,
521 ; R600-NEXT: BIT_ALIGN_INT * T0.W, T0.Z, T0.W, PV.W,
522 ; R600-NEXT: NOT_INT * T1.W, KC0[5].W,
523 ; R600-NEXT: LSHR T1.Y, KC0[3].Z, 1,
524 ; R600-NEXT: BIT_ALIGN_INT T0.Z, T0.Y, T1.Z, PV.W,
525 ; R600-NEXT: BIT_ALIGN_INT * T1.W, KC0[3].Z, KC0[4].Z, 1,
526 ; R600-NEXT: NOT_INT * T2.W, KC0[5].Z,
527 ; R600-NEXT: BIT_ALIGN_INT T0.Y, T1.Y, T1.W, PV.W,
528 ; R600-NEXT: LSHR T1.Z, KC0[3].Y, 1,
529 ; R600-NEXT: BIT_ALIGN_INT * T1.W, KC0[3].Y, KC0[4].Y, 1,
530 ; R600-NEXT: NOT_INT * T2.W, KC0[5].Y,
531 ; R600-NEXT: BIT_ALIGN_INT T0.X, T1.Z, T1.W, PV.W,
532 ; R600-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
533 ; R600-NEXT: 2(2.802597e-45), 0(0.000000e+00)
535 ; GFX10-LABEL: fshl_v4i32:
536 ; GFX10: ; %bb.0: ; %entry
537 ; GFX10-NEXT: s_clause 0x1
538 ; GFX10-NEXT: s_load_dwordx8 s[4:11], s[0:1], 0x34
539 ; GFX10-NEXT: s_load_dwordx4 s[12:15], s[0:1], 0x54
540 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
541 ; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
542 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
543 ; GFX10-NEXT: v_alignbit_b32 v0, s7, s11, 1
544 ; GFX10-NEXT: v_alignbit_b32 v1, s6, s10, 1
545 ; GFX10-NEXT: v_alignbit_b32 v5, s5, s9, 1
546 ; GFX10-NEXT: v_alignbit_b32 v6, s4, s8, 1
547 ; GFX10-NEXT: s_lshr_b32 s2, s7, 1
548 ; GFX10-NEXT: s_not_b32 s3, s15
549 ; GFX10-NEXT: s_lshr_b32 s6, s6, 1
550 ; GFX10-NEXT: s_not_b32 s7, s14
551 ; GFX10-NEXT: s_lshr_b32 s5, s5, 1
552 ; GFX10-NEXT: s_not_b32 s9, s13
553 ; GFX10-NEXT: s_lshr_b32 s4, s4, 1
554 ; GFX10-NEXT: s_not_b32 s8, s12
555 ; GFX10-NEXT: v_alignbit_b32 v3, s2, v0, s3
556 ; GFX10-NEXT: v_alignbit_b32 v2, s6, v1, s7
557 ; GFX10-NEXT: v_alignbit_b32 v1, s5, v5, s9
558 ; GFX10-NEXT: v_alignbit_b32 v0, s4, v6, s8
559 ; GFX10-NEXT: global_store_dwordx4 v4, v[0:3], s[0:1]
560 ; GFX10-NEXT: s_endpgm
562 ; GFX11-LABEL: fshl_v4i32:
563 ; GFX11: ; %bb.0: ; %entry
564 ; GFX11-NEXT: s_clause 0x2
565 ; GFX11-NEXT: s_load_b256 s[4:11], s[0:1], 0x34
566 ; GFX11-NEXT: s_load_b128 s[12:15], s[0:1], 0x54
567 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
568 ; GFX11-NEXT: v_mov_b32_e32 v4, 0
569 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
570 ; GFX11-NEXT: v_alignbit_b32 v0, s7, s11, 1
571 ; GFX11-NEXT: v_alignbit_b32 v1, s6, s10, 1
572 ; GFX11-NEXT: v_alignbit_b32 v5, s5, s9, 1
573 ; GFX11-NEXT: v_alignbit_b32 v6, s4, s8, 1
574 ; GFX11-NEXT: s_lshr_b32 s2, s7, 1
575 ; GFX11-NEXT: s_not_b32 s3, s15
576 ; GFX11-NEXT: s_lshr_b32 s6, s6, 1
577 ; GFX11-NEXT: s_not_b32 s7, s14
578 ; GFX11-NEXT: s_lshr_b32 s5, s5, 1
579 ; GFX11-NEXT: s_not_b32 s9, s13
580 ; GFX11-NEXT: s_lshr_b32 s4, s4, 1
581 ; GFX11-NEXT: s_not_b32 s8, s12
582 ; GFX11-NEXT: v_alignbit_b32 v3, s2, v0, s3
583 ; GFX11-NEXT: v_alignbit_b32 v2, s6, v1, s7
584 ; GFX11-NEXT: v_alignbit_b32 v1, s5, v5, s9
585 ; GFX11-NEXT: v_alignbit_b32 v0, s4, v6, s8
586 ; GFX11-NEXT: global_store_b128 v4, v[0:3], s[0:1]
587 ; GFX11-NEXT: s_nop 0
588 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
589 ; GFX11-NEXT: s_endpgm
591 %0 = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z)
592 store <4 x i32> %0, ptr addrspace(1) %in
596 define amdgpu_kernel void @fshl_v4i32_imm(ptr addrspace(1) %in, <4 x i32> %x, <4 x i32> %y) {
597 ; SI-LABEL: fshl_v4i32_imm:
598 ; SI: ; %bb.0: ; %entry
599 ; SI-NEXT: s_load_dwordx8 s[4:11], s[0:1], 0xd
600 ; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x9
601 ; SI-NEXT: s_mov_b32 s3, 0xf000
602 ; SI-NEXT: s_mov_b32 s2, -1
603 ; SI-NEXT: s_waitcnt lgkmcnt(0)
604 ; SI-NEXT: v_mov_b32_e32 v0, s11
605 ; SI-NEXT: v_mov_b32_e32 v1, s10
606 ; SI-NEXT: v_alignbit_b32 v3, s7, v0, 31
607 ; SI-NEXT: v_mov_b32_e32 v0, s9
608 ; SI-NEXT: v_alignbit_b32 v2, s6, v1, 23
609 ; SI-NEXT: v_alignbit_b32 v1, s5, v0, 25
610 ; SI-NEXT: v_mov_b32_e32 v0, s8
611 ; SI-NEXT: v_alignbit_b32 v0, s4, v0, 31
612 ; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[0:3], 0
615 ; VI-LABEL: fshl_v4i32_imm:
616 ; VI: ; %bb.0: ; %entry
617 ; VI-NEXT: s_load_dwordx8 s[4:11], s[0:1], 0x34
618 ; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
619 ; VI-NEXT: s_waitcnt lgkmcnt(0)
620 ; VI-NEXT: v_mov_b32_e32 v0, s11
621 ; VI-NEXT: v_mov_b32_e32 v1, s10
622 ; VI-NEXT: v_mov_b32_e32 v4, s9
623 ; VI-NEXT: v_alignbit_b32 v3, s7, v0, 31
624 ; VI-NEXT: v_alignbit_b32 v2, s6, v1, 23
625 ; VI-NEXT: v_alignbit_b32 v1, s5, v4, 25
626 ; VI-NEXT: v_mov_b32_e32 v0, s8
627 ; VI-NEXT: v_mov_b32_e32 v5, s1
628 ; VI-NEXT: v_alignbit_b32 v0, s4, v0, 31
629 ; VI-NEXT: v_mov_b32_e32 v4, s0
630 ; VI-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
633 ; GFX9-LABEL: fshl_v4i32_imm:
634 ; GFX9: ; %bb.0: ; %entry
635 ; GFX9-NEXT: s_load_dwordx8 s[4:11], s[0:1], 0x34
636 ; GFX9-NEXT: v_mov_b32_e32 v4, 0
637 ; GFX9-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
638 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
639 ; GFX9-NEXT: v_mov_b32_e32 v0, s11
640 ; GFX9-NEXT: v_mov_b32_e32 v1, s10
641 ; GFX9-NEXT: v_alignbit_b32 v3, s7, v0, 31
642 ; GFX9-NEXT: v_mov_b32_e32 v0, s9
643 ; GFX9-NEXT: v_alignbit_b32 v2, s6, v1, 23
644 ; GFX9-NEXT: v_alignbit_b32 v1, s5, v0, 25
645 ; GFX9-NEXT: v_mov_b32_e32 v0, s8
646 ; GFX9-NEXT: v_alignbit_b32 v0, s4, v0, 31
647 ; GFX9-NEXT: global_store_dwordx4 v4, v[0:3], s[0:1]
648 ; GFX9-NEXT: s_endpgm
650 ; R600-LABEL: fshl_v4i32_imm:
651 ; R600: ; %bb.0: ; %entry
652 ; R600-NEXT: ALU 9, @4, KC0[CB0:0-32], KC1[]
653 ; R600-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.XYZW, T1.X, 1
656 ; R600-NEXT: ALU clause starting at 4:
657 ; R600-NEXT: BIT_ALIGN_INT * T0.W, KC0[4].X, KC0[5].X, literal.x,
658 ; R600-NEXT: 31(4.344025e-44), 0(0.000000e+00)
659 ; R600-NEXT: BIT_ALIGN_INT * T0.Z, KC0[3].W, KC0[4].W, literal.x,
660 ; R600-NEXT: 23(3.222986e-44), 0(0.000000e+00)
661 ; R600-NEXT: BIT_ALIGN_INT * T0.Y, KC0[3].Z, KC0[4].Z, literal.x,
662 ; R600-NEXT: 25(3.503246e-44), 0(0.000000e+00)
663 ; R600-NEXT: BIT_ALIGN_INT * T0.X, KC0[3].Y, KC0[4].Y, literal.x,
664 ; R600-NEXT: 31(4.344025e-44), 0(0.000000e+00)
665 ; R600-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
666 ; R600-NEXT: 2(2.802597e-45), 0(0.000000e+00)
668 ; GFX10-LABEL: fshl_v4i32_imm:
669 ; GFX10: ; %bb.0: ; %entry
670 ; GFX10-NEXT: s_clause 0x1
671 ; GFX10-NEXT: s_load_dwordx8 s[4:11], s[0:1], 0x34
672 ; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
673 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
674 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
675 ; GFX10-NEXT: v_alignbit_b32 v3, s7, s11, 31
676 ; GFX10-NEXT: v_alignbit_b32 v2, s6, s10, 23
677 ; GFX10-NEXT: v_alignbit_b32 v1, s5, s9, 25
678 ; GFX10-NEXT: v_alignbit_b32 v0, s4, s8, 31
679 ; GFX10-NEXT: global_store_dwordx4 v4, v[0:3], s[2:3]
680 ; GFX10-NEXT: s_endpgm
682 ; GFX11-LABEL: fshl_v4i32_imm:
683 ; GFX11: ; %bb.0: ; %entry
684 ; GFX11-NEXT: s_clause 0x1
685 ; GFX11-NEXT: s_load_b256 s[4:11], s[0:1], 0x34
686 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
687 ; GFX11-NEXT: v_mov_b32_e32 v4, 0
688 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
689 ; GFX11-NEXT: v_alignbit_b32 v3, s7, s11, 31
690 ; GFX11-NEXT: v_alignbit_b32 v2, s6, s10, 23
691 ; GFX11-NEXT: v_alignbit_b32 v1, s5, s9, 25
692 ; GFX11-NEXT: v_alignbit_b32 v0, s4, s8, 31
693 ; GFX11-NEXT: global_store_b128 v4, v[0:3], s[0:1]
694 ; GFX11-NEXT: s_nop 0
695 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
696 ; GFX11-NEXT: s_endpgm
698 %0 = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %x, <4 x i32> %y, <4 x i32> <i32 1, i32 7, i32 9, i32 33>)
699 store <4 x i32> %0, ptr addrspace(1) %in
703 ; (a ^ b) | a --> a | b
704 define amdgpu_kernel void @orxor2or1(ptr addrspace(1) %in, i32 %a, i32 %b) {
705 ; SI-LABEL: orxor2or1:
707 ; SI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x9
708 ; SI-NEXT: s_mov_b32 s7, 0xf000
709 ; SI-NEXT: s_mov_b32 s6, -1
710 ; SI-NEXT: s_waitcnt lgkmcnt(0)
711 ; SI-NEXT: s_mov_b32 s4, s0
712 ; SI-NEXT: s_lshl_b32 s0, s2, 7
713 ; SI-NEXT: s_or_b32 s0, s3, s0
714 ; SI-NEXT: s_cmp_eq_u32 s0, 0
715 ; SI-NEXT: s_cselect_b32 s0, s2, s3
716 ; SI-NEXT: s_mov_b32 s5, s1
717 ; SI-NEXT: v_mov_b32_e32 v0, s0
718 ; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
721 ; VI-LABEL: orxor2or1:
723 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
724 ; VI-NEXT: s_waitcnt lgkmcnt(0)
725 ; VI-NEXT: s_lshl_b32 s4, s2, 7
726 ; VI-NEXT: s_or_b32 s4, s3, s4
727 ; VI-NEXT: s_cmp_eq_u32 s4, 0
728 ; VI-NEXT: s_cselect_b32 s2, s2, s3
729 ; VI-NEXT: v_mov_b32_e32 v0, s0
730 ; VI-NEXT: v_mov_b32_e32 v1, s1
731 ; VI-NEXT: v_mov_b32_e32 v2, s2
732 ; VI-NEXT: flat_store_dword v[0:1], v2
735 ; GFX9-LABEL: orxor2or1:
737 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
738 ; GFX9-NEXT: v_mov_b32_e32 v0, 0
739 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
740 ; GFX9-NEXT: s_lshl_b32 s4, s2, 7
741 ; GFX9-NEXT: s_or_b32 s4, s3, s4
742 ; GFX9-NEXT: s_cmp_eq_u32 s4, 0
743 ; GFX9-NEXT: s_cselect_b32 s2, s2, s3
744 ; GFX9-NEXT: v_mov_b32_e32 v1, s2
745 ; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
746 ; GFX9-NEXT: s_endpgm
748 ; R600-LABEL: orxor2or1:
750 ; R600-NEXT: ALU 5, @4, KC0[CB0:0-32], KC1[]
751 ; R600-NEXT: MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
754 ; R600-NEXT: ALU clause starting at 4:
755 ; R600-NEXT: LSHL * T0.W, KC0[2].Z, literal.x,
756 ; R600-NEXT: 7(9.809089e-45), 0(0.000000e+00)
757 ; R600-NEXT: OR_INT * T0.W, KC0[2].W, PV.W,
758 ; R600-NEXT: CNDE_INT T0.X, PV.W, KC0[2].Z, KC0[2].W,
759 ; R600-NEXT: LSHR * T1.X, KC0[2].Y, literal.x,
760 ; R600-NEXT: 2(2.802597e-45), 0(0.000000e+00)
762 ; GFX10-LABEL: orxor2or1:
764 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
765 ; GFX10-NEXT: v_mov_b32_e32 v0, 0
766 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
767 ; GFX10-NEXT: s_lshl_b32 s4, s2, 7
768 ; GFX10-NEXT: s_or_b32 s4, s3, s4
769 ; GFX10-NEXT: s_cmp_eq_u32 s4, 0
770 ; GFX10-NEXT: s_cselect_b32 s2, s2, s3
771 ; GFX10-NEXT: v_mov_b32_e32 v1, s2
772 ; GFX10-NEXT: global_store_dword v0, v1, s[0:1]
773 ; GFX10-NEXT: s_endpgm
775 ; GFX11-LABEL: orxor2or1:
777 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
778 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
779 ; GFX11-NEXT: s_lshl_b32 s4, s2, 7
780 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
781 ; GFX11-NEXT: s_or_b32 s4, s3, s4
782 ; GFX11-NEXT: s_cmp_eq_u32 s4, 0
783 ; GFX11-NEXT: s_cselect_b32 s2, s2, s3
784 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
785 ; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s2
786 ; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
787 ; GFX11-NEXT: s_nop 0
788 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
789 ; GFX11-NEXT: s_endpgm
791 %xor = xor i32 %shl, %b
792 %or = or i32 %a, %xor
793 %fshl = call i32 @llvm.fshl.i32(i32 %or, i32 %xor, i32 7)
794 %cond = icmp eq i32 %fshl, 0
795 %r = select i1 %cond, i32 %a, i32 %b
796 store i32 %r, ptr addrspace(1) %in