1 ; RUN: llc < %s -march=msp430 | 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 @foo8 = external global i8
6 @bar8 = external global i8
8 define i8 @bitbrr(i8 %a, i8 %b) nounwind {
10 %t2 = icmp ne i8 %t1, 0
11 %t3 = zext i1 %t2 to i8
14 ; CHECK-LABEL: bitbrr:
15 ; CHECK: bit.b r13, r12
17 define i8 @bitbri(i8 %a) nounwind {
19 %t2 = icmp ne i8 %t1, 0
20 %t3 = zext i1 %t2 to i8
23 ; CHECK-LABEL: bitbri:
24 ; CHECK: bit.b #15, r12
26 define i8 @bitbir(i8 %a) nounwind {
28 %t2 = icmp ne i8 %t1, 0
29 %t3 = zext i1 %t2 to i8
32 ; CHECK-LABEL: bitbir:
33 ; CHECK: bit.b #15, r12
35 define i8 @bitbmi() nounwind {
36 %t1 = load i8, i8* @foo8
38 %t3 = icmp ne i8 %t2, 0
39 %t4 = zext i1 %t3 to i8
42 ; CHECK-LABEL: bitbmi:
43 ; CHECK: bit.b #15, &foo8
45 define i8 @bitbim() nounwind {
46 %t1 = load i8, i8* @foo8
48 %t3 = icmp ne i8 %t2, 0
49 %t4 = zext i1 %t3 to i8
52 ; CHECK-LABEL: bitbim:
53 ; CHECK: bit.b #15, &foo8
55 define i8 @bitbrm(i8 %a) nounwind {
56 %t1 = load i8, i8* @foo8
58 %t3 = icmp ne i8 %t2, 0
59 %t4 = zext i1 %t3 to i8
62 ; CHECK-LABEL: bitbrm:
63 ; CHECK: bit.b &foo8, r12
65 define i8 @bitbmr(i8 %a) nounwind {
66 %t1 = load i8, i8* @foo8
68 %t3 = icmp ne i8 %t2, 0
69 %t4 = zext i1 %t3 to i8
72 ; CHECK-LABEL: bitbmr:
73 ; CHECK: bit.b r12, &foo8
75 define i8 @bitbmm() nounwind {
76 %t1 = load i8, i8* @foo8
77 %t2 = load i8, i8* @bar8
79 %t4 = icmp ne i8 %t3, 0
80 %t5 = zext i1 %t4 to i8
83 ; CHECK-LABEL: bitbmm:
84 ; CHECK: bit.b &bar8, &foo8
86 @foo16 = external global i16
87 @bar16 = external global i16
89 define i16 @bitwrr(i16 %a, i16 %b) nounwind {
91 %t2 = icmp ne i16 %t1, 0
92 %t3 = zext i1 %t2 to i16
95 ; CHECK-LABEL: bitwrr:
98 define i16 @bitwri(i16 %a) nounwind {
99 %t1 = and i16 %a, 4080
100 %t2 = icmp ne i16 %t1, 0
101 %t3 = zext i1 %t2 to i16
104 ; CHECK-LABEL: bitwri:
105 ; CHECK: bit #4080, r12
107 define i16 @bitwir(i16 %a) nounwind {
108 %t1 = and i16 4080, %a
109 %t2 = icmp ne i16 %t1, 0
110 %t3 = zext i1 %t2 to i16
113 ; CHECK-LABEL: bitwir:
114 ; CHECK: bit #4080, r12
116 define i16 @bitwmi() nounwind {
117 %t1 = load i16, i16* @foo16
118 %t2 = and i16 %t1, 4080
119 %t3 = icmp ne i16 %t2, 0
120 %t4 = zext i1 %t3 to i16
123 ; CHECK-LABEL: bitwmi:
124 ; CHECK: bit #4080, &foo16
126 define i16 @bitwim() nounwind {
127 %t1 = load i16, i16* @foo16
128 %t2 = and i16 4080, %t1
129 %t3 = icmp ne i16 %t2, 0
130 %t4 = zext i1 %t3 to i16
133 ; CHECK-LABEL: bitwim:
134 ; CHECK: bit #4080, &foo16
136 define i16 @bitwrm(i16 %a) nounwind {
137 %t1 = load i16, i16* @foo16
138 %t2 = and i16 %a, %t1
139 %t3 = icmp ne i16 %t2, 0
140 %t4 = zext i1 %t3 to i16
143 ; CHECK-LABEL: bitwrm:
144 ; CHECK: bit &foo16, r12
146 define i16 @bitwmr(i16 %a) nounwind {
147 %t1 = load i16, i16* @foo16
148 %t2 = and i16 %t1, %a
149 %t3 = icmp ne i16 %t2, 0
150 %t4 = zext i1 %t3 to i16
153 ; CHECK-LABEL: bitwmr:
154 ; CHECK: bit r12, &foo16
156 define i16 @bitwmm() nounwind {
157 %t1 = load i16, i16* @foo16
158 %t2 = load i16, i16* @bar16
159 %t3 = and i16 %t1, %t2
160 %t4 = icmp ne i16 %t3, 0
161 %t5 = zext i1 %t4 to i16
164 ; CHECK-LABEL: bitwmm:
165 ; CHECK: bit &bar16, &foo16