1 ; RUN: llc < %s -march=arm | FileCheck %s
3 define i64 @f0(i64 %A, i64 %B) {
5 ; CHECK: lsrs r3, r3, #1
6 ; CHECK-NEXT: rrx r2, r2
7 ; CHECK-NEXT: subs r0, r0, r2
8 ; CHECK-NEXT: sbc r1, r1, r3
9 %tmp = bitcast i64 %A to i64
10 %tmp2 = lshr i64 %B, 1
11 %tmp3 = sub i64 %tmp, %tmp2
15 define i32 @f1(i64 %x, i64 %y) {
19 %b = trunc i64 %a to i32
23 define i32 @f2(i64 %x, i64 %y) {
26 ; CHECK-NEXT: rsb r3, r2, #32
27 ; CHECK-NEXT: sub r2, r2, #32
28 ; CHECK-NEXT: cmp r2, #0
29 ; CHECK-NEXT: orr r0, r0, r1, lsl r3
30 ; CHECK-NEXT: asrge r0, r1, r2
32 %b = trunc i64 %a to i32
36 define i32 @f3(i64 %x, i64 %y) {
39 ; CHECK-NEXT: rsb r3, r2, #32
40 ; CHECK-NEXT: sub r2, r2, #32
41 ; CHECK-NEXT: cmp r2, #0
42 ; CHECK-NEXT: orr r0, r0, r1, lsl r3
43 ; CHECK-NEXT: lsrge r0, r1, r2
45 %b = trunc i64 %a to i32