1 ; RUN: llc < %s -march=arm | FileCheck %s 2 3 define i64 @f1(i64 %a, i64 %b) { 4 ; CHECK: f1: 5 ; CHECK: subs r 6 ; CHECK: sbc r 7 entry: 8 %tmp = sub i64 %a, %b 9 ret i64 %tmp 10 } 11 12 define i64 @f2(i64 %a, i64 %b) { 13 ; CHECK: f2: 14 ; CHECK: adc r 15 ; CHECK: subs r 16 ; CHECK: sbc r 17 entry: 18 %tmp1 = shl i64 %a, 1 19 %tmp2 = sub i64 %tmp1, %b 20 ret i64 %tmp2 21 } 22 23 ; add with live carry 24 define i64 @f3(i32 %al, i32 %bl) { 25 ; CHECK: f3: 26 ; CHECK: adds r 27 ; CHECK: adc r 28 entry: 29 ; unsigned wide add 30 %aw = zext i32 %al to i64 31 %bw = zext i32 %bl to i64 32 %cw = add i64 %aw, %bw 33 ; ch == carry bit 34 %ch = lshr i64 %cw, 32 35 %dw = add i64 %ch, %bw 36 ret i64 %dw 37 } 38