1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -march=aarch64 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
3 # RUN: llc -O0 -debugify-and-strip-all-safe -march=aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
8 ; CHECK-LABEL: name: test_shift
9 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
10 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
11 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
12 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
13 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
14 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
15 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
16 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT_INREG]], [[AND]](s32)
17 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ASHR]](s32)
18 ; CHECK: $w0 = COPY [[COPY2]](s32)
19 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
20 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC2]], [[C]]
21 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
22 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[TRUNC3]], [[C]]
23 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND2]], [[AND1]](s32)
24 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
25 ; CHECK: $w0 = COPY [[COPY3]](s32)
26 ; CHECK: [[TRUNC4:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
27 ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[TRUNC4]], [[C]]
28 ; CHECK: [[TRUNC5:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
29 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[TRUNC5]], [[AND3]](s32)
30 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[SHL]](s32)
31 ; CHECK: $w0 = COPY [[COPY4]](s32)
34 %2:_(s8) = G_TRUNC %0(s64)
35 %3:_(s8) = G_TRUNC %1(s64)
36 %4:_(s8) = G_ASHR %2, %3
37 %7:_(s32) = G_ANYEXT %4(s8)
39 %5:_(s8) = G_LSHR %2, %3
40 %8:_(s32) = G_ANYEXT %5(s8)
42 %6:_(s8) = G_SHL %2, %3
43 %9:_(s32) = G_ANYEXT %6(s8)
48 name: test_shl_i64_i32
51 ; CHECK-LABEL: name: test_shl_i64_i32
52 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
53 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
54 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
55 ; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[ZEXT]](s64)
56 ; CHECK: $x0 = COPY [[SHL]](s64)
59 %2:_(s64) = G_SHL %0, %1
64 name: test_ashr_i64_i32
67 ; CHECK-LABEL: name: test_ashr_i64_i32
68 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
69 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
70 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
71 ; CHECK: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[ZEXT]](s64)
72 ; CHECK: $x0 = COPY [[ASHR]](s64)
75 %2:_(s64) = G_ASHR %0, %1
80 name: test_lshr_i64_i32
83 ; CHECK-LABEL: name: test_lshr_i64_i32
84 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
85 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
86 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
87 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[ZEXT]](s64)
88 ; CHECK: $x0 = COPY [[LSHR]](s64)
91 %2:_(s64) = G_LSHR %0, %1
97 name: test_shl_s128_s128
100 ; CHECK-LABEL: name: test_shl_s128_s128
101 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $q0
102 ; CHECK: [[COPY1:%[0-9]+]]:_(s128) = COPY $q1
103 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s128)
104 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
105 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
106 ; CHECK: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[TRUNC]], [[C]]
107 ; CHECK: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C]], [[TRUNC]]
108 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
109 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s64), [[C]]
110 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
111 ; CHECK: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[TRUNC]](s64), [[C1]]
112 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP1]](s32)
113 ; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[UV]], [[TRUNC]](s64)
114 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[UV]], [[SUB1]](s64)
115 ; CHECK: [[SHL1:%[0-9]+]]:_(s64) = G_SHL [[UV1]], [[TRUNC]](s64)
116 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR]], [[SHL1]]
117 ; CHECK: [[SHL2:%[0-9]+]]:_(s64) = G_SHL [[UV]], [[SUB]](s64)
118 ; CHECK: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC1]](s1), [[SHL]], [[C1]]
119 ; CHECK: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC1]](s1), [[OR]], [[SHL2]]
120 ; CHECK: [[SELECT2:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC2]](s1), [[UV1]], [[SELECT1]]
121 ; CHECK: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[SELECT]](s64), [[SELECT2]](s64)
122 ; CHECK: $q0 = COPY [[MV]](s128)
123 %0:_(s128) = COPY $q0
124 %1:_(s128) = COPY $q1
125 %2:_(s128) = G_SHL %0, %1
131 name: test_lshr_s128_s128
134 ; CHECK-LABEL: name: test_lshr_s128_s128
135 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $q0
136 ; CHECK: [[COPY1:%[0-9]+]]:_(s128) = COPY $q1
137 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s128)
138 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
139 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
140 ; CHECK: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[TRUNC]], [[C]]
141 ; CHECK: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C]], [[TRUNC]]
142 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
143 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s64), [[C]]
144 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
145 ; CHECK: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[TRUNC]](s64), [[C1]]
146 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP1]](s32)
147 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[UV1]], [[TRUNC]](s64)
148 ; CHECK: [[LSHR1:%[0-9]+]]:_(s64) = G_LSHR [[UV]], [[TRUNC]](s64)
149 ; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[UV1]], [[SUB1]](s64)
150 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR1]], [[SHL]]
151 ; CHECK: [[LSHR2:%[0-9]+]]:_(s64) = G_LSHR [[UV1]], [[SUB]](s64)
152 ; CHECK: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC1]](s1), [[OR]], [[LSHR2]]
153 ; CHECK: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC2]](s1), [[UV]], [[SELECT]]
154 ; CHECK: [[SELECT2:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC1]](s1), [[LSHR]], [[C1]]
155 ; CHECK: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[SELECT1]](s64), [[SELECT2]](s64)
156 ; CHECK: $q0 = COPY [[MV]](s128)
157 %0:_(s128) = COPY $q0
158 %1:_(s128) = COPY $q1
159 %2:_(s128) = G_LSHR %0, %1
165 name: test_ashr_s128_s128
168 ; CHECK-LABEL: name: test_ashr_s128_s128
169 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $q0
170 ; CHECK: [[COPY1:%[0-9]+]]:_(s128) = COPY $q1
171 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s128)
172 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
173 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](s128)
174 ; CHECK: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[TRUNC]], [[C]]
175 ; CHECK: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C]], [[TRUNC]]
176 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
177 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s64), [[C]]
178 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
179 ; CHECK: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[TRUNC]](s64), [[C1]]
180 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP1]](s32)
181 ; CHECK: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[UV1]], [[TRUNC]](s64)
182 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[UV]], [[TRUNC]](s64)
183 ; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[UV1]], [[SUB1]](s64)
184 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR]], [[SHL]]
185 ; CHECK: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
186 ; CHECK: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[UV1]], [[C2]](s64)
187 ; CHECK: [[ASHR2:%[0-9]+]]:_(s64) = G_ASHR [[UV1]], [[SUB]](s64)
188 ; CHECK: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC1]](s1), [[OR]], [[ASHR2]]
189 ; CHECK: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC2]](s1), [[UV]], [[SELECT]]
190 ; CHECK: [[SELECT2:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC1]](s1), [[ASHR]], [[ASHR1]]
191 ; CHECK: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[SELECT1]](s64), [[SELECT2]](s64)
192 ; CHECK: $q0 = COPY [[MV]](s128)
193 %0:_(s128) = COPY $q0
194 %1:_(s128) = COPY $q1
195 %2:_(s128) = G_ASHR %0, %1
201 name: test_ashr_v2i32
204 ; CHECK-LABEL: name: test_ashr_v2i32
205 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
206 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $d1
207 ; CHECK: [[ASHR:%[0-9]+]]:_(<2 x s32>) = G_ASHR [[COPY]], [[COPY1]](<2 x s32>)
208 ; CHECK: $d0 = COPY [[ASHR]](<2 x s32>)
209 %0:_(<2 x s32>) = COPY $d0
210 %1:_(<2 x s32>) = COPY $d1
211 %2:_(<2 x s32>) = G_ASHR %0, %1
216 name: test_ashr_v4i32
219 ; CHECK-LABEL: name: test_ashr_v4i32
220 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
221 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
222 ; CHECK: [[ASHR:%[0-9]+]]:_(<4 x s32>) = G_ASHR [[COPY]], [[COPY1]](<4 x s32>)
223 ; CHECK: $q0 = COPY [[ASHR]](<4 x s32>)
224 %0:_(<4 x s32>) = COPY $q0
225 %1:_(<4 x s32>) = COPY $q1
226 %2:_(<4 x s32>) = G_ASHR %0, %1
236 ; CHECK-LABEL: name: shl_cimm_32
237 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
238 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
239 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
240 ; CHECK: $w0 = COPY [[SHL]](s32)
241 ; CHECK: RET_ReallyLR implicit $w0
243 %1:_(s32) = G_CONSTANT i32 8
244 %2:_(s32) = G_SHL %0, %1(s32)
246 RET_ReallyLR implicit $w0
255 ; CHECK-LABEL: name: lshr_cimm_32
256 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
257 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
258 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s64)
259 ; CHECK: $w0 = COPY [[LSHR]](s32)
260 ; CHECK: RET_ReallyLR implicit $w0
262 %1:_(s32) = G_CONSTANT i32 8
263 %2:_(s32) = G_LSHR %0, %1(s32)
265 RET_ReallyLR implicit $w0
274 ; CHECK-LABEL: name: ashr_cimm_32
275 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
276 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
277 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[C]](s64)
278 ; CHECK: $w0 = COPY [[ASHR]](s32)
279 ; CHECK: RET_ReallyLR implicit $w0
281 %1:_(s32) = G_CONSTANT i32 8
282 %2:_(s32) = G_ASHR %0, %1(s32)
284 RET_ReallyLR implicit $w0
288 name: test_ashr_v16i8
291 ; CHECK-LABEL: name: test_ashr_v16i8
292 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
293 ; CHECK: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
294 ; CHECK: [[ASHR:%[0-9]+]]:_(<16 x s8>) = G_ASHR [[COPY]], [[COPY1]](<16 x s8>)
295 ; CHECK: $q0 = COPY [[ASHR]](<16 x s8>)
296 %0:_(<16 x s8>) = COPY $q0
297 %1:_(<16 x s8>) = COPY $q1
298 %2:_(<16 x s8>) = G_ASHR %0, %1
302 name: test_ashr_v8i16
305 ; CHECK-LABEL: name: test_ashr_v8i16
306 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
307 ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
308 ; CHECK: [[ASHR:%[0-9]+]]:_(<8 x s16>) = G_ASHR [[COPY]], [[COPY1]](<8 x s16>)
309 ; CHECK: $q0 = COPY [[ASHR]](<8 x s16>)
310 %0:_(<8 x s16>) = COPY $q0
311 %1:_(<8 x s16>) = COPY $q1
312 %2:_(<8 x s16>) = G_ASHR %0, %1
319 ; CHECK-LABEL: name: test_shl_v16i8
320 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
321 ; CHECK: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
322 ; CHECK: [[SHL:%[0-9]+]]:_(<16 x s8>) = G_SHL [[COPY]], [[COPY1]](<16 x s8>)
323 ; CHECK: $q0 = COPY [[SHL]](<16 x s8>)
324 %0:_(<16 x s8>) = COPY $q0
325 %1:_(<16 x s8>) = COPY $q1
326 %2:_(<16 x s8>) = G_SHL %0, %1
333 ; CHECK-LABEL: name: test_shl_v8i16
334 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
335 ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
336 ; CHECK: [[SHL:%[0-9]+]]:_(<8 x s16>) = G_SHL [[COPY]], [[COPY1]](<8 x s16>)
337 ; CHECK: $q0 = COPY [[SHL]](<8 x s16>)
338 %0:_(<8 x s16>) = COPY $q0
339 %1:_(<8 x s16>) = COPY $q1
340 %2:_(<8 x s16>) = G_SHL %0, %1
344 name: test_lshr_v16i8
347 ; CHECK-LABEL: name: test_lshr_v16i8
348 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
349 ; CHECK: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
350 ; CHECK: [[LSHR:%[0-9]+]]:_(<16 x s8>) = G_LSHR [[COPY]], [[COPY1]](<16 x s8>)
351 ; CHECK: $q0 = COPY [[LSHR]](<16 x s8>)
352 %0:_(<16 x s8>) = COPY $q0
353 %1:_(<16 x s8>) = COPY $q1
354 %2:_(<16 x s8>) = G_LSHR %0, %1
358 name: test_lshr_v8i16
361 ; CHECK-LABEL: name: test_lshr_v8i16
362 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
363 ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
364 ; CHECK: [[LSHR:%[0-9]+]]:_(<8 x s16>) = G_LSHR [[COPY]], [[COPY1]](<8 x s16>)
365 ; CHECK: $q0 = COPY [[LSHR]](<8 x s16>)
366 %0:_(<8 x s16>) = COPY $q0
367 %1:_(<8 x s16>) = COPY $q1
368 %2:_(<8 x s16>) = G_LSHR %0, %1
375 ; CHECK-LABEL: name: test_shl_v4i16
376 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
377 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
378 ; CHECK: [[SHL:%[0-9]+]]:_(<4 x s16>) = G_SHL [[COPY]], [[COPY1]](<4 x s16>)
379 ; CHECK: $d0 = COPY [[SHL]](<4 x s16>)
380 %0:_(<4 x s16>) = COPY $d0
381 %1:_(<4 x s16>) = COPY $d1
382 %2:_(<4 x s16>) = G_SHL %0, %1
386 name: test_lshr_v4i16
389 ; CHECK-LABEL: name: test_lshr_v4i16
390 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
391 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
392 ; CHECK: [[LSHR:%[0-9]+]]:_(<4 x s16>) = G_LSHR [[COPY]], [[COPY1]](<4 x s16>)
393 ; CHECK: $d0 = COPY [[LSHR]](<4 x s16>)
394 %0:_(<4 x s16>) = COPY $d0
395 %1:_(<4 x s16>) = COPY $d1
396 %2:_(<4 x s16>) = G_LSHR %0, %1
400 name: test_ashr_v4i16
403 ; CHECK-LABEL: name: test_ashr_v4i16
404 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
405 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
406 ; CHECK: [[ASHR:%[0-9]+]]:_(<4 x s16>) = G_ASHR [[COPY]], [[COPY1]](<4 x s16>)
407 ; CHECK: $d0 = COPY [[ASHR]](<4 x s16>)
408 %0:_(<4 x s16>) = COPY $d0
409 %1:_(<4 x s16>) = COPY $d1
410 %2:_(<4 x s16>) = G_ASHR %0, %1
414 name: test_ashr_v8s32
417 ; CHECK-LABEL: name: test_ashr_v8s32
418 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
419 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[DEF]](s32), [[DEF]](s32), [[DEF]](s32), [[DEF]](s32)
420 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[DEF]](s32), [[DEF]](s32), [[DEF]](s32), [[DEF]](s32)
421 ; CHECK: [[BUILD_VECTOR2:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[DEF]](s32), [[DEF]](s32), [[DEF]](s32), [[DEF]](s32)
422 ; CHECK: [[BUILD_VECTOR3:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[DEF]](s32), [[DEF]](s32), [[DEF]](s32), [[DEF]](s32)
423 ; CHECK: [[ASHR:%[0-9]+]]:_(<4 x s32>) = G_ASHR [[BUILD_VECTOR]], [[BUILD_VECTOR2]](<4 x s32>)
424 ; CHECK: [[ASHR1:%[0-9]+]]:_(<4 x s32>) = G_ASHR [[BUILD_VECTOR1]], [[BUILD_VECTOR3]](<4 x s32>)
425 ; CHECK: $q0 = COPY [[ASHR]](<4 x s32>)
426 ; CHECK: $q1 = COPY [[ASHR1]](<4 x s32>)
427 %0:_(<8 x s32>) = G_IMPLICIT_DEF
428 %1:_(<8 x s32>) = G_IMPLICIT_DEF
429 %2:_(<8 x s32>) = G_ASHR %0, %1
430 %3:_(<4 x s32>), %4:_(<4 x s32>) = G_UNMERGE_VALUES %2
431 $q0 = COPY %3(<4 x s32>)
432 $q1 = COPY %4(<4 x s32>)
438 ; CHECK-LABEL: name: test_shl_v8s8
439 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
440 ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s8>) = COPY $d1
441 ; CHECK: [[SHL:%[0-9]+]]:_(<8 x s8>) = G_SHL [[COPY]], [[COPY1]](<8 x s8>)
442 ; CHECK: $d0 = COPY [[SHL]](<8 x s8>)
443 %0:_(<8 x s8>) = COPY $d0
444 %1:_(<8 x s8>) = COPY $d1
445 %2:_(<8 x s8>) = G_SHL %0, %1
452 ; CHECK-LABEL: name: test_ashr_v8s8
453 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
454 ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s8>) = COPY $d1
455 ; CHECK: [[ASHR:%[0-9]+]]:_(<8 x s8>) = G_ASHR [[COPY]], [[COPY1]](<8 x s8>)
456 ; CHECK: $d0 = COPY [[ASHR]](<8 x s8>)
457 %0:_(<8 x s8>) = COPY $d0
458 %1:_(<8 x s8>) = COPY $d1
459 %2:_(<8 x s8>) = G_ASHR %0, %1
467 ; CHECK-LABEL: name: test_lshr_v8s8
468 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
469 ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s8>) = COPY $d1
470 ; CHECK: [[LSHR:%[0-9]+]]:_(<8 x s8>) = G_LSHR [[COPY]], [[COPY1]](<8 x s8>)
471 ; CHECK: $d0 = COPY [[LSHR]](<8 x s8>)
472 %0:_(<8 x s8>) = COPY $d0
473 %1:_(<8 x s8>) = COPY $d1
474 %2:_(<8 x s8>) = G_LSHR %0, %1
478 name: test_lshr_nonpow2
481 ; CHECK-LABEL: name: test_lshr_nonpow2
482 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
483 ; CHECK: %a:_(s32) = COPY $w1
484 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
485 ; CHECK: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES %a(s32), %a(s32)
486 ; CHECK: [[MV1:%[0-9]+]]:_(s64) = G_MERGE_VALUES %a(s32), [[C]](s32)
487 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
488 ; CHECK: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[C1]]
489 ; CHECK: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[C1]], [[COPY]]
490 ; CHECK: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
491 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s64), [[C1]]
492 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
493 ; CHECK: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](s64), [[C2]]
494 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP1]](s32)
495 ; CHECK: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[MV1]], [[COPY]](s64)
496 ; CHECK: [[LSHR1:%[0-9]+]]:_(s64) = G_LSHR [[MV]], [[COPY]](s64)
497 ; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[MV1]], [[SUB1]](s64)
498 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR1]], [[SHL]]
499 ; CHECK: [[LSHR2:%[0-9]+]]:_(s64) = G_LSHR [[MV1]], [[SUB]](s64)
500 ; CHECK: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC]](s1), [[OR]], [[LSHR2]]
501 ; CHECK: [[SELECT1:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC1]](s1), [[MV]], [[SELECT]]
502 ; CHECK: [[SELECT2:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC]](s1), [[LSHR]], [[C2]]
503 ; CHECK: %d1:_(s32), %d2:_(s32) = G_UNMERGE_VALUES [[SELECT1]](s64)
504 ; CHECK: $w0 = COPY %d2(s32)
507 %merge:_(s96) = G_MERGE_VALUES %a, %a, %a
508 %lshr:_(s96) = G_LSHR %merge, %0
509 %d1:_(s32), %d2:_(s32), %d3:_(s32) = G_UNMERGE_VALUES %lshr