1 ; RUN: llc < %s -mtriple=arm64-eabi -verify-machineinstrs | FileCheck %s
3 define i64 @ror_i64(i64 %in) {
4 ; CHECK-LABEL: ror_i64:
5 %left = shl i64 %in, 19
6 %right = lshr i64 %in, 45
7 %val5 = or i64 %left, %right
8 ; CHECK: ror {{x[0-9]+}}, x0, #45
12 define i32 @ror_i32(i32 %in) {
13 ; CHECK-LABEL: ror_i32:
14 %left = shl i32 %in, 9
15 %right = lshr i32 %in, 23
16 %val5 = or i32 %left, %right
17 ; CHECK: ror {{w[0-9]+}}, w0, #23
21 define i32 @extr_i32(i32 %lhs, i32 %rhs) {
22 ; CHECK-LABEL: extr_i32:
23 %left = shl i32 %lhs, 6
24 %right = lshr i32 %rhs, 26
25 %val = or i32 %left, %right
26 ; Order of lhs and rhs matters here. Regalloc would have to be very odd to use
27 ; something other than w0 and w1.
28 ; CHECK: extr {{w[0-9]+}}, w0, w1, #26
33 define i64 @extr_i64(i64 %lhs, i64 %rhs) {
34 ; CHECK-LABEL: extr_i64:
35 %right = lshr i64 %rhs, 40
36 %left = shl i64 %lhs, 24
37 %val = or i64 %right, %left
38 ; Order of lhs and rhs matters here. Regalloc would have to be very odd to use
39 ; something other than w0 and w1.
40 ; CHECK: extr {{x[0-9]+}}, x0, x1, #40
45 ; Regression test: a bad experimental pattern crept into git which optimised
46 ; this pattern to a single EXTR.
47 define i32 @extr_regress(i32 %a, i32 %b) {
48 ; CHECK-LABEL: extr_regress:
51 %sh2 = lshr i32 %b, 14
52 %val = or i32 %sh2, %sh1
53 ; CHECK-NOT: extr {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, #{{[0-9]+}}