1 ; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-LE
2 ; RUN: llc -mtriple=armeb-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-BE
5 define i64 @f1(i64 %a) {
7 ; CHECK-LE: subs r0, r0, #171
8 ; CHECK-LE: sbc r1, r1, #0
9 ; CHECK-BE: subs r1, r1, #171
10 ; CHECK-BE: sbc r0, r0, #0
11 %tmp = sub i64 %a, 171
15 ; 66846720 = 0x03fc0000
16 define i64 @f2(i64 %a) {
18 ; CHECK-LE: subs r0, r0, #66846720
19 ; CHECK-LE: sbc r1, r1, #0
20 ; CHECK-BE: subs r1, r1, #66846720
21 ; CHECK-BE: sbc r0, r0, #0
22 %tmp = sub i64 %a, 66846720
26 ; 734439407618 = 0x000000ab00000002
27 define i64 @f3(i64 %a) {
29 ; CHECK-LE: subs r0, r0, #2
30 ; CHECK-LE: sbc r1, r1, #171
31 ; CHECK-BE: subs r1, r1, #2
32 ; CHECK-BE: sbc r0, r0, #171
33 %tmp = sub i64 %a, 734439407618
37 define i32 @f4(i32 %x) {
42 %cmp = icmp ugt i32 %sub, 0
43 %sel = select i1 %cmp, i32 1, i32 %sub
48 define i32 @f5(i32 %x) {
51 ; CHECK: movw r1, #65535
54 ; CHECK: sub r0, r0, r1
55 %sub = add i32 %x, -65535