blob: 18d7a439f62ae6d23f508bf192bd2f40242854bc [file] [log] [blame]
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +00001; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +00002; RUN: -check-prefixes=ALL,GP32
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +00003; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +00004; RUN: -check-prefixes=ALL,GP32
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +00005; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +00006; RUN: -check-prefixes=ALL,GP32
Daniel Sanders17793142015-02-18 16:24:50 +00007; RUN: llc < %s -march=mips -mcpu=mips32r3 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +00008; RUN: -check-prefixes=ALL,GP32
Daniel Sanders17793142015-02-18 16:24:50 +00009; RUN: llc < %s -march=mips -mcpu=mips32r5 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000010; RUN: -check-prefixes=ALL,GP32
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000011; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000012; RUN: -check-prefixes=ALL,GP32
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000013; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000014; RUN: -check-prefixes=ALL,GP64
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000015; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000016; RUN: -check-prefixes=ALL,GP64
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000017; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000018; RUN: -check-prefixes=ALL,GP64
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000019; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000020; RUN: -check-prefixes=ALL,GP64
Daniel Sanders17793142015-02-18 16:24:50 +000021; RUN: llc < %s -march=mips64 -mcpu=mips64r3 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000022; RUN: -check-prefixes=ALL,GP64
Daniel Sanders17793142015-02-18 16:24:50 +000023; RUN: llc < %s -march=mips64 -mcpu=mips64r5 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000024; RUN: -check-prefixes=ALL,GP64
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000025; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000026; RUN: -check-prefixes=ALL,GP64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000027; RUN: llc < %s -march=mips -mcpu=mips32r3 -mattr=+micromips | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000028; RUN: -check-prefixes=ALL,MM,MM32
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000029; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000030; RUN: -check-prefixes=ALL,MM,MM32
Daniel Sandersde393322016-06-23 12:42:53 +000031; RUN: llc < %s -march=mips -mcpu=mips64r6 -target-abi n64 -mattr=+micromips | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000032; RUN: -check-prefixes=ALL,MM,MM64
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000033
34define signext i1 @and_i1(i1 signext %a, i1 signext %b) {
35entry:
36; ALL-LABEL: and_i1:
37
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000038 ; GP32: and $2, $4, $5
39
Sanjay Patel2a61a822017-10-09 15:22:20 +000040 ; GP64: and $1, $4, $5
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000041
Sanjay Patel2a61a822017-10-09 15:22:20 +000042 ; MM32: and16 $[[T0:[0-9]+]], $5
43 ; MM32: move $2, $[[T0]]
44
45 ; MM64: and $1, $4, $5
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000046
47 %r = and i1 %a, %b
48 ret i1 %r
49}
50
51define signext i8 @and_i8(i8 signext %a, i8 signext %b) {
52entry:
53; ALL-LABEL: and_i8:
54
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000055 ; GP32: and $2, $4, $5
56
Sanjay Patel2a61a822017-10-09 15:22:20 +000057 ; GP64: and $1, $4, $5
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000058
Sanjay Patel2a61a822017-10-09 15:22:20 +000059 ; MM32: and16 $[[T0:[0-9]+]], $5
60 ; MM32: move $2, $[[T0]]
61
62 ; MM64: and $1, $4, $5
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000063
64 %r = and i8 %a, %b
65 ret i8 %r
66}
67
68define signext i16 @and_i16(i16 signext %a, i16 signext %b) {
69entry:
70; ALL-LABEL: and_i16:
71
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000072 ; GP32: and $2, $4, $5
73
Sanjay Patel2a61a822017-10-09 15:22:20 +000074 ; GP64: and $1, $4, $5
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000075
Sanjay Patel2a61a822017-10-09 15:22:20 +000076 ; MM32: and16 $[[T0:[0-9]+]], $5
77 ; MM32 move $2, $[[T0]]
78
79 ; MM64: and $1, $4, $5
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000080
81 %r = and i16 %a, %b
82 ret i16 %r
83}
84
85define signext i32 @and_i32(i32 signext %a, i32 signext %b) {
86entry:
87; ALL-LABEL: and_i32:
88
Vasileios Kalintiris044e1722015-08-04 14:26:35 +000089 ; GP32: and $2, $4, $5
90
91 ; GP64: and $[[T0:[0-9]+]], $4, $5
92 ; GP64: sll $2, $[[T0]], 0
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +000093
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000094 ; MM32: and16 $[[T0:[0-9]+]], $5
95 ; MM32: move $2, $[[T0]]
96
97 ; MM64: and $[[T0:[0-9]+]], $4, $5
98 ; MM64: sll $2, $[[T0]], 0
99
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +0000100 %r = and i32 %a, %b
101 ret i32 %r
102}
103
104define signext i64 @and_i64(i64 signext %a, i64 signext %b) {
105entry:
106; ALL-LABEL: and_i64:
107
108 ; GP32: and $2, $4, $6
109 ; GP32: and $3, $5, $7
110
111 ; GP64: and $2, $4, $5
112
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000113 ; MM32: and16 $[[T0:[0-9]+]], $6
114 ; MM32: and16 $[[T1:[0-9]+]], $7
115 ; MM32: move $2, $[[T0]]
116 ; MM32: move $3, $[[T1]]
117
118 ; MM64: and $2, $4, $5
119
Vasileios Kalintiris2ed214f2015-01-26 12:04:40 +0000120 %r = and i64 %a, %b
121 ret i64 %r
122}
Vasileios Kalintirisef96a8e2015-01-26 12:33:22 +0000123
124define signext i128 @and_i128(i128 signext %a, i128 signext %b) {
125entry:
126; ALL-LABEL: and_i128:
127
Simon Dardisbd271542016-09-01 14:53:53 +0000128 ; GP32: lw $[[T0:[0-9]+]], 20($sp)
129 ; GP32: lw $[[T1:[0-9]+]], 16($sp)
130 ; GP32: and $2, $4, $[[T1]]
131 ; GP32: and $3, $5, $[[T0]]
132 ; GP32: lw $[[T2:[0-9]+]], 24($sp)
133 ; GP32: and $4, $6, $[[T2]]
Vasileios Kalintirisef96a8e2015-01-26 12:33:22 +0000134 ; GP32: lw $[[T3:[0-9]+]], 28($sp)
135 ; GP32: and $5, $7, $[[T3]]
136
137 ; GP64: and $2, $4, $6
138 ; GP64: and $3, $5, $7
139
Simon Dardisbd271542016-09-01 14:53:53 +0000140 ; MM32: lw $[[T0:[0-9]+]], 20($sp)
141 ; MM32: lw $[[T1:[0-9]+]], 16($sp)
142 ; MM32: and16 $[[T1]], $4
143 ; MM32: and16 $[[T0]], $5
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000144 ; MM32: lw $[[T2:[0-9]+]], 24($sp)
Simon Dardisbd271542016-09-01 14:53:53 +0000145 ; MM32: and16 $[[T2]], $6
146 ; MM32: lw $[[T3:[0-9]+]], 28($sp)
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000147 ; MM32: and16 $[[T3]], $7
148
149 ; MM64: and $2, $4, $6
150 ; MM64: and $3, $5, $7
151
Vasileios Kalintirisef96a8e2015-01-26 12:33:22 +0000152 %r = and i128 %a, %b
153 ret i128 %r
154}
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000155
156define signext i1 @and_i1_4(i1 signext %b) {
157entry:
158; ALL-LABEL: and_i1_4:
159
160 ; GP32: addiu $2, $zero, 0
161
162 ; GP64: addiu $2, $zero, 0
163
Simon Dardis61897522016-07-25 09:57:28 +0000164 ; MM: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000165
166 %r = and i1 4, %b
167 ret i1 %r
168}
169
170define signext i8 @and_i8_4(i8 signext %b) {
171entry:
172; ALL-LABEL: and_i8_4:
173
174 ; GP32: andi $2, $4, 4
175
176 ; GP64: andi $2, $4, 4
177
178 ; MM: andi16 $2, $4, 4
179
180 %r = and i8 4, %b
181 ret i8 %r
182}
183
184define signext i16 @and_i16_4(i16 signext %b) {
185entry:
186; ALL-LABEL: and_i16_4:
187
188 ; GP32: andi $2, $4, 4
189
190 ; GP64: andi $2, $4, 4
191
192 ; MM: andi16 $2, $4, 4
193
194 %r = and i16 4, %b
195 ret i16 %r
196}
197
198define signext i32 @and_i32_4(i32 signext %b) {
199entry:
200; ALL-LABEL: and_i32_4:
201
202 ; GP32: andi $2, $4, 4
203
204 ; GP64: andi $2, $4, 4
205
206 ; MM: andi16 $2, $4, 4
207
208 %r = and i32 4, %b
209 ret i32 %r
210}
211
212define signext i64 @and_i64_4(i64 signext %b) {
213entry:
214; ALL-LABEL: and_i64_4:
215
216 ; GP32: andi $3, $5, 4
217 ; GP32: addiu $2, $zero, 0
218
219 ; GP64: andi $2, $4, 4
220
221 ; MM32: andi16 $3, $5, 4
Simon Dardis61897522016-07-25 09:57:28 +0000222 ; MM32: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000223
224 ; MM64: andi $2, $4, 4
225
226 %r = and i64 4, %b
227 ret i64 %r
228}
229
230define signext i128 @and_i128_4(i128 signext %b) {
231entry:
232; ALL-LABEL: and_i128_4:
233
234 ; GP32: andi $5, $7, 4
235 ; GP32: addiu $2, $zero, 0
236 ; GP32: addiu $3, $zero, 0
237 ; GP32: addiu $4, $zero, 0
238
239 ; GP64: andi $3, $5, 4
240 ; GP64: daddiu $2, $zero, 0
241
242 ; MM32: andi16 $5, $7, 4
Simon Dardis61897522016-07-25 09:57:28 +0000243 ; MM32: li16 $2, 0
244 ; MM32: li16 $3, 0
245 ; MM32: li16 $4, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000246
247 ; MM64: andi $3, $5, 4
248 ; MM64: daddiu $2, $zero, 0
249
250 %r = and i128 4, %b
251 ret i128 %r
252}
253
254define signext i1 @and_i1_31(i1 signext %b) {
255entry:
256; ALL-LABEL: and_i1_31:
257
258 ; ALL: move $2, $4
259
260 %r = and i1 31, %b
261 ret i1 %r
262}
263
264define signext i8 @and_i8_31(i8 signext %b) {
265entry:
266; ALL-LABEL: and_i8_31:
267
268 ; GP32: andi $2, $4, 31
269
270 ; GP64: andi $2, $4, 31
271
272 ; MM: andi16 $2, $4, 31
273
274 %r = and i8 31, %b
275 ret i8 %r
276}
277
278define signext i16 @and_i16_31(i16 signext %b) {
279entry:
280; ALL-LABEL: and_i16_31:
281
282 ; GP32: andi $2, $4, 31
283
284 ; GP64: andi $2, $4, 31
285
286 ; MM: andi16 $2, $4, 31
287
288 %r = and i16 31, %b
289 ret i16 %r
290}
291
292define signext i32 @and_i32_31(i32 signext %b) {
293entry:
294; ALL-LABEL: and_i32_31:
295
296 ; GP32: andi $2, $4, 31
297
298 ; GP64: andi $2, $4, 31
299
300 ; MM: andi16 $2, $4, 31
301
302 %r = and i32 31, %b
303 ret i32 %r
304}
305
306define signext i64 @and_i64_31(i64 signext %b) {
307entry:
308; ALL-LABEL: and_i64_31:
309
310 ; GP32: andi $3, $5, 31
311 ; GP32: addiu $2, $zero, 0
312
313 ; GP64: andi $2, $4, 31
314
315 ; MM32: andi16 $3, $5, 31
Simon Dardis61897522016-07-25 09:57:28 +0000316 ; MM32: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000317
318 ; MM64: andi $2, $4, 31
319
320 %r = and i64 31, %b
321 ret i64 %r
322}
323
324define signext i128 @and_i128_31(i128 signext %b) {
325entry:
326; ALL-LABEL: and_i128_31:
327
328 ; GP32: andi $5, $7, 31
329 ; GP32: addiu $2, $zero, 0
330 ; GP32: addiu $3, $zero, 0
331 ; GP32: addiu $4, $zero, 0
332
333 ; GP64: andi $3, $5, 31
334 ; GP64: daddiu $2, $zero, 0
335
336 ; MM32: andi16 $5, $7, 31
Simon Dardis61897522016-07-25 09:57:28 +0000337 ; MM32: li16 $2, 0
338 ; MM32: li16 $3, 0
339 ; MM32: li16 $4, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000340
341 ; MM64: andi $3, $5, 31
342 ; MM64: daddiu $2, $zero, 0
343
344 %r = and i128 31, %b
345 ret i128 %r
346}
347
348define signext i1 @and_i1_255(i1 signext %b) {
349entry:
350; ALL-LABEL: and_i1_255:
351
352 ; ALL: move $2, $4
353
354 %r = and i1 255, %b
355 ret i1 %r
356}
357
358define signext i8 @and_i8_255(i8 signext %b) {
359entry:
360; ALL-LABEL: and_i8_255:
361
362 ; ALL: move $2, $4
363
364 %r = and i8 255, %b
365 ret i8 %r
366}
367
368define signext i16 @and_i16_255(i16 signext %b) {
369entry:
370; ALL-LABEL: and_i16_255:
371
372 ; GP32: andi $2, $4, 255
373
374 ; GP64: andi $2, $4, 255
375
376 ; MM: andi16 $2, $4, 255
377
378 %r = and i16 255, %b
379 ret i16 %r
380}
381
382define signext i32 @and_i32_255(i32 signext %b) {
383entry:
384; ALL-LABEL: and_i32_255:
385
386 ; GP32: andi $2, $4, 255
387
388 ; GP64: andi $2, $4, 255
389
390 ; MM: andi16 $2, $4, 255
391
392 %r = and i32 255, %b
393 ret i32 %r
394}
395
396define signext i64 @and_i64_255(i64 signext %b) {
397entry:
398; ALL-LABEL: and_i64_255:
399
400 ; GP32: andi $3, $5, 255
401 ; GP32: addiu $2, $zero, 0
402
403 ; GP64: andi $2, $4, 255
404
405 ; MM32: andi16 $3, $5, 255
Simon Dardis61897522016-07-25 09:57:28 +0000406 ; MM32: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000407
408 ; MM64: andi $2, $4, 255
409
410 %r = and i64 255, %b
411 ret i64 %r
412}
413
414define signext i128 @and_i128_255(i128 signext %b) {
415entry:
416; ALL-LABEL: and_i128_255:
417
418 ; GP32: andi $5, $7, 255
419 ; GP32: addiu $2, $zero, 0
420 ; GP32: addiu $3, $zero, 0
421 ; GP32: addiu $4, $zero, 0
422
423 ; GP64: andi $3, $5, 255
424 ; GP64: daddiu $2, $zero, 0
425
426 ; MM32: andi16 $5, $7, 255
Simon Dardis61897522016-07-25 09:57:28 +0000427 ; MM32: li16 $2, 0
428 ; MM32: li16 $3, 0
429 ; MM32: li16 $4, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000430
431 ; MM64: andi $3, $5, 255
432 ; MM64: daddiu $2, $zero, 0
433
434 %r = and i128 255, %b
435 ret i128 %r
436}
437
438define signext i1 @and_i1_32768(i1 signext %b) {
439entry:
440; ALL-LABEL: and_i1_32768:
441
442 ; GP32: addiu $2, $zero, 0
443
444 ; GP64: addiu $2, $zero, 0
445
Simon Dardis61897522016-07-25 09:57:28 +0000446 ; MM: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000447
448 %r = and i1 32768, %b
449 ret i1 %r
450}
451
452define signext i8 @and_i8_32768(i8 signext %b) {
453entry:
454; ALL-LABEL: and_i8_32768:
455
456 ; GP32: addiu $2, $zero, 0
457
458 ; GP64: addiu $2, $zero, 0
459
Simon Dardis61897522016-07-25 09:57:28 +0000460 ; MM: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000461
462 %r = and i8 32768, %b
463 ret i8 %r
464}
465
466define signext i16 @and_i16_32768(i16 signext %b) {
467entry:
468; ALL-LABEL: and_i16_32768:
469
470 ; GP32: addiu $[[T0:[0-9]+]], $zero, -32768
471 ; GP32: and $2, $4, $[[T0]]
472
473 ; GP64: addiu $[[T0:[0-9]+]], $zero, -32768
474 ; GP64: and $2, $4, $[[T0]]
475
476 ; MM: addiu $2, $zero, -32768
477 ; MM: and16 $2, $4
478
479 %r = and i16 32768, %b
480 ret i16 %r
481}
482
483define signext i32 @and_i32_32768(i32 signext %b) {
484entry:
485; ALL-LABEL: and_i32_32768:
486
487 ; GP32: andi $2, $4, 32768
488
489 ; GP64: andi $2, $4, 32768
490
491 ; MM: andi16 $2, $4, 32768
492
493 %r = and i32 32768, %b
494 ret i32 %r
495}
496
497define signext i64 @and_i64_32768(i64 signext %b) {
498entry:
499; ALL-LABEL: and_i64_32768:
500
501 ; GP32: andi $3, $5, 32768
502 ; GP32: addiu $2, $zero, 0
503
504 ; GP64: andi $2, $4, 32768
505
506 ; MM32: andi16 $3, $5, 32768
Simon Dardis61897522016-07-25 09:57:28 +0000507 ; MM32: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000508
509 ; MM64: andi $2, $4, 32768
510
511 %r = and i64 32768, %b
512 ret i64 %r
513}
514
515define signext i128 @and_i128_32768(i128 signext %b) {
516entry:
517; ALL-LABEL: and_i128_32768:
518
519 ; GP32: andi $5, $7, 32768
520 ; GP32: addiu $2, $zero, 0
521 ; GP32: addiu $3, $zero, 0
522 ; GP32: addiu $4, $zero, 0
523
524 ; GP64: andi $3, $5, 32768
525 ; GP64: daddiu $2, $zero, 0
526
527 ; MM32: andi16 $5, $7, 32768
Simon Dardis61897522016-07-25 09:57:28 +0000528 ; MM32: li16 $2, 0
529 ; MM32: li16 $3, 0
530 ; MM32: li16 $4, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000531
532 ; MM64: andi $3, $5, 32768
533 ; MM64: daddiu $2, $zero, 0
534
535 %r = and i128 32768, %b
536 ret i128 %r
537}
538
539define signext i1 @and_i1_65(i1 signext %b) {
540entry:
541; ALL-LABEL: and_i1_65:
542
543 ; ALL: move $2, $4
544
545 %r = and i1 65, %b
546 ret i1 %r
547}
548
549define signext i8 @and_i8_65(i8 signext %b) {
550entry:
551; ALL-LABEL: and_i8_65:
552
553 ; ALL: andi $2, $4, 65
554
555 %r = and i8 65, %b
556 ret i8 %r
557}
558
559define signext i16 @and_i16_65(i16 signext %b) {
560entry:
561; ALL-LABEL: and_i16_65:
562
563 ; ALL: andi $2, $4, 65
564
565 %r = and i16 65, %b
566 ret i16 %r
567}
568
569define signext i32 @and_i32_65(i32 signext %b) {
570entry:
571; ALL-LABEL: and_i32_65:
572
573 ; ALL: andi $2, $4, 65
574
575 %r = and i32 65, %b
576 ret i32 %r
577}
578
579define signext i64 @and_i64_65(i64 signext %b) {
580entry:
581; ALL-LABEL: and_i64_65:
582
583 ; GP32: andi $3, $5, 65
584 ; GP32: addiu $2, $zero, 0
585
586 ; GP64: andi $2, $4, 65
587
Simon Dardis61897522016-07-25 09:57:28 +0000588 ; MM32-DAG: andi $3, $5, 65
589 ; MM32-DAG: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000590
591 ; MM64: andi $2, $4, 65
592
593 %r = and i64 65, %b
594 ret i64 %r
595}
596
597define signext i128 @and_i128_65(i128 signext %b) {
598entry:
599; ALL-LABEL: and_i128_65:
600
601 ; GP32: andi $5, $7, 65
602 ; GP32: addiu $2, $zero, 0
603 ; GP32: addiu $3, $zero, 0
604 ; GP32: addiu $4, $zero, 0
605
606 ; GP64: andi $3, $5, 65
607 ; GP64: daddiu $2, $zero, 0
608
Simon Dardis61897522016-07-25 09:57:28 +0000609 ; MM32-DAG: andi $5, $7, 65
610 ; MM32-DAG: li16 $2, 0
611 ; MM32-DAG: li16 $3, 0
612 ; MM32-DAG: li16 $4, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000613
614 ; MM64: andi $3, $5, 65
615 ; MM64: daddiu $2, $zero, 0
616
617 %r = and i128 65, %b
618 ret i128 %r
619}
620
621define signext i1 @and_i1_256(i1 signext %b) {
622entry:
623; ALL-LABEL: and_i1_256:
624
625 ; GP32: addiu $2, $zero, 0
626
627 ; GP64: addiu $2, $zero, 0
628
Simon Dardis61897522016-07-25 09:57:28 +0000629 ; MM: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000630
631 %r = and i1 256, %b
632 ret i1 %r
633}
634
635define signext i8 @and_i8_256(i8 signext %b) {
636entry:
637; ALL-LABEL: and_i8_256:
638
639 ; GP32: addiu $2, $zero, 0
640
641 ; GP64: addiu $2, $zero, 0
642
Simon Dardis61897522016-07-25 09:57:28 +0000643 ; MM: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000644
645 %r = and i8 256, %b
646 ret i8 %r
647}
648
649define signext i16 @and_i16_256(i16 signext %b) {
650entry:
651; ALL-LABEL: and_i16_256:
652
653 ; ALL: andi $2, $4, 256
654
655 %r = and i16 256, %b
656 ret i16 %r
657}
658
659define signext i32 @and_i32_256(i32 signext %b) {
660entry:
661; ALL-LABEL: and_i32_256:
662
663 ; ALL: andi $2, $4, 256
664
665 %r = and i32 256, %b
666 ret i32 %r
667}
668
669define signext i64 @and_i64_256(i64 signext %b) {
670entry:
671; ALL-LABEL: and_i64_256:
672
673 ; GP32: andi $3, $5, 256
674 ; GP32: addiu $2, $zero, 0
675
676 ; GP64: andi $2, $4, 256
677
Simon Dardis61897522016-07-25 09:57:28 +0000678 ; MM32-DAG: andi $3, $5, 256
679 ; MM32-DAG: li16 $2, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000680
681 ; MM64: andi $2, $4, 256
682
683 %r = and i64 256, %b
684 ret i64 %r
685}
686
687define signext i128 @and_i128_256(i128 signext %b) {
688entry:
689; ALL-LABEL: and_i128_256:
690
691 ; GP32: andi $5, $7, 256
692 ; GP32: addiu $2, $zero, 0
693 ; GP32: addiu $3, $zero, 0
694 ; GP32: addiu $4, $zero, 0
695
696 ; GP64: andi $3, $5, 256
697 ; GP64: daddiu $2, $zero, 0
698
Simon Dardis61897522016-07-25 09:57:28 +0000699 ; MM32-DAG: andi $5, $7, 256
700 ; MM32-DAG: li16 $2, 0
701 ; MM32-DAG: li16 $3, 0
702 ; MM32-DAG: li16 $4, 0
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000703
704 ; MM64: andi $3, $5, 256
705 ; MM64: daddiu $2, $zero, 0
706
707 %r = and i128 256, %b
708 ret i128 %r
709}