1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple thumbv7-eabi | FileCheck %s -check-prefix=T2
3 ; RUN: llc < %s -mtriple thumbv6m-eabi | FileCheck %s -check-prefix=T1
4 ; <rdar://problem/7569620>
6 define i32 @compare_i_gt(i32 %a) {
7 ; T2-LABEL: compare_i_gt:
8 ; T2: @ %bb.0: @ %entry
9 ; T2-NEXT: movs r1, #24
10 ; T2-NEXT: cmn.w r0, #78
12 ; T2-NEXT: movgt r1, #42
16 ; T1-LABEL: compare_i_gt:
17 ; T1: @ %bb.0: @ %entry
18 ; T1-NEXT: movs r1, #77
19 ; T1-NEXT: mvns r1, r1
21 ; T1-NEXT: bgt .LBB0_2
22 ; T1-NEXT: @ %bb.1: @ %entry
23 ; T1-NEXT: movs r0, #24
26 ; T1-NEXT: movs r0, #42
29 %cmp = icmp sgt i32 %a, -78
30 %ret = select i1 %cmp, i32 42, i32 24
34 define i32 @compare_r_eq(i32 %a, i32 %b) {
35 ; T2-LABEL: compare_r_eq:
36 ; T2: @ %bb.0: @ %entry
37 ; T2-NEXT: movs r2, #24
40 ; T2-NEXT: moveq r2, #42
44 ; T1-LABEL: compare_r_eq:
45 ; T1: @ %bb.0: @ %entry
47 ; T1-NEXT: beq .LBB1_2
48 ; T1-NEXT: @ %bb.1: @ %entry
49 ; T1-NEXT: movs r0, #24
52 ; T1-NEXT: movs r0, #42
55 %sub = sub nsw i32 0, %b
56 %cmp = icmp eq i32 %a, %sub
57 %ret = select i1 %cmp, i32 42, i32 24