1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -debugify-and-strip-all-safe -mtriple=aarch64 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
7 ; CHECK-LABEL: name: test_shift
8 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
9 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
10 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
11 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
12 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
13 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
14 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
15 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT_INREG]], [[AND]](s32)
16 ; CHECK-NEXT: $w0 = COPY [[ASHR]](s32)
17 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
18 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC2]], [[C]]
19 ; CHECK-NEXT: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
20 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[TRUNC3]], [[C]]
21 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND2]], [[AND1]](s32)
22 ; CHECK-NEXT: $w0 = COPY [[LSHR]](s32)
23 ; CHECK-NEXT: [[TRUNC4:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
24 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[TRUNC4]], [[C]]
25 ; CHECK-NEXT: [[TRUNC5:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
26 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[TRUNC5]], [[AND3]](s32)
27 ; CHECK-NEXT: $w0 = COPY [[SHL]](s32)
30 %2:_(s8) = G_TRUNC %0(s64)
31 %3:_(s8) = G_TRUNC %1(s64)
32 %4:_(s8) = G_ASHR %2, %3
33 %7:_(s32) = G_ANYEXT %4(s8)
35 %5:_(s8) = G_LSHR %2, %3
36 %8:_(s32) = G_ANYEXT %5(s8)
38 %6:_(s8) = G_SHL %2, %3
39 %9:_(s32) = G_ANYEXT %6(s8)
44 name: test_shl_i64_i32
47 ; CHECK-LABEL: name: test_shl_i64_i32
48 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
49 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
50 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
51 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[ZEXT]](s64)
52 ; CHECK-NEXT: $x0 = COPY [[SHL]](s64)
55 %2:_(s64) = G_SHL %0, %1
60 name: test_ashr_i64_i32
63 ; CHECK-LABEL: name: test_ashr_i64_i32
64 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
65 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
66 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
67 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[ZEXT]](s64)
68 ; CHECK-NEXT: $x0 = COPY [[ASHR]](s64)
71 %2:_(s64) = G_ASHR %0, %1
76 name: test_lshr_i64_i32
79 ; CHECK-LABEL: name: test_lshr_i64_i32
80 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
81 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
82 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
83 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[ZEXT]](s64)
84 ; CHECK-NEXT: $x0 = COPY [[LSHR]](s64)
87 %2:_(s64) = G_LSHR %0, %1
93 name: test_shl_s128_s128
96 ; CHECK-LABEL: name: test_shl_s128_s128
97 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $q0
98 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $q1
99 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s128)
100 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
101 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
102 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[TRUNC]], [[C]]
103 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C]], [[TRUNC]]
104 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
105 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s64), [[C]]
106 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[TRUNC]](s64), [[C1]]
107 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[UV]], [[TRUNC]](s64)
108 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[UV]], [[SUB1]](s64)
109 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[UV1]], [[TRUNC]](s64)
110 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR]], [[SHL1]]
111 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s64) = G_SHL [[UV]], [[SUB]](s64)
112 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s32), [[SHL]], [[C1]]
113 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s32), [[OR]], [[SHL2]]
114 ; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s64) = G_SELECT [[ICMP1]](s32), [[UV1]], [[SELECT1]]
115 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[SELECT]](s64), [[SELECT2]](s64)
116 ; CHECK-NEXT: $q0 = COPY [[MV]](s128)
117 %0:_(s128) = COPY $q0
118 %1:_(s128) = COPY $q1
119 %2:_(s128) = G_SHL %0, %1
125 name: test_lshr_s128_s128
128 ; CHECK-LABEL: name: test_lshr_s128_s128
129 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $q0
130 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $q1
131 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s128)
132 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
133 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
134 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[TRUNC]], [[C]]
135 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C]], [[TRUNC]]
136 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
137 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s64), [[C]]
138 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[TRUNC]](s64), [[C1]]
139 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[UV1]], [[TRUNC]](s64)
140 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s64) = G_LSHR [[UV]], [[TRUNC]](s64)
141 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[UV1]], [[SUB1]](s64)
142 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR1]], [[SHL]]
143 ; CHECK-NEXT: [[LSHR2:%[0-9]+]]:_(s64) = G_LSHR [[UV1]], [[SUB]](s64)
144 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s32), [[OR]], [[LSHR2]]
145 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[ICMP1]](s32), [[UV]], [[SELECT]]
146 ; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s32), [[LSHR]], [[C1]]
147 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[SELECT1]](s64), [[SELECT2]](s64)
148 ; CHECK-NEXT: $q0 = COPY [[MV]](s128)
149 %0:_(s128) = COPY $q0
150 %1:_(s128) = COPY $q1
151 %2:_(s128) = G_LSHR %0, %1
157 name: test_ashr_s128_s128
160 ; CHECK-LABEL: name: test_ashr_s128_s128
161 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $q0
162 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s128) = COPY $q1
163 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s128)
164 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
165 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
166 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[TRUNC]], [[C]]
167 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C]], [[TRUNC]]
168 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
169 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s64), [[C]]
170 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[TRUNC]](s64), [[C1]]
171 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[UV1]], [[TRUNC]](s64)
172 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[UV]], [[TRUNC]](s64)
173 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[UV1]], [[SUB1]](s64)
174 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR]], [[SHL]]
175 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
176 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[UV1]], [[C2]](s64)
177 ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:_(s64) = G_ASHR [[UV1]], [[SUB]](s64)
178 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s32), [[OR]], [[ASHR2]]
179 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[ICMP1]](s32), [[UV]], [[SELECT]]
180 ; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s32), [[ASHR]], [[ASHR1]]
181 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[SELECT1]](s64), [[SELECT2]](s64)
182 ; CHECK-NEXT: $q0 = COPY [[MV]](s128)
183 %0:_(s128) = COPY $q0
184 %1:_(s128) = COPY $q1
185 %2:_(s128) = G_ASHR %0, %1
191 name: test_ashr_v2i32
194 ; CHECK-LABEL: name: test_ashr_v2i32
195 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
196 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $d1
197 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(<2 x s32>) = G_ASHR [[COPY]], [[COPY1]](<2 x s32>)
198 ; CHECK-NEXT: $d0 = COPY [[ASHR]](<2 x s32>)
199 %0:_(<2 x s32>) = COPY $d0
200 %1:_(<2 x s32>) = COPY $d1
201 %2:_(<2 x s32>) = G_ASHR %0, %1
206 name: test_ashr_v4i32
209 ; CHECK-LABEL: name: test_ashr_v4i32
210 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
211 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
212 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(<4 x s32>) = G_ASHR [[COPY]], [[COPY1]](<4 x s32>)
213 ; CHECK-NEXT: $q0 = COPY [[ASHR]](<4 x s32>)
214 %0:_(<4 x s32>) = COPY $q0
215 %1:_(<4 x s32>) = COPY $q1
216 %2:_(<4 x s32>) = G_ASHR %0, %1
226 ; CHECK-LABEL: name: shl_cimm_32
227 ; CHECK: liveins: $w0
229 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
230 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
231 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
232 ; CHECK-NEXT: $w0 = COPY [[SHL]](s32)
233 ; CHECK-NEXT: RET_ReallyLR implicit $w0
235 %1:_(s32) = G_CONSTANT i32 8
236 %2:_(s32) = G_SHL %0, %1(s32)
238 RET_ReallyLR implicit $w0
247 ; CHECK-LABEL: name: lshr_cimm_32
248 ; CHECK: liveins: $w0
250 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
251 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
252 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s64)
253 ; CHECK-NEXT: $w0 = COPY [[LSHR]](s32)
254 ; CHECK-NEXT: RET_ReallyLR implicit $w0
256 %1:_(s32) = G_CONSTANT i32 8
257 %2:_(s32) = G_LSHR %0, %1(s32)
259 RET_ReallyLR implicit $w0
268 ; CHECK-LABEL: name: ashr_cimm_32
269 ; CHECK: liveins: $w0
271 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
272 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
273 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[C]](s64)
274 ; CHECK-NEXT: $w0 = COPY [[ASHR]](s32)
275 ; CHECK-NEXT: RET_ReallyLR implicit $w0
277 %1:_(s32) = G_CONSTANT i32 8
278 %2:_(s32) = G_ASHR %0, %1(s32)
280 RET_ReallyLR implicit $w0
284 name: test_ashr_v16i8
287 ; CHECK-LABEL: name: test_ashr_v16i8
288 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
289 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
290 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(<16 x s8>) = G_ASHR [[COPY]], [[COPY1]](<16 x s8>)
291 ; CHECK-NEXT: $q0 = COPY [[ASHR]](<16 x s8>)
292 %0:_(<16 x s8>) = COPY $q0
293 %1:_(<16 x s8>) = COPY $q1
294 %2:_(<16 x s8>) = G_ASHR %0, %1
298 name: test_ashr_v8i16
301 ; CHECK-LABEL: name: test_ashr_v8i16
302 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
303 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
304 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(<8 x s16>) = G_ASHR [[COPY]], [[COPY1]](<8 x s16>)
305 ; CHECK-NEXT: $q0 = COPY [[ASHR]](<8 x s16>)
306 %0:_(<8 x s16>) = COPY $q0
307 %1:_(<8 x s16>) = COPY $q1
308 %2:_(<8 x s16>) = G_ASHR %0, %1
315 ; CHECK-LABEL: name: test_shl_v16i8
316 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
317 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
318 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(<16 x s8>) = G_SHL [[COPY]], [[COPY1]](<16 x s8>)
319 ; CHECK-NEXT: $q0 = COPY [[SHL]](<16 x s8>)
320 %0:_(<16 x s8>) = COPY $q0
321 %1:_(<16 x s8>) = COPY $q1
322 %2:_(<16 x s8>) = G_SHL %0, %1
329 ; CHECK-LABEL: name: test_shl_v8i16
330 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
331 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
332 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(<8 x s16>) = G_SHL [[COPY]], [[COPY1]](<8 x s16>)
333 ; CHECK-NEXT: $q0 = COPY [[SHL]](<8 x s16>)
334 %0:_(<8 x s16>) = COPY $q0
335 %1:_(<8 x s16>) = COPY $q1
336 %2:_(<8 x s16>) = G_SHL %0, %1
340 name: test_lshr_v16i8
343 ; CHECK-LABEL: name: test_lshr_v16i8
344 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
345 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
346 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<16 x s8>) = G_LSHR [[COPY]], [[COPY1]](<16 x s8>)
347 ; CHECK-NEXT: $q0 = COPY [[LSHR]](<16 x s8>)
348 %0:_(<16 x s8>) = COPY $q0
349 %1:_(<16 x s8>) = COPY $q1
350 %2:_(<16 x s8>) = G_LSHR %0, %1
354 name: test_lshr_v8i16
357 ; CHECK-LABEL: name: test_lshr_v8i16
358 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
359 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
360 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<8 x s16>) = G_LSHR [[COPY]], [[COPY1]](<8 x s16>)
361 ; CHECK-NEXT: $q0 = COPY [[LSHR]](<8 x s16>)
362 %0:_(<8 x s16>) = COPY $q0
363 %1:_(<8 x s16>) = COPY $q1
364 %2:_(<8 x s16>) = G_LSHR %0, %1
371 ; CHECK-LABEL: name: test_shl_v4i16
372 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
373 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
374 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(<4 x s16>) = G_SHL [[COPY]], [[COPY1]](<4 x s16>)
375 ; CHECK-NEXT: $d0 = COPY [[SHL]](<4 x s16>)
376 %0:_(<4 x s16>) = COPY $d0
377 %1:_(<4 x s16>) = COPY $d1
378 %2:_(<4 x s16>) = G_SHL %0, %1
382 name: test_lshr_v4i16
385 ; CHECK-LABEL: name: test_lshr_v4i16
386 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
387 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
388 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<4 x s16>) = G_LSHR [[COPY]], [[COPY1]](<4 x s16>)
389 ; CHECK-NEXT: $d0 = COPY [[LSHR]](<4 x s16>)
390 %0:_(<4 x s16>) = COPY $d0
391 %1:_(<4 x s16>) = COPY $d1
392 %2:_(<4 x s16>) = G_LSHR %0, %1
396 name: test_ashr_v4i16
399 ; CHECK-LABEL: name: test_ashr_v4i16
400 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
401 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
402 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(<4 x s16>) = G_ASHR [[COPY]], [[COPY1]](<4 x s16>)
403 ; CHECK-NEXT: $d0 = COPY [[ASHR]](<4 x s16>)
404 %0:_(<4 x s16>) = COPY $d0
405 %1:_(<4 x s16>) = COPY $d1
406 %2:_(<4 x s16>) = G_ASHR %0, %1
410 name: test_ashr_v8s32
413 ; CHECK-LABEL: name: test_ashr_v8s32
414 ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
415 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(<4 x s32>) = G_ASHR [[DEF]], [[DEF]](<4 x s32>)
416 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(<4 x s32>) = G_ASHR [[DEF]], [[DEF]](<4 x s32>)
417 ; CHECK-NEXT: $q0 = COPY [[ASHR]](<4 x s32>)
418 ; CHECK-NEXT: $q1 = COPY [[ASHR1]](<4 x s32>)
419 %0:_(<8 x s32>) = G_IMPLICIT_DEF
420 %1:_(<8 x s32>) = G_IMPLICIT_DEF
421 %2:_(<8 x s32>) = G_ASHR %0, %1
422 %3:_(<4 x s32>), %4:_(<4 x s32>) = G_UNMERGE_VALUES %2
423 $q0 = COPY %3(<4 x s32>)
424 $q1 = COPY %4(<4 x s32>)
430 ; CHECK-LABEL: name: test_shl_v8s8
431 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
432 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s8>) = COPY $d1
433 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(<8 x s8>) = G_SHL [[COPY]], [[COPY1]](<8 x s8>)
434 ; CHECK-NEXT: $d0 = COPY [[SHL]](<8 x s8>)
435 %0:_(<8 x s8>) = COPY $d0
436 %1:_(<8 x s8>) = COPY $d1
437 %2:_(<8 x s8>) = G_SHL %0, %1
444 ; CHECK-LABEL: name: test_ashr_v8s8
445 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
446 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s8>) = COPY $d1
447 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(<8 x s8>) = G_ASHR [[COPY]], [[COPY1]](<8 x s8>)
448 ; CHECK-NEXT: $d0 = COPY [[ASHR]](<8 x s8>)
449 %0:_(<8 x s8>) = COPY $d0
450 %1:_(<8 x s8>) = COPY $d1
451 %2:_(<8 x s8>) = G_ASHR %0, %1
459 ; CHECK-LABEL: name: test_lshr_v8s8
460 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
461 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s8>) = COPY $d1
462 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<8 x s8>) = G_LSHR [[COPY]], [[COPY1]](<8 x s8>)
463 ; CHECK-NEXT: $d0 = COPY [[LSHR]](<8 x s8>)
464 %0:_(<8 x s8>) = COPY $d0
465 %1:_(<8 x s8>) = COPY $d1
466 %2:_(<8 x s8>) = G_LSHR %0, %1
470 name: test_lshr_nonpow2
473 ; CHECK-LABEL: name: test_lshr_nonpow2
474 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
475 ; CHECK-NEXT: %a:_(s32) = COPY $w1
476 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
477 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES %a(s32), %a(s32)
478 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s64) = G_MERGE_VALUES %a(s32), [[C]](s32)
479 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
480 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[C1]]
481 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C1]], [[COPY]]
482 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
483 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s64), [[C1]]
484 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](s64), [[C2]]
485 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[MV]], [[COPY]](s64)
486 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[MV1]], [[SUB1]](s64)
487 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR]], [[SHL]]
488 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s64) = G_LSHR [[MV1]], [[SUB]](s64)
489 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s32), [[OR]], [[LSHR1]]
490 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[ICMP1]](s32), [[MV]], [[SELECT]]
491 ; CHECK-NEXT: %d1:_(s32), %d2:_(s32) = G_UNMERGE_VALUES [[SELECT1]](s64)
492 ; CHECK-NEXT: $w0 = COPY %d2(s32)
495 %merge:_(s96) = G_MERGE_VALUES %a, %a, %a
496 %lshr:_(s96) = G_LSHR %merge, %0
497 %d1:_(s32), %d2:_(s32), %d3:_(s32) = G_UNMERGE_VALUES %lshr
502 name: test_lshr_nonpow2_wide
505 ; CHECK-LABEL: name: test_lshr_nonpow2_wide
506 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
507 ; CHECK-NEXT: %a:_(s32) = COPY $w1
508 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
509 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES %a(s32), %a(s32)
510 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s64) = G_MERGE_VALUES %a(s32), %a(s32)
511 ; CHECK-NEXT: [[MV2:%[0-9]+]]:_(s64) = G_MERGE_VALUES %a(s32), [[C]](s32)
512 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
513 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 128
514 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[C2]]
515 ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C2]], [[COPY]]
516 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s64), [[C2]]
517 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](s64), [[C1]]
518 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
519 ; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[C3]]
520 ; CHECK-NEXT: [[SUB3:%[0-9]+]]:_(s64) = G_SUB [[C3]], [[COPY]]
521 ; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s64), [[C3]]
522 ; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](s64), [[C1]]
523 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[MV]], [[COPY]](s64)
524 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[MV1]], [[SUB3]](s64)
525 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR]], [[SHL]]
526 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s64) = G_LSHR [[MV1]], [[SUB2]](s64)
527 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[ICMP2]](s32), [[OR]], [[LSHR1]]
528 ; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[ICMP3]](s32), [[MV]], [[SELECT]]
529 ; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[SUB1]](s64), [[C3]]
530 ; CHECK-NEXT: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[MV2]], [[SUB1]](s64)
531 ; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s64) = G_SELECT [[ICMP4]](s32), [[SHL1]], [[C1]]
532 ; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR [[SELECT1]], [[SELECT2]]
533 ; CHECK-NEXT: [[SUB4:%[0-9]+]]:_(s64) = G_SUB [[SUB]], [[C3]]
534 ; CHECK-NEXT: [[SUB5:%[0-9]+]]:_(s64) = G_SUB [[C3]], [[SUB]]
535 ; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[SUB]](s64), [[C3]]
536 ; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[SUB]](s64), [[C1]]
537 ; CHECK-NEXT: [[LSHR2:%[0-9]+]]:_(s64) = G_LSHR [[MV2]], [[SUB]](s64)
538 ; CHECK-NEXT: [[SHL2:%[0-9]+]]:_(s64) = G_SHL [[C1]], [[SUB5]](s64)
539 ; CHECK-NEXT: [[OR2:%[0-9]+]]:_(s64) = G_OR [[LSHR2]], [[SHL2]]
540 ; CHECK-NEXT: [[LSHR3:%[0-9]+]]:_(s64) = G_LSHR [[C1]], [[SUB4]](s64)
541 ; CHECK-NEXT: [[SELECT3:%[0-9]+]]:_(s64) = G_SELECT [[ICMP5]](s32), [[OR2]], [[LSHR3]]
542 ; CHECK-NEXT: [[SELECT4:%[0-9]+]]:_(s64) = G_SELECT [[ICMP6]](s32), [[MV2]], [[SELECT3]]
543 ; CHECK-NEXT: [[SELECT5:%[0-9]+]]:_(s64) = G_SELECT [[ICMP]](s32), [[OR1]], [[SELECT4]]
544 ; CHECK-NEXT: [[SELECT6:%[0-9]+]]:_(s64) = G_SELECT [[ICMP1]](s32), [[MV]], [[SELECT5]]
545 ; CHECK-NEXT: %d1:_(s32), %d2:_(s32) = G_UNMERGE_VALUES [[SELECT6]](s64)
546 ; CHECK-NEXT: $w0 = COPY %d2(s32)
549 %merge:_(s160) = G_MERGE_VALUES %a, %a, %a, %a, %a
550 %lshr:_(s160) = G_LSHR %merge, %0
551 %d1:_(s32), %d2:_(s32), %d3:_(s32), %d4:_(s32), %d5:_(s32) = G_UNMERGE_VALUES %lshr