1 ; RUN: llc -march=msp430 < %s | FileCheck %s
2 target datalayout = "e-p:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:16:32"
3 target triple = "msp430-generic-generic"
5 define i16 @sccweqand(i16 %a, i16 %b) nounwind {
7 %t2 = icmp eq i16 %t1, 0
8 %t3 = zext i1 %t2 to i16
12 ; CHECK: bit.w r14, r15
13 ; CHECK: mov.w r2, r15
15 ; CHECK: and.w #1, r15
17 define i16 @sccwneand(i16 %a, i16 %b) nounwind {
19 %t2 = icmp ne i16 %t1, 0
20 %t3 = zext i1 %t2 to i16
24 ; CHECK: bit.w r14, r15
25 ; CHECK: mov.w r2, r15
26 ; CHECK: and.w #1, r15
28 define i16 @sccwne(i16 %a, i16 %b) nounwind {
29 %t1 = icmp ne i16 %a, %b
30 %t2 = zext i1 %t1 to i16
34 ; CHECK: cmp.w r14, r15
35 ; CHECK: mov.w r2, r15
37 ; CHECK: and.w #1, r15
38 ; CHECK: xor.w #1, r15
40 define i16 @sccweq(i16 %a, i16 %b) nounwind {
41 %t1 = icmp eq i16 %a, %b
42 %t2 = zext i1 %t1 to i16
46 ; CHECK: cmp.w r14, r15
47 ; CHECK: mov.w r2, r15
49 ; CHECK: and.w #1, r15
51 define i16 @sccwugt(i16 %a, i16 %b) nounwind {
52 %t1 = icmp ugt i16 %a, %b
53 %t2 = zext i1 %t1 to i16
57 ; CHECK: cmp.w r15, r14
58 ; CHECK: mov.w r2, r15
59 ; CHECK: and.w #1, r15
60 ; CHECK: xor.w #1, r15
62 define i16 @sccwuge(i16 %a, i16 %b) nounwind {
63 %t1 = icmp uge i16 %a, %b
64 %t2 = zext i1 %t1 to i16
68 ; CHECK: cmp.w r14, r15
69 ; CHECK: mov.w r2, r15
70 ; CHECK: and.w #1, r15
72 define i16 @sccwult(i16 %a, i16 %b) nounwind {
73 %t1 = icmp ult i16 %a, %b
74 %t2 = zext i1 %t1 to i16
78 ; CHECK: cmp.w r14, r15
79 ; CHECK: mov.w r2, r15
80 ; CHECK: and.w #1, r15
81 ; CHECK: xor.w #1, r15
83 define i16 @sccwule(i16 %a, i16 %b) nounwind {
84 %t1 = icmp ule i16 %a, %b
85 %t2 = zext i1 %t1 to i16
89 ; CHECK: cmp.w r15, r14
90 ; CHECK: mov.w r2, r15
91 ; CHECK: and.w #1, r15
93 define i16 @sccwsgt(i16 %a, i16 %b) nounwind {
94 %t1 = icmp sgt i16 %a, %b
95 %t2 = zext i1 %t1 to i16
99 define i16 @sccwsge(i16 %a, i16 %b) nounwind {
100 %t1 = icmp sge i16 %a, %b
101 %t2 = zext i1 %t1 to i16
105 define i16 @sccwslt(i16 %a, i16 %b) nounwind {
106 %t1 = icmp slt i16 %a, %b
107 %t2 = zext i1 %t1 to i16
111 define i16 @sccwsle(i16 %a, i16 %b) nounwind {
112 %t1 = icmp sle i16 %a, %b
113 %t2 = zext i1 %t1 to i16