1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-LE
3 ; RUN: llc -mtriple=armeb-eabi %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-BE
5 define i64 @f0(i64 %A, i64 %B) {
8 ; CHECK-LE-NEXT: lsrs r3, r3, #1
9 ; CHECK-LE-NEXT: rrx r2, r2
10 ; CHECK-LE-NEXT: subs r0, r0, r2
11 ; CHECK-LE-NEXT: sbc r1, r1, r3
12 ; CHECK-LE-NEXT: mov pc, lr
16 ; CHECK-BE-NEXT: lsrs r2, r2, #1
17 ; CHECK-BE-NEXT: rrx r3, r3
18 ; CHECK-BE-NEXT: subs r1, r1, r3
19 ; CHECK-BE-NEXT: sbc r0, r0, r2
20 ; CHECK-BE-NEXT: mov pc, lr
22 %tmp = bitcast i64 %A to i64
23 %tmp2 = lshr i64 %B, 1
24 %tmp3 = sub i64 %tmp, %tmp2
28 define i32 @f1(i64 %x, i64 %y) {
31 ; CHECK-LE-NEXT: lsl r0, r0, r2
32 ; CHECK-LE-NEXT: subs r1, r2, #32
33 ; CHECK-LE-NEXT: movpl r0, #0
34 ; CHECK-LE-NEXT: mov pc, lr
38 ; CHECK-BE-NEXT: lsl r0, r1, r3
39 ; CHECK-BE-NEXT: subs r1, r3, #32
40 ; CHECK-BE-NEXT: movpl r0, #0
41 ; CHECK-BE-NEXT: mov pc, lr
44 %b = trunc i64 %a to i32
48 define i32 @f2(i64 %x, i64 %y) {
51 ; CHECK-LE-NEXT: rsb r3, r2, #32
52 ; CHECK-LE-NEXT: lsr r0, r0, r2
53 ; CHECK-LE-NEXT: subs r2, r2, #32
54 ; CHECK-LE-NEXT: orr r0, r0, r1, lsl r3
55 ; CHECK-LE-NEXT: asrpl r0, r1, r2
56 ; CHECK-LE-NEXT: mov pc, lr
60 ; CHECK-BE-NEXT: rsb r2, r3, #32
61 ; CHECK-BE-NEXT: lsr r1, r1, r3
62 ; CHECK-BE-NEXT: orr r1, r1, r0, lsl r2
63 ; CHECK-BE-NEXT: subs r2, r3, #32
64 ; CHECK-BE-NEXT: asrpl r1, r0, r2
65 ; CHECK-BE-NEXT: mov r0, r1
66 ; CHECK-BE-NEXT: mov pc, lr
69 %b = trunc i64 %a to i32
73 define i32 @f3(i64 %x, i64 %y) {
76 ; CHECK-LE-NEXT: rsb r3, r2, #32
77 ; CHECK-LE-NEXT: lsr r0, r0, r2
78 ; CHECK-LE-NEXT: subs r2, r2, #32
79 ; CHECK-LE-NEXT: orr r0, r0, r1, lsl r3
80 ; CHECK-LE-NEXT: lsrpl r0, r1, r2
81 ; CHECK-LE-NEXT: mov pc, lr
85 ; CHECK-BE-NEXT: rsb r2, r3, #32
86 ; CHECK-BE-NEXT: lsr r1, r1, r3
87 ; CHECK-BE-NEXT: orr r1, r1, r0, lsl r2
88 ; CHECK-BE-NEXT: subs r2, r3, #32
89 ; CHECK-BE-NEXT: lsrpl r1, r0, r2
90 ; CHECK-BE-NEXT: mov r0, r1
91 ; CHECK-BE-NEXT: mov pc, lr
94 %b = trunc i64 %a to i32