xref: /llvm-project/llvm/test/CodeGen/ARM/shift_minsize.ll (revision 2ba016cd5ce50a3683d3e6c2c62f00e1cccfd8b5)
1; RUN: llc -mtriple=arm-eabi        %s -o - | FileCheck %s
2; RUN: llc -mtriple=thumbv7-windows %s -o - | FileCheck %s -check-prefix=CHECK-WIN
3; RUN: llc < %s -mtriple=aarch64-apple-darwin    | FileCheck %s -check-prefix=CHECK-DARWIN
4
5; The Windows runtime doesn't have these.
6; CHECK-WIN-NOT: __ashldi3
7; CHECK-WIN-NOT: __ashrdi3
8; CHECK-WIN-NOT: __lshrdi3
9
10; Darwin compiler-rt excludes these.
11; CHECK-DARWIN-NOT: __ashlti3
12; CHECK-DARWIN-NOT: __ashrti3
13
14define i64 @f0(i64 %val, i64 %amt) minsize optsize {
15; CHECK-LABEL:   f0:
16; CHECK:         bl  __aeabi_llsl
17  %res = shl i64 %val, %amt
18  ret i64 %res
19}
20
21define i32 @f1(i64 %x, i64 %y) minsize optsize {
22; CHECK-LABEL:   f1:
23; CHECK:         bl  __aeabi_llsl
24	%a = shl i64 %x, %y
25	%b = trunc i64 %a to i32
26	ret i32 %b
27}
28
29define i32 @f2(i64 %x, i64 %y) minsize optsize {
30; CHECK-LABEL:   f2:
31; CHECK:         bl  __aeabi_lasr
32	%a = ashr i64 %x, %y
33	%b = trunc i64 %a to i32
34	ret i32 %b
35}
36
37define i32 @f3(i64 %x, i64 %y) minsize optsize {
38; CHECK-LABEL:   f3:
39; CHECK:         bl  __aeabi_llsr
40	%a = lshr i64 %x, %y
41	%b = trunc i64 %a to i32
42	ret i32 %b
43}
44