1 ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
2 ; RUN: grep and %t1.s | count 234
3 ; RUN: grep andc %t1.s | count 85
4 ; RUN: grep andi %t1.s | count 37
5 ; RUN: grep andhi %t1.s | count 30
6 ; RUN: grep andbi %t1.s | count 4
8 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
11 ; AND instruction generation:
12 define <4 x i32> @and_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
13 %A = and <4 x i32> %arg1, %arg2
17 define <4 x i32> @and_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
18 %A = and <4 x i32> %arg2, %arg1
22 define <8 x i16> @and_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
23 %A = and <8 x i16> %arg1, %arg2
27 define <8 x i16> @and_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
28 %A = and <8 x i16> %arg2, %arg1
32 define <16 x i8> @and_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
33 %A = and <16 x i8> %arg2, %arg1
37 define <16 x i8> @and_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
38 %A = and <16 x i8> %arg1, %arg2
42 define i32 @and_i32_1(i32 %arg1, i32 %arg2) {
43 %A = and i32 %arg2, %arg1
47 define i32 @and_i32_2(i32 %arg1, i32 %arg2) {
48 %A = and i32 %arg1, %arg2
52 define i16 @and_i16_1(i16 %arg1, i16 %arg2) {
53 %A = and i16 %arg2, %arg1
57 define i16 @and_i16_2(i16 %arg1, i16 %arg2) {
58 %A = and i16 %arg1, %arg2
62 define i8 @and_i8_1(i8 %arg1, i8 %arg2) {
63 %A = and i8 %arg2, %arg1
67 define i8 @and_i8_2(i8 %arg1, i8 %arg2) {
68 %A = and i8 %arg1, %arg2
72 ; ANDC instruction generation:
73 define <4 x i32> @andc_v4i32_1(<4 x i32> %arg1, <4 x i32> %arg2) {
74 %A = xor <4 x i32> %arg2, < i32 -1, i32 -1, i32 -1, i32 -1 >
75 %B = and <4 x i32> %arg1, %A
79 define <4 x i32> @andc_v4i32_2(<4 x i32> %arg1, <4 x i32> %arg2) {
80 %A = xor <4 x i32> %arg1, < i32 -1, i32 -1, i32 -1, i32 -1 >
81 %B = and <4 x i32> %arg2, %A
85 define <4 x i32> @andc_v4i32_3(<4 x i32> %arg1, <4 x i32> %arg2) {
86 %A = xor <4 x i32> %arg1, < i32 -1, i32 -1, i32 -1, i32 -1 >
87 %B = and <4 x i32> %A, %arg2
91 define <8 x i16> @andc_v8i16_1(<8 x i16> %arg1, <8 x i16> %arg2) {
92 %A = xor <8 x i16> %arg2, < i16 -1, i16 -1, i16 -1, i16 -1,
93 i16 -1, i16 -1, i16 -1, i16 -1 >
94 %B = and <8 x i16> %arg1, %A
98 define <8 x i16> @andc_v8i16_2(<8 x i16> %arg1, <8 x i16> %arg2) {
99 %A = xor <8 x i16> %arg1, < i16 -1, i16 -1, i16 -1, i16 -1,
100 i16 -1, i16 -1, i16 -1, i16 -1 >
101 %B = and <8 x i16> %arg2, %A
105 define <16 x i8> @andc_v16i8_1(<16 x i8> %arg1, <16 x i8> %arg2) {
106 %A = xor <16 x i8> %arg1, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
107 i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
108 i8 -1, i8 -1, i8 -1, i8 -1 >
109 %B = and <16 x i8> %arg2, %A
113 define <16 x i8> @andc_v16i8_2(<16 x i8> %arg1, <16 x i8> %arg2) {
114 %A = xor <16 x i8> %arg2, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
115 i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
116 i8 -1, i8 -1, i8 -1, i8 -1 >
117 %B = and <16 x i8> %arg1, %A
121 define <16 x i8> @andc_v16i8_3(<16 x i8> %arg1, <16 x i8> %arg2) {
122 %A = xor <16 x i8> %arg2, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
123 i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
124 i8 -1, i8 -1, i8 -1, i8 -1 >
125 %B = and <16 x i8> %A, %arg1
129 define i32 @andc_i32_1(i32 %arg1, i32 %arg2) {
130 %A = xor i32 %arg2, -1
131 %B = and i32 %A, %arg1
135 define i32 @andc_i32_2(i32 %arg1, i32 %arg2) {
136 %A = xor i32 %arg1, -1
137 %B = and i32 %A, %arg2
141 define i32 @andc_i32_3(i32 %arg1, i32 %arg2) {
142 %A = xor i32 %arg2, -1
143 %B = and i32 %arg1, %A
147 define i16 @andc_i16_1(i16 %arg1, i16 %arg2) {
148 %A = xor i16 %arg2, -1
149 %B = and i16 %A, %arg1
153 define i16 @andc_i16_2(i16 %arg1, i16 %arg2) {
154 %A = xor i16 %arg1, -1
155 %B = and i16 %A, %arg2
159 define i16 @andc_i16_3(i16 %arg1, i16 %arg2) {
160 %A = xor i16 %arg2, -1
161 %B = and i16 %arg1, %A
165 define i8 @andc_i8_1(i8 %arg1, i8 %arg2) {
166 %A = xor i8 %arg2, -1
167 %B = and i8 %A, %arg1
171 define i8 @andc_i8_2(i8 %arg1, i8 %arg2) {
172 %A = xor i8 %arg1, -1
173 %B = and i8 %A, %arg2
177 define i8 @andc_i8_3(i8 %arg1, i8 %arg2) {
178 %A = xor i8 %arg2, -1
179 %B = and i8 %arg1, %A
183 ; ANDI instruction generation (i32 data type):
184 define <4 x i32> @andi_v4i32_1(<4 x i32> %in) {
185 %tmp2 = and <4 x i32> %in, < i32 511, i32 511, i32 511, i32 511 >
189 define <4 x i32> @andi_v4i32_2(<4 x i32> %in) {
190 %tmp2 = and <4 x i32> %in, < i32 510, i32 510, i32 510, i32 510 >
194 define <4 x i32> @andi_v4i32_3(<4 x i32> %in) {
195 %tmp2 = and <4 x i32> %in, < i32 -1, i32 -1, i32 -1, i32 -1 >
199 define <4 x i32> @andi_v4i32_4(<4 x i32> %in) {
200 %tmp2 = and <4 x i32> %in, < i32 -512, i32 -512, i32 -512, i32 -512 >
204 define i32 @andi_u32(i32 zeroext %in) zeroext {
205 %tmp37 = and i32 %in, 37
209 define i32 @andi_i32(i32 signext %in) signext {
210 %tmp38 = and i32 %in, 37
214 define i32 @andi_i32_1(i32 %in) {
215 %tmp37 = and i32 %in, 37
219 ; ANDHI instruction generation (i16 data type):
220 define <8 x i16> @andhi_v8i16_1(<8 x i16> %in) {
221 %tmp2 = and <8 x i16> %in, < i16 511, i16 511, i16 511, i16 511,
222 i16 511, i16 511, i16 511, i16 511 >
226 define <8 x i16> @andhi_v8i16_2(<8 x i16> %in) {
227 %tmp2 = and <8 x i16> %in, < i16 510, i16 510, i16 510, i16 510,
228 i16 510, i16 510, i16 510, i16 510 >
232 define <8 x i16> @andhi_v8i16_3(<8 x i16> %in) {
233 %tmp2 = and <8 x i16> %in, < i16 -1, i16 -1, i16 -1, i16 -1, i16 -1,
234 i16 -1, i16 -1, i16 -1 >
238 define <8 x i16> @andhi_v8i16_4(<8 x i16> %in) {
239 %tmp2 = and <8 x i16> %in, < i16 -512, i16 -512, i16 -512, i16 -512,
240 i16 -512, i16 -512, i16 -512, i16 -512 >
244 define i16 @andhi_u16(i16 zeroext %in) zeroext {
245 %tmp37 = and i16 %in, 37 ; <i16> [#uses=1]
249 define i16 @andhi_i16(i16 signext %in) signext {
250 %tmp38 = and i16 %in, 37 ; <i16> [#uses=1]
254 ; i8 data type (s/b ANDBI if 8-bit registers were supported):
255 define <16 x i8> @and_v16i8(<16 x i8> %in) {
256 ; ANDBI generated for vector types
257 %tmp2 = and <16 x i8> %in, < i8 42, i8 42, i8 42, i8 42, i8 42, i8 42,
258 i8 42, i8 42, i8 42, i8 42, i8 42, i8 42,
259 i8 42, i8 42, i8 42, i8 42 >
263 define i8 @and_u8(i8 zeroext %in) zeroext {
265 %tmp37 = and i8 %in, 37
269 define i8 @and_sext8(i8 signext %in) signext {
271 %tmp38 = and i8 %in, 37
275 define i8 @and_i8(i8 %in) {
277 %tmp38 = and i8 %in, 205