1 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s
3 define i64 @f1(i64 %a, i64 %b) {
5 ; CHECK: subs r0, r0, r2
10 ; 734439407618 = 0x000000ab00000002
11 define i64 @f2(i64 %a) {
14 ; CHECK: sbc r1, r1, #171
15 %tmp = sub i64 %a, 734439407618
19 ; 5066626890203138 = 0x0012001200000002
20 define i64 @f3(i64 %a) {
23 ; CHECK: sbc r1, r1, #1179666
24 %tmp = sub i64 %a, 5066626890203138
28 ; 3747052064576897026 = 0x3400340000000002
29 define i64 @f4(i64 %a) {
32 ; CHECK: sbc r1, r1, #872428544
33 %tmp = sub i64 %a, 3747052064576897026
37 ; 6221254862626095106 = 0x5656565600000002
38 define i64 @f5(i64 %a) {
41 ; CHECK: adc r1, r1, #-1448498775
42 %tmp = sub i64 %a, 6221254862626095106
46 ; 287104476244869122 = 0x03fc000000000002
47 define i64 @f6(i64 %a) {
50 ; CHECK: sbc r1, r1, #66846720
51 %tmp = sub i64 %a, 287104476244869122
55 ; Example from numerics code that manually computes wider-than-64 values.
57 ; CHECK-LABEL: livecarry:
60 define i64 @livecarry(i64 %carry, i32 %digit) nounwind {
61 %ch = lshr i64 %carry, 32
62 %cl = and i64 %carry, 4294967295
63 %truncdigit = zext i32 %digit to i64
64 %prod = add i64 %cl, %truncdigit
65 %ph = lshr i64 %prod, 32
66 %carryresult = add i64 %ch, %ph