Debian Codegraph @

llvm/test/CodeGen/MSP430/bit.ll

raw
1 ; RUN: llc < %s -mtriple=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"
4
5 @foo8 = external global i8
6 @bar8 = external global i8
7
8 define i8 @bitbrr(i8 %a, i8 %b) nounwind {
9 %t1 = and i8 %a, %b
10 %t2 = icmp ne i8 %t1, 0
11 %t3 = zext i1 %t2 to i8
12 ret i8 %t3
13 }
14 ; CHECK-LABEL: bitbrr:
15 ; CHECK: bit.b r13, r12
16
17 define i8 @bitbri(i8 %a) nounwind {
18 %t1 = and i8 %a, 15
19 %t2 = icmp ne i8 %t1, 0
20 %t3 = zext i1 %t2 to i8
21 ret i8 %t3
22 }
23 ; CHECK-LABEL: bitbri:
24 ; CHECK: bit.b #15, r12
25
26 define i8 @bitbir(i8 %a) nounwind {
27 %t1 = and i8 15, %a
28 %t2 = icmp ne i8 %t1, 0
29 %t3 = zext i1 %t2 to i8
30 ret i8 %t3
31 }
32 ; CHECK-LABEL: bitbir:
33 ; CHECK: bit.b #15, r12
34
35 define i8 @bitbmi() nounwind {
36 %t1 = load i8, ptr @foo8
37 %t2 = and i8 %t1, 15
38 %t3 = icmp ne i8 %t2, 0
39 %t4 = zext i1 %t3 to i8
40 ret i8 %t4
41 }
42 ; CHECK-LABEL: bitbmi:
43 ; CHECK: bit.b #15, &foo8
44
45 define i8 @bitbim() nounwind {
46 %t1 = load i8, ptr @foo8
47 %t2 = and i8 15, %t1
48 %t3 = icmp ne i8 %t2, 0
49 %t4 = zext i1 %t3 to i8
50 ret i8 %t4
51 }
52 ; CHECK-LABEL: bitbim:
53 ; CHECK: bit.b #15, &foo8
54
55 define i8 @bitbrm(i8 %a) nounwind {
56 %t1 = load i8, ptr @foo8
57 %t2 = and i8 %a, %t1
58 %t3 = icmp ne i8 %t2, 0
59 %t4 = zext i1 %t3 to i8
60 ret i8 %t4
61 }
62 ; CHECK-LABEL: bitbrm:
63 ; CHECK: bit.b &foo8, r12
64
65 define i8 @bitbmr(i8 %a) nounwind {
66 %t1 = load i8, ptr @foo8
67 %t2 = and i8 %t1, %a
68 %t3 = icmp ne i8 %t2, 0
69 %t4 = zext i1 %t3 to i8
70 ret i8 %t4
71 }
72 ; CHECK-LABEL: bitbmr:
73 ; CHECK: bit.b r12, &foo8
74
75 define i8 @bitbmm() nounwind {
76 %t1 = load i8, ptr @foo8
77 %t2 = load i8, ptr @bar8
78 %t3 = and i8 %t1, %t2
79 %t4 = icmp ne i8 %t3, 0
80 %t5 = zext i1 %t4 to i8
81 ret i8 %t5
82 }
83 ; CHECK-LABEL: bitbmm:
84 ; CHECK: bit.b &bar8, &foo8
85
86 @foo16 = external global i16
87 @bar16 = external global i16
88
89 define i16 @bitwrr(i16 %a, i16 %b) nounwind {
90 %t1 = and i16 %a, %b
91 %t2 = icmp ne i16 %t1, 0
92 %t3 = zext i1 %t2 to i16
93 ret i16 %t3
94 }
95 ; CHECK-LABEL: bitwrr:
96 ; CHECK: bit r13, r12
97
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
102 ret i16 %t3
103 }
104 ; CHECK-LABEL: bitwri:
105 ; CHECK: bit #4080, r12
106
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
111 ret i16 %t3
112 }
113 ; CHECK-LABEL: bitwir:
114 ; CHECK: bit #4080, r12
115
116 define i16 @bitwmi() nounwind {
117 %t1 = load i16, ptr @foo16
118 %t2 = and i16 %t1, 4080
119 %t3 = icmp ne i16 %t2, 0
120 %t4 = zext i1 %t3 to i16
121 ret i16 %t4
122 }
123 ; CHECK-LABEL: bitwmi:
124 ; CHECK: bit #4080, &foo16
125
126 define i16 @bitwim() nounwind {
127 %t1 = load i16, ptr @foo16
128 %t2 = and i16 4080, %t1
129 %t3 = icmp ne i16 %t2, 0
130 %t4 = zext i1 %t3 to i16
131 ret i16 %t4
132 }
133 ; CHECK-LABEL: bitwim:
134 ; CHECK: bit #4080, &foo16
135
136 define i16 @bitwrm(i16 %a) nounwind {
137 %t1 = load i16, ptr @foo16
138 %t2 = and i16 %a, %t1
139 %t3 = icmp ne i16 %t2, 0
140 %t4 = zext i1 %t3 to i16
141 ret i16 %t4
142 }
143 ; CHECK-LABEL: bitwrm:
144 ; CHECK: bit &foo16, r12
145
146 define i16 @bitwmr(i16 %a) nounwind {
147 %t1 = load i16, ptr @foo16
148 %t2 = and i16 %t1, %a
149 %t3 = icmp ne i16 %t2, 0
150 %t4 = zext i1 %t3 to i16
151 ret i16 %t4
152 }
153 ; CHECK-LABEL: bitwmr:
154 ; CHECK: bit r12, &foo16
155
156 define i16 @bitwmm() nounwind {
157 %t1 = load i16, ptr @foo16
158 %t2 = load i16, ptr @bar16
159 %t3 = and i16 %t1, %t2
160 %t4 = icmp ne i16 %t3, 0
161 %t5 = zext i1 %t4 to i16
162 ret i16 %t5
163 }
164 ; CHECK-LABEL: bitwmm:
165 ; CHECK: bit &bar16, &foo16
166