1 ; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s --check-prefix=ARM
3 ; RUN: llc -mtriple=arm-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - \
4 ; RUN: | FileCheck %s --check-prefix=ARMT2
6 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - \
7 ; RUN: | FileCheck %s --check-prefix=THUMB2
9 define i32 @t1(i32 %c) nounwind readnone {
12 ; ARM: mov [[R1:r[0-9]+]], #101
13 ; ARM: orr [[R1b:r[0-9]+]], [[R1]], #256
14 ; ARM: movgt {{r[0-1]}}, #123
17 ; ARMT2: movw [[R:r[0-1]]], #357
18 ; ARMT2: movwgt [[R]], #123
21 ; THUMB2: movw [[R:r[0-1]]], #357
22 ; THUMB2: movgt [[R]], #123
24 %0 = icmp sgt i32 %c, 1
25 %1 = select i1 %0, i32 123, i32 357
29 define i32 @t2(i32 %c) nounwind readnone {
32 ; ARM: mov [[R:r[0-9]+]], #101
33 ; ARM: orr [[R]], [[R]], #256
34 ; ARM: movle [[R]], #123
37 ; ARMT2: mov [[R:r[0-1]]], #123
38 ; ARMT2: movwgt [[R]], #357
41 ; THUMB2: mov{{(s|\.w)}} [[R:r[0-1]]], #123
42 ; THUMB2: movwgt [[R]], #357
44 %0 = icmp sgt i32 %c, 1
45 %1 = select i1 %0, i32 357, i32 123
49 define i32 @t3(i32 %a) nounwind readnone {
52 ; ARM: mov [[R:r[0-1]]], #0
53 ; ARM: moveq [[R]], #1
56 ; ARMT2: mov [[R:r[0-1]]], #0
57 ; ARMT2: movweq [[R]], #1
60 ; THUMB2: mov{{(s|\.w)}} [[R:r[0-1]]], #0
61 ; THUMB2: moveq [[R]], #1
62 %0 = icmp eq i32 %a, 160
63 %1 = zext i1 %0 to i32
67 define i32 @t4(i32 %a, i32 %b, i32 %x) nounwind {
74 ; ARMT2: movwlt [[R0:r[0-9]+]], #65365
75 ; ARMT2: movtlt [[R0]], #65365
78 ; THUMB2: mvnlt [[R0:r[0-9]+]], #11141290
79 %0 = icmp slt i32 %a, %b
80 %1 = select i1 %0, i32 4283826005, i32 %x
85 define i32 @t5(i32 %a) nounwind {
97 ; THUMB2: movne r0, #0
98 %cmp = icmp eq i32 %a, 1
99 %conv = zext i1 %cmp to i32
103 define i32 @t6(i32 %a) nounwind {
114 ; THUMB2: movne r0, #1
115 %tobool = icmp ne i32 %a, 0
116 %lnot.ext = zext i1 %tobool to i32