58 lines · plain
1; RUN: llc < %s -mtriple=arm64-eabi -verify-machineinstrs | FileCheck %s2 3define i64 @ror_i64(i64 %in) {4; CHECK-LABEL: ror_i64:5 %left = shl i64 %in, 196 %right = lshr i64 %in, 457 %val5 = or i64 %left, %right8; CHECK: ror {{x[0-9]+}}, x0, #459 ret i64 %val510}11 12define i32 @ror_i32(i32 %in) {13; CHECK-LABEL: ror_i32:14 %left = shl i32 %in, 915 %right = lshr i32 %in, 2316 %val5 = or i32 %left, %right17; CHECK: ror {{w[0-9]+}}, w0, #2318 ret i32 %val519}20 21define i32 @extr_i32(i32 %lhs, i32 %rhs) {22; CHECK-LABEL: extr_i32:23 %left = shl i32 %lhs, 624 %right = lshr i32 %rhs, 2625 %val = or i32 %left, %right26 ; Order of lhs and rhs matters here. Regalloc would have to be very odd to use27 ; something other than w0 and w1.28; CHECK: extr {{w[0-9]+}}, w0, w1, #2629 30 ret i32 %val31}32 33define i64 @extr_i64(i64 %lhs, i64 %rhs) {34; CHECK-LABEL: extr_i64:35 %right = lshr i64 %rhs, 4036 %left = shl i64 %lhs, 2437 %val = or i64 %right, %left38 ; Order of lhs and rhs matters here. Regalloc would have to be very odd to use39 ; something other than w0 and w1.40; CHECK: extr {{x[0-9]+}}, x0, x1, #4041 42 ret i64 %val43}44 45; Regression test: a bad experimental pattern crept into git which optimised46; this pattern to a single EXTR.47define i32 @extr_regress(i32 %a, i32 %b) {48; CHECK-LABEL: extr_regress:49 50 %sh1 = shl i32 %a, 1451 %sh2 = lshr i32 %b, 1452 %val = or i32 %sh2, %sh153; CHECK-NOT: extr {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, #{{[0-9]+}}54 55 ret i32 %val56; CHECK: ret57}58