1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky -mattr=+2e3 | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky | FileCheck %s --check-prefix=GENERIC
6 define i1 @icmpRR_eq(i32 %x, i32 %y) {
7 ; CHECK-LABEL: icmpRR_eq:
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: cmpne16 a1, a0
10 ; CHECK-NEXT: mvcv16 a0
13 ; GENERIC-LABEL: icmpRR_eq:
14 ; GENERIC: # %bb.0: # %entry
15 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
16 ; GENERIC-NEXT: subi16 sp, sp, 4
17 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
18 ; GENERIC-NEXT: cmpne16 a1, a0
19 ; GENERIC-NEXT: mvcv16 a0
20 ; GENERIC-NEXT: addi16 sp, sp, 4
23 %icmp = icmp eq i32 %y, %x
27 define i1 @icmpRI_eq(i32 %x) {
28 ; CHECK-LABEL: icmpRI_eq:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: cmpnei16 a0, 10
31 ; CHECK-NEXT: mvcv16 a0
34 ; GENERIC-LABEL: icmpRI_eq:
35 ; GENERIC: # %bb.0: # %entry
36 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
37 ; GENERIC-NEXT: subi16 sp, sp, 4
38 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
39 ; GENERIC-NEXT: cmpnei16 a0, 10
40 ; GENERIC-NEXT: mvcv16 a0
41 ; GENERIC-NEXT: addi16 sp, sp, 4
44 %icmp = icmp eq i32 %x, 10
48 define i1 @icmpRI_X_eq(i32 %x) {
49 ; CHECK-LABEL: icmpRI_X_eq:
50 ; CHECK: # %bb.0: # %entry
51 ; CHECK-NEXT: movih32 a1, 62
52 ; CHECK-NEXT: ori32 a1, a1, 33768
53 ; CHECK-NEXT: cmpne16 a0, a1
54 ; CHECK-NEXT: mvcv16 a0
57 ; GENERIC-LABEL: icmpRI_X_eq:
58 ; GENERIC: # %bb.0: # %entry
59 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
60 ; GENERIC-NEXT: subi16 sp, sp, 4
61 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
62 ; GENERIC-NEXT: movi16 a1, 0
63 ; GENERIC-NEXT: lsli16 a1, a1, 24
64 ; GENERIC-NEXT: movi16 a2, 62
65 ; GENERIC-NEXT: lsli16 a2, a2, 16
66 ; GENERIC-NEXT: or16 a2, a1
67 ; GENERIC-NEXT: movi16 a1, 131
68 ; GENERIC-NEXT: lsli16 a1, a1, 8
69 ; GENERIC-NEXT: or16 a1, a2
70 ; GENERIC-NEXT: movi16 a2, 232
71 ; GENERIC-NEXT: or16 a2, a1
72 ; GENERIC-NEXT: cmpne16 a0, a2
73 ; GENERIC-NEXT: mvcv16 a0
74 ; GENERIC-NEXT: addi16 sp, sp, 4
77 %icmp = icmp eq i32 %x, 4097000
81 define i1 @icmpRI_AND_ne(i32 %x) {
82 ; CHECK-LABEL: icmpRI_AND_ne:
83 ; CHECK: # %bb.0: # %entry
84 ; CHECK-NEXT: btsti16 a0, 15
85 ; CHECK-NEXT: mvc32 a0
88 ; GENERIC-LABEL: icmpRI_AND_ne:
89 ; GENERIC: # %bb.0: # %entry
90 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
91 ; GENERIC-NEXT: subi16 sp, sp, 4
92 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
93 ; GENERIC-NEXT: movi16 a1, 0
94 ; GENERIC-NEXT: lsli16 a2, a1, 24
95 ; GENERIC-NEXT: lsli16 a3, a1, 16
96 ; GENERIC-NEXT: or16 a3, a2
97 ; GENERIC-NEXT: movi16 a2, 128
98 ; GENERIC-NEXT: lsli16 a2, a2, 8
99 ; GENERIC-NEXT: or16 a2, a3
100 ; GENERIC-NEXT: or16 a2, a1
101 ; GENERIC-NEXT: and16 a2, a0
102 ; GENERIC-NEXT: cmpnei16 a2, 0
103 ; GENERIC-NEXT: mvcv16 a1
104 ; GENERIC-NEXT: movi16 a0, 1
105 ; GENERIC-NEXT: subu16 a0, a1
106 ; GENERIC-NEXT: addi16 sp, sp, 4
107 ; GENERIC-NEXT: rts16
109 %and = and i32 %x, 32768
110 %icmp = icmp ne i32 %and, 0
114 define i1 @ICMP_LONG_eq(i64 %x, i64 %y) {
115 ; CHECK-LABEL: ICMP_LONG_eq:
116 ; CHECK: # %bb.0: # %entry
117 ; CHECK-NEXT: xor16 a1, a3
118 ; CHECK-NEXT: xor16 a0, a2
119 ; CHECK-NEXT: or16 a0, a1
120 ; CHECK-NEXT: cmpnei16 a0, 0
121 ; CHECK-NEXT: mvcv16 a0
124 ; GENERIC-LABEL: ICMP_LONG_eq:
125 ; GENERIC: # %bb.0: # %entry
126 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
127 ; GENERIC-NEXT: subi16 sp, sp, 4
128 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
129 ; GENERIC-NEXT: xor16 a1, a3
130 ; GENERIC-NEXT: xor16 a0, a2
131 ; GENERIC-NEXT: or16 a0, a1
132 ; GENERIC-NEXT: cmpnei16 a0, 0
133 ; GENERIC-NEXT: mvcv16 a0
134 ; GENERIC-NEXT: addi16 sp, sp, 4
135 ; GENERIC-NEXT: rts16
137 %icmp = icmp eq i64 %y, %x
141 define i1 @ICMP_LONG_I_eq(i64 %x) {
142 ; CHECK-LABEL: ICMP_LONG_I_eq:
143 ; CHECK: # %bb.0: # %entry
144 ; CHECK-NEXT: xori32 a0, a0, 1
145 ; CHECK-NEXT: or16 a0, a1
146 ; CHECK-NEXT: cmpnei16 a0, 0
147 ; CHECK-NEXT: mvcv16 a0
150 ; GENERIC-LABEL: ICMP_LONG_I_eq:
151 ; GENERIC: # %bb.0: # %entry
152 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
153 ; GENERIC-NEXT: subi16 sp, sp, 4
154 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
155 ; GENERIC-NEXT: movi16 a2, 1
156 ; GENERIC-NEXT: xor16 a2, a0
157 ; GENERIC-NEXT: or16 a2, a1
158 ; GENERIC-NEXT: cmpnei16 a2, 0
159 ; GENERIC-NEXT: mvcv16 a0
160 ; GENERIC-NEXT: addi16 sp, sp, 4
161 ; GENERIC-NEXT: rts16
163 %icmp = icmp eq i64 %x, 1
167 define i1 @ICMP_SHORT_eq(i16 %x, i16 %y) {
168 ; CHECK-LABEL: ICMP_SHORT_eq:
169 ; CHECK: # %bb.0: # %entry
170 ; CHECK-NEXT: zexth16 a0, a0
171 ; CHECK-NEXT: zexth16 a1, a1
172 ; CHECK-NEXT: cmpne16 a1, a0
173 ; CHECK-NEXT: mvcv16 a0
176 ; GENERIC-LABEL: ICMP_SHORT_eq:
177 ; GENERIC: # %bb.0: # %entry
178 ; GENERIC-NEXT: subi16 sp, sp, 4
179 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
180 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
181 ; GENERIC-NEXT: .cfi_offset l0, -4
182 ; GENERIC-NEXT: subi16 sp, sp, 4
183 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
184 ; GENERIC-NEXT: movi16 a2, 0
185 ; GENERIC-NEXT: lsli16 a3, a2, 24
186 ; GENERIC-NEXT: lsli16 a2, a2, 16
187 ; GENERIC-NEXT: or16 a2, a3
188 ; GENERIC-NEXT: movi16 a3, 255
189 ; GENERIC-NEXT: lsli16 l0, a3, 8
190 ; GENERIC-NEXT: or16 l0, a2
191 ; GENERIC-NEXT: or16 l0, a3
192 ; GENERIC-NEXT: and16 a0, l0
193 ; GENERIC-NEXT: and16 l0, a1
194 ; GENERIC-NEXT: cmpne16 l0, a0
195 ; GENERIC-NEXT: mvcv16 a0
196 ; GENERIC-NEXT: addi16 sp, sp, 4
197 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
198 ; GENERIC-NEXT: addi16 sp, sp, 4
199 ; GENERIC-NEXT: rts16
201 %icmp = icmp eq i16 %y, %x
205 define i1 @ICMP_SHORT_I_eq(i16 %x) {
206 ; CHECK-LABEL: ICMP_SHORT_I_eq:
207 ; CHECK: # %bb.0: # %entry
208 ; CHECK-NEXT: zexth16 a0, a0
209 ; CHECK-NEXT: cmpnei16 a0, 1
210 ; CHECK-NEXT: mvcv16 a0
213 ; GENERIC-LABEL: ICMP_SHORT_I_eq:
214 ; GENERIC: # %bb.0: # %entry
215 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
216 ; GENERIC-NEXT: subi16 sp, sp, 4
217 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
218 ; GENERIC-NEXT: movi16 a1, 0
219 ; GENERIC-NEXT: lsli16 a2, a1, 24
220 ; GENERIC-NEXT: lsli16 a1, a1, 16
221 ; GENERIC-NEXT: or16 a1, a2
222 ; GENERIC-NEXT: movi16 a2, 255
223 ; GENERIC-NEXT: lsli16 a3, a2, 8
224 ; GENERIC-NEXT: or16 a3, a1
225 ; GENERIC-NEXT: or16 a3, a2
226 ; GENERIC-NEXT: and16 a3, a0
227 ; GENERIC-NEXT: cmpnei16 a3, 1
228 ; GENERIC-NEXT: mvcv16 a0
229 ; GENERIC-NEXT: addi16 sp, sp, 4
230 ; GENERIC-NEXT: rts16
232 %icmp = icmp eq i16 %x, 1
236 define i1 @ICMP_CHAR_eq(i8 %x, i8 %y) {
237 ; CHECK-LABEL: ICMP_CHAR_eq:
238 ; CHECK: # %bb.0: # %entry
239 ; CHECK-NEXT: zextb16 a0, a0
240 ; CHECK-NEXT: zextb16 a1, a1
241 ; CHECK-NEXT: cmpne16 a1, a0
242 ; CHECK-NEXT: mvcv16 a0
245 ; GENERIC-LABEL: ICMP_CHAR_eq:
246 ; GENERIC: # %bb.0: # %entry
247 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
248 ; GENERIC-NEXT: subi16 sp, sp, 4
249 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
250 ; GENERIC-NEXT: movi16 a2, 255
251 ; GENERIC-NEXT: and16 a0, a2
252 ; GENERIC-NEXT: and16 a1, a2
253 ; GENERIC-NEXT: cmpne16 a1, a0
254 ; GENERIC-NEXT: mvcv16 a0
255 ; GENERIC-NEXT: addi16 sp, sp, 4
256 ; GENERIC-NEXT: rts16
258 %icmp = icmp eq i8 %y, %x
262 define i1 @ICMP_CHAR_I_eq(i8 %x) {
263 ; CHECK-LABEL: ICMP_CHAR_I_eq:
264 ; CHECK: # %bb.0: # %entry
265 ; CHECK-NEXT: zextb16 a0, a0
266 ; CHECK-NEXT: cmpnei16 a0, 1
267 ; CHECK-NEXT: mvcv16 a0
270 ; GENERIC-LABEL: ICMP_CHAR_I_eq:
271 ; GENERIC: # %bb.0: # %entry
272 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
273 ; GENERIC-NEXT: subi16 sp, sp, 4
274 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
275 ; GENERIC-NEXT: movi16 a1, 255
276 ; GENERIC-NEXT: and16 a1, a0
277 ; GENERIC-NEXT: cmpnei16 a1, 1
278 ; GENERIC-NEXT: mvcv16 a0
279 ; GENERIC-NEXT: addi16 sp, sp, 4
280 ; GENERIC-NEXT: rts16
282 %icmp = icmp eq i8 %x, 1
286 define i1 @ICMP_BIT_eq(i1 %x, i1 %y) {
287 ; CHECK-LABEL: ICMP_BIT_eq:
288 ; CHECK: # %bb.0: # %entry
289 ; CHECK-NEXT: xor16 a0, a1
290 ; CHECK-NEXT: xori32 a0, a0, 1
293 ; GENERIC-LABEL: ICMP_BIT_eq:
294 ; GENERIC: # %bb.0: # %entry
295 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
296 ; GENERIC-NEXT: subi16 sp, sp, 4
297 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
298 ; GENERIC-NEXT: xor16 a0, a1
299 ; GENERIC-NEXT: movi16 a1, 1
300 ; GENERIC-NEXT: xor16 a0, a1
301 ; GENERIC-NEXT: addi16 sp, sp, 4
302 ; GENERIC-NEXT: rts16
304 %icmp = icmp eq i1 %y, %x
308 define i1 @ICMP_BIT_I_eq(i1 %x) {
309 ; CHECK-LABEL: ICMP_BIT_I_eq:
310 ; CHECK: # %bb.0: # %entry
313 ; GENERIC-LABEL: ICMP_BIT_I_eq:
314 ; GENERIC: # %bb.0: # %entry
315 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
316 ; GENERIC-NEXT: subi16 sp, sp, 4
317 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
318 ; GENERIC-NEXT: addi16 sp, sp, 4
319 ; GENERIC-NEXT: rts16
321 %icmp = icmp eq i1 %x, 1
326 define i1 @icmpRR_ne(i32 %x, i32 %y) {
327 ; CHECK-LABEL: icmpRR_ne:
328 ; CHECK: # %bb.0: # %entry
329 ; CHECK-NEXT: cmpne16 a1, a0
330 ; CHECK-NEXT: mvc32 a0
333 ; GENERIC-LABEL: icmpRR_ne:
334 ; GENERIC: # %bb.0: # %entry
335 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
336 ; GENERIC-NEXT: subi16 sp, sp, 4
337 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
338 ; GENERIC-NEXT: cmpne16 a1, a0
339 ; GENERIC-NEXT: mvcv16 a1
340 ; GENERIC-NEXT: movi16 a0, 1
341 ; GENERIC-NEXT: subu16 a0, a1
342 ; GENERIC-NEXT: addi16 sp, sp, 4
343 ; GENERIC-NEXT: rts16
345 %icmp = icmp ne i32 %y, %x
349 define i1 @icmpRI_ne(i32 %x) {
350 ; CHECK-LABEL: icmpRI_ne:
351 ; CHECK: # %bb.0: # %entry
352 ; CHECK-NEXT: cmpnei16 a0, 10
353 ; CHECK-NEXT: mvc32 a0
356 ; GENERIC-LABEL: icmpRI_ne:
357 ; GENERIC: # %bb.0: # %entry
358 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
359 ; GENERIC-NEXT: subi16 sp, sp, 4
360 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
361 ; GENERIC-NEXT: cmpnei16 a0, 10
362 ; GENERIC-NEXT: mvcv16 a1
363 ; GENERIC-NEXT: movi16 a0, 1
364 ; GENERIC-NEXT: subu16 a0, a1
365 ; GENERIC-NEXT: addi16 sp, sp, 4
366 ; GENERIC-NEXT: rts16
368 %icmp = icmp ne i32 %x, 10
372 define i1 @icmpRI_X_ne(i32 %x) {
373 ; CHECK-LABEL: icmpRI_X_ne:
374 ; CHECK: # %bb.0: # %entry
375 ; CHECK-NEXT: movih32 a1, 62
376 ; CHECK-NEXT: ori32 a1, a1, 33768
377 ; CHECK-NEXT: cmpne16 a0, a1
378 ; CHECK-NEXT: mvc32 a0
381 ; GENERIC-LABEL: icmpRI_X_ne:
382 ; GENERIC: # %bb.0: # %entry
383 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
384 ; GENERIC-NEXT: subi16 sp, sp, 4
385 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
386 ; GENERIC-NEXT: movi16 a1, 0
387 ; GENERIC-NEXT: lsli16 a1, a1, 24
388 ; GENERIC-NEXT: movi16 a2, 62
389 ; GENERIC-NEXT: lsli16 a2, a2, 16
390 ; GENERIC-NEXT: or16 a2, a1
391 ; GENERIC-NEXT: movi16 a1, 131
392 ; GENERIC-NEXT: lsli16 a1, a1, 8
393 ; GENERIC-NEXT: or16 a1, a2
394 ; GENERIC-NEXT: movi16 a2, 232
395 ; GENERIC-NEXT: or16 a2, a1
396 ; GENERIC-NEXT: cmpne16 a0, a2
397 ; GENERIC-NEXT: mvcv16 a1
398 ; GENERIC-NEXT: movi16 a0, 1
399 ; GENERIC-NEXT: subu16 a0, a1
400 ; GENERIC-NEXT: addi16 sp, sp, 4
401 ; GENERIC-NEXT: rts16
403 %icmp = icmp ne i32 %x, 4097000
407 define i1 @ICMP_LONG_ne(i64 %x, i64 %y) {
408 ; CHECK-LABEL: ICMP_LONG_ne:
409 ; CHECK: # %bb.0: # %entry
410 ; CHECK-NEXT: xor16 a1, a3
411 ; CHECK-NEXT: xor16 a0, a2
412 ; CHECK-NEXT: or16 a0, a1
413 ; CHECK-NEXT: cmpnei16 a0, 0
414 ; CHECK-NEXT: mvc32 a0
417 ; GENERIC-LABEL: ICMP_LONG_ne:
418 ; GENERIC: # %bb.0: # %entry
419 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
420 ; GENERIC-NEXT: subi16 sp, sp, 4
421 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
422 ; GENERIC-NEXT: xor16 a1, a3
423 ; GENERIC-NEXT: xor16 a0, a2
424 ; GENERIC-NEXT: or16 a0, a1
425 ; GENERIC-NEXT: cmpnei16 a0, 0
426 ; GENERIC-NEXT: mvcv16 a1
427 ; GENERIC-NEXT: movi16 a0, 1
428 ; GENERIC-NEXT: subu16 a0, a1
429 ; GENERIC-NEXT: addi16 sp, sp, 4
430 ; GENERIC-NEXT: rts16
432 %icmp = icmp ne i64 %y, %x
436 define i1 @ICMP_LONG_I_ne(i64 %x) {
437 ; CHECK-LABEL: ICMP_LONG_I_ne:
438 ; CHECK: # %bb.0: # %entry
439 ; CHECK-NEXT: xori32 a0, a0, 1
440 ; CHECK-NEXT: or16 a0, a1
441 ; CHECK-NEXT: cmpnei16 a0, 0
442 ; CHECK-NEXT: mvc32 a0
445 ; GENERIC-LABEL: ICMP_LONG_I_ne:
446 ; GENERIC: # %bb.0: # %entry
447 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
448 ; GENERIC-NEXT: subi16 sp, sp, 4
449 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
450 ; GENERIC-NEXT: movi16 a2, 1
451 ; GENERIC-NEXT: xor16 a0, a2
452 ; GENERIC-NEXT: or16 a0, a1
453 ; GENERIC-NEXT: cmpnei16 a0, 0
454 ; GENERIC-NEXT: mvcv16 a0
455 ; GENERIC-NEXT: subu16 a2, a0
456 ; GENERIC-NEXT: mov16 a0, a2
457 ; GENERIC-NEXT: addi16 sp, sp, 4
458 ; GENERIC-NEXT: rts16
460 %icmp = icmp ne i64 %x, 1
464 define i1 @ICMP_SHORT_ne(i16 %x, i16 %y) {
465 ; CHECK-LABEL: ICMP_SHORT_ne:
466 ; CHECK: # %bb.0: # %entry
467 ; CHECK-NEXT: zexth16 a0, a0
468 ; CHECK-NEXT: zexth16 a1, a1
469 ; CHECK-NEXT: cmpne16 a1, a0
470 ; CHECK-NEXT: mvc32 a0
473 ; GENERIC-LABEL: ICMP_SHORT_ne:
474 ; GENERIC: # %bb.0: # %entry
475 ; GENERIC-NEXT: subi16 sp, sp, 4
476 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
477 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
478 ; GENERIC-NEXT: .cfi_offset l0, -4
479 ; GENERIC-NEXT: subi16 sp, sp, 4
480 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
481 ; GENERIC-NEXT: movi16 a2, 0
482 ; GENERIC-NEXT: lsli16 a3, a2, 24
483 ; GENERIC-NEXT: lsli16 a2, a2, 16
484 ; GENERIC-NEXT: or16 a2, a3
485 ; GENERIC-NEXT: movi16 a3, 255
486 ; GENERIC-NEXT: lsli16 l0, a3, 8
487 ; GENERIC-NEXT: or16 l0, a2
488 ; GENERIC-NEXT: or16 l0, a3
489 ; GENERIC-NEXT: and16 a0, l0
490 ; GENERIC-NEXT: and16 l0, a1
491 ; GENERIC-NEXT: cmpne16 l0, a0
492 ; GENERIC-NEXT: mvcv16 a1
493 ; GENERIC-NEXT: movi16 a0, 1
494 ; GENERIC-NEXT: subu16 a0, a1
495 ; GENERIC-NEXT: addi16 sp, sp, 4
496 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
497 ; GENERIC-NEXT: addi16 sp, sp, 4
498 ; GENERIC-NEXT: rts16
500 %icmp = icmp ne i16 %y, %x
504 define i1 @ICMP_SHORT_I_ne(i16 %x) {
505 ; CHECK-LABEL: ICMP_SHORT_I_ne:
506 ; CHECK: # %bb.0: # %entry
507 ; CHECK-NEXT: zexth16 a0, a0
508 ; CHECK-NEXT: cmpnei16 a0, 1
509 ; CHECK-NEXT: mvc32 a0
512 ; GENERIC-LABEL: ICMP_SHORT_I_ne:
513 ; GENERIC: # %bb.0: # %entry
514 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
515 ; GENERIC-NEXT: subi16 sp, sp, 4
516 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
517 ; GENERIC-NEXT: movi16 a1, 0
518 ; GENERIC-NEXT: lsli16 a2, a1, 24
519 ; GENERIC-NEXT: lsli16 a1, a1, 16
520 ; GENERIC-NEXT: or16 a1, a2
521 ; GENERIC-NEXT: movi16 a2, 255
522 ; GENERIC-NEXT: lsli16 a3, a2, 8
523 ; GENERIC-NEXT: or16 a3, a1
524 ; GENERIC-NEXT: or16 a3, a2
525 ; GENERIC-NEXT: and16 a3, a0
526 ; GENERIC-NEXT: cmpnei16 a3, 1
527 ; GENERIC-NEXT: mvcv16 a1
528 ; GENERIC-NEXT: movi16 a0, 1
529 ; GENERIC-NEXT: subu16 a0, a1
530 ; GENERIC-NEXT: addi16 sp, sp, 4
531 ; GENERIC-NEXT: rts16
533 %icmp = icmp ne i16 %x, 1
537 define i1 @ICMP_CHAR_ne(i8 %x, i8 %y) {
538 ; CHECK-LABEL: ICMP_CHAR_ne:
539 ; CHECK: # %bb.0: # %entry
540 ; CHECK-NEXT: zextb16 a0, a0
541 ; CHECK-NEXT: zextb16 a1, a1
542 ; CHECK-NEXT: cmpne16 a1, a0
543 ; CHECK-NEXT: mvc32 a0
546 ; GENERIC-LABEL: ICMP_CHAR_ne:
547 ; GENERIC: # %bb.0: # %entry
548 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
549 ; GENERIC-NEXT: subi16 sp, sp, 4
550 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
551 ; GENERIC-NEXT: movi16 a2, 255
552 ; GENERIC-NEXT: and16 a0, a2
553 ; GENERIC-NEXT: and16 a1, a2
554 ; GENERIC-NEXT: cmpne16 a1, a0
555 ; GENERIC-NEXT: mvcv16 a1
556 ; GENERIC-NEXT: movi16 a0, 1
557 ; GENERIC-NEXT: subu16 a0, a1
558 ; GENERIC-NEXT: addi16 sp, sp, 4
559 ; GENERIC-NEXT: rts16
561 %icmp = icmp ne i8 %y, %x
565 define i1 @ICMP_CHAR_I_ne(i8 %x) {
566 ; CHECK-LABEL: ICMP_CHAR_I_ne:
567 ; CHECK: # %bb.0: # %entry
568 ; CHECK-NEXT: zextb16 a0, a0
569 ; CHECK-NEXT: cmpnei16 a0, 1
570 ; CHECK-NEXT: mvc32 a0
573 ; GENERIC-LABEL: ICMP_CHAR_I_ne:
574 ; GENERIC: # %bb.0: # %entry
575 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
576 ; GENERIC-NEXT: subi16 sp, sp, 4
577 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
578 ; GENERIC-NEXT: movi16 a1, 255
579 ; GENERIC-NEXT: and16 a1, a0
580 ; GENERIC-NEXT: cmpnei16 a1, 1
581 ; GENERIC-NEXT: mvcv16 a1
582 ; GENERIC-NEXT: movi16 a0, 1
583 ; GENERIC-NEXT: subu16 a0, a1
584 ; GENERIC-NEXT: addi16 sp, sp, 4
585 ; GENERIC-NEXT: rts16
587 %icmp = icmp ne i8 %x, 1
591 define i1 @ICMP_BIT_ne(i1 %x, i1 %y) {
592 ; CHECK-LABEL: ICMP_BIT_ne:
593 ; CHECK: # %bb.0: # %entry
594 ; CHECK-NEXT: xor16 a0, a1
597 ; GENERIC-LABEL: ICMP_BIT_ne:
598 ; GENERIC: # %bb.0: # %entry
599 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
600 ; GENERIC-NEXT: subi16 sp, sp, 4
601 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
602 ; GENERIC-NEXT: xor16 a0, a1
603 ; GENERIC-NEXT: addi16 sp, sp, 4
604 ; GENERIC-NEXT: rts16
606 %icmp = icmp ne i1 %y, %x
610 define i1 @ICMP_BIT_I_ne(i1 %x) {
611 ; CHECK-LABEL: ICMP_BIT_I_ne:
612 ; CHECK: # %bb.0: # %entry
613 ; CHECK-NEXT: xori32 a0, a0, 1
616 ; GENERIC-LABEL: ICMP_BIT_I_ne:
617 ; GENERIC: # %bb.0: # %entry
618 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
619 ; GENERIC-NEXT: subi16 sp, sp, 4
620 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
621 ; GENERIC-NEXT: movi16 a1, 1
622 ; GENERIC-NEXT: xor16 a0, a1
623 ; GENERIC-NEXT: addi16 sp, sp, 4
624 ; GENERIC-NEXT: rts16
626 %icmp = icmp ne i1 %x, 1
632 define i1 @icmpRR_ugt(i32 %x, i32 %y) {
633 ; CHECK-LABEL: icmpRR_ugt:
634 ; CHECK: # %bb.0: # %entry
635 ; CHECK-NEXT: cmphs16 a0, a1
636 ; CHECK-NEXT: mvcv16 a0
639 ; GENERIC-LABEL: icmpRR_ugt:
640 ; GENERIC: # %bb.0: # %entry
641 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
642 ; GENERIC-NEXT: subi16 sp, sp, 4
643 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
644 ; GENERIC-NEXT: cmphs16 a0, a1
645 ; GENERIC-NEXT: mvcv16 a0
646 ; GENERIC-NEXT: addi16 sp, sp, 4
647 ; GENERIC-NEXT: rts16
649 %icmp = icmp ugt i32 %y, %x
653 define i1 @icmpRI_ugt(i32 %x) {
654 ; CHECK-LABEL: icmpRI_ugt:
655 ; CHECK: # %bb.0: # %entry
656 ; CHECK-NEXT: movi16 a1, 10
657 ; CHECK-NEXT: cmphs16 a1, a0
658 ; CHECK-NEXT: mvcv16 a0
661 ; GENERIC-LABEL: icmpRI_ugt:
662 ; GENERIC: # %bb.0: # %entry
663 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
664 ; GENERIC-NEXT: subi16 sp, sp, 4
665 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
666 ; GENERIC-NEXT: movi16 a1, 10
667 ; GENERIC-NEXT: cmphs16 a1, a0
668 ; GENERIC-NEXT: mvcv16 a0
669 ; GENERIC-NEXT: addi16 sp, sp, 4
670 ; GENERIC-NEXT: rts16
672 %icmp = icmp ugt i32 %x, 10
676 define i1 @icmpRI_X_ugt(i32 %x) {
677 ; CHECK-LABEL: icmpRI_X_ugt:
678 ; CHECK: # %bb.0: # %entry
679 ; CHECK-NEXT: movih32 a1, 62
680 ; CHECK-NEXT: ori32 a1, a1, 33768
681 ; CHECK-NEXT: cmphs16 a1, a0
682 ; CHECK-NEXT: mvcv16 a0
685 ; GENERIC-LABEL: icmpRI_X_ugt:
686 ; GENERIC: # %bb.0: # %entry
687 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
688 ; GENERIC-NEXT: subi16 sp, sp, 4
689 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
690 ; GENERIC-NEXT: movi16 a1, 0
691 ; GENERIC-NEXT: lsli16 a1, a1, 24
692 ; GENERIC-NEXT: movi16 a2, 62
693 ; GENERIC-NEXT: lsli16 a2, a2, 16
694 ; GENERIC-NEXT: or16 a2, a1
695 ; GENERIC-NEXT: movi16 a1, 131
696 ; GENERIC-NEXT: lsli16 a1, a1, 8
697 ; GENERIC-NEXT: or16 a1, a2
698 ; GENERIC-NEXT: movi16 a2, 232
699 ; GENERIC-NEXT: or16 a2, a1
700 ; GENERIC-NEXT: cmphs16 a2, a0
701 ; GENERIC-NEXT: mvcv16 a0
702 ; GENERIC-NEXT: addi16 sp, sp, 4
703 ; GENERIC-NEXT: rts16
705 %icmp = icmp ugt i32 %x, 4097000
709 define i1 @ICMP_LONG_ugt(i64 %x, i64 %y) {
710 ; CHECK-LABEL: ICMP_LONG_ugt:
711 ; CHECK: # %bb.0: # %entry
712 ; CHECK-NEXT: .cfi_def_cfa_offset 0
713 ; CHECK-NEXT: subi16 sp, sp, 8
714 ; CHECK-NEXT: .cfi_def_cfa_offset 8
715 ; CHECK-NEXT: cmpne16 a3, a1
716 ; CHECK-NEXT: mvc32 t0
717 ; CHECK-NEXT: st32.w t0, (sp, 4)
718 ; CHECK-NEXT: cmphs16 a1, a3
719 ; CHECK-NEXT: mvcv16 a1
720 ; CHECK-NEXT: cmphs16 a0, a2
721 ; CHECK-NEXT: mvcv16 a0
722 ; CHECK-NEXT: ld16.w a2, (sp, 4)
723 ; CHECK-NEXT: btsti16 a2, 0
724 ; CHECK-NEXT: movf32 a1, a0
725 ; CHECK-NEXT: mov16 a0, a1
726 ; CHECK-NEXT: addi16 sp, sp, 8
729 ; GENERIC-LABEL: ICMP_LONG_ugt:
730 ; GENERIC: # %bb.0: # %entry
731 ; GENERIC-NEXT: subi16 sp, sp, 4
732 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
733 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
734 ; GENERIC-NEXT: .cfi_offset l0, -4
735 ; GENERIC-NEXT: subi16 sp, sp, 4
736 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
737 ; GENERIC-NEXT: cmphs16 a1, a3
738 ; GENERIC-NEXT: mvcv16 l0
739 ; GENERIC-NEXT: cmphs16 a0, a2
740 ; GENERIC-NEXT: mvcv16 a0
741 ; GENERIC-NEXT: cmpne16 a3, a1
742 ; GENERIC-NEXT: mvcv16 a1
743 ; GENERIC-NEXT: btsti16 a1, 0
744 ; GENERIC-NEXT: bt16 .LBB26_2
745 ; GENERIC-NEXT: # %bb.1: # %entry
746 ; GENERIC-NEXT: mov16 a0, l0
747 ; GENERIC-NEXT: .LBB26_2: # %entry
748 ; GENERIC-NEXT: addi16 sp, sp, 4
749 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
750 ; GENERIC-NEXT: addi16 sp, sp, 4
751 ; GENERIC-NEXT: rts16
753 %icmp = icmp ugt i64 %y, %x
757 define i1 @ICMP_LONG_I_ugt(i64 %x) {
758 ; CHECK-LABEL: ICMP_LONG_I_ugt:
759 ; CHECK: # %bb.0: # %entry
760 ; CHECK-NEXT: movi16 a2, 1
761 ; CHECK-NEXT: cmphs16 a2, a0
762 ; CHECK-NEXT: mvcv16 a2
763 ; CHECK-NEXT: cmpnei16 a1, 0
764 ; CHECK-NEXT: mvc32 a0
765 ; CHECK-NEXT: movf32 a0, a2
768 ; GENERIC-LABEL: ICMP_LONG_I_ugt:
769 ; GENERIC: # %bb.0: # %entry
770 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
771 ; GENERIC-NEXT: subi16 sp, sp, 4
772 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
773 ; GENERIC-NEXT: cmpnei16 a1, 0
774 ; GENERIC-NEXT: mvcv16 a1
775 ; GENERIC-NEXT: movi16 a2, 1
776 ; GENERIC-NEXT: cmphs16 a2, a0
777 ; GENERIC-NEXT: mvcv16 a0
778 ; GENERIC-NEXT: btsti16 a1, 0
779 ; GENERIC-NEXT: bt16 .LBB27_2
780 ; GENERIC-NEXT: # %bb.1: # %entry
781 ; GENERIC-NEXT: subu16 a2, a1
782 ; GENERIC-NEXT: mov16 a0, a2
783 ; GENERIC-NEXT: .LBB27_2: # %entry
784 ; GENERIC-NEXT: addi16 sp, sp, 4
785 ; GENERIC-NEXT: rts16
787 %icmp = icmp ugt i64 %x, 1
791 define i1 @ICMP_SHORT_ugt(i16 %x, i16 %y) {
792 ; CHECK-LABEL: ICMP_SHORT_ugt:
793 ; CHECK: # %bb.0: # %entry
794 ; CHECK-NEXT: zexth16 a1, a1
795 ; CHECK-NEXT: zexth16 a0, a0
796 ; CHECK-NEXT: cmphs16 a0, a1
797 ; CHECK-NEXT: mvcv16 a0
800 ; GENERIC-LABEL: ICMP_SHORT_ugt:
801 ; GENERIC: # %bb.0: # %entry
802 ; GENERIC-NEXT: subi16 sp, sp, 4
803 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
804 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
805 ; GENERIC-NEXT: .cfi_offset l0, -4
806 ; GENERIC-NEXT: subi16 sp, sp, 4
807 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
808 ; GENERIC-NEXT: movi16 a2, 0
809 ; GENERIC-NEXT: lsli16 a3, a2, 24
810 ; GENERIC-NEXT: lsli16 a2, a2, 16
811 ; GENERIC-NEXT: or16 a2, a3
812 ; GENERIC-NEXT: movi16 a3, 255
813 ; GENERIC-NEXT: lsli16 l0, a3, 8
814 ; GENERIC-NEXT: or16 l0, a2
815 ; GENERIC-NEXT: or16 l0, a3
816 ; GENERIC-NEXT: and16 a1, l0
817 ; GENERIC-NEXT: and16 l0, a0
818 ; GENERIC-NEXT: cmphs16 l0, a1
819 ; GENERIC-NEXT: mvcv16 a0
820 ; GENERIC-NEXT: addi16 sp, sp, 4
821 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
822 ; GENERIC-NEXT: addi16 sp, sp, 4
823 ; GENERIC-NEXT: rts16
825 %icmp = icmp ugt i16 %y, %x
829 define i1 @ICMP_SHORT_I_ugt(i16 %x) {
830 ; CHECK-LABEL: ICMP_SHORT_I_ugt:
831 ; CHECK: # %bb.0: # %entry
832 ; CHECK-NEXT: zexth16 a0, a0
833 ; CHECK-NEXT: movi16 a1, 1
834 ; CHECK-NEXT: cmphs16 a1, a0
835 ; CHECK-NEXT: mvcv16 a0
838 ; GENERIC-LABEL: ICMP_SHORT_I_ugt:
839 ; GENERIC: # %bb.0: # %entry
840 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
841 ; GENERIC-NEXT: subi16 sp, sp, 4
842 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
843 ; GENERIC-NEXT: movi16 a1, 0
844 ; GENERIC-NEXT: lsli16 a2, a1, 24
845 ; GENERIC-NEXT: lsli16 a1, a1, 16
846 ; GENERIC-NEXT: or16 a1, a2
847 ; GENERIC-NEXT: movi16 a2, 255
848 ; GENERIC-NEXT: lsli16 a3, a2, 8
849 ; GENERIC-NEXT: or16 a3, a1
850 ; GENERIC-NEXT: or16 a3, a2
851 ; GENERIC-NEXT: and16 a3, a0
852 ; GENERIC-NEXT: movi16 a0, 1
853 ; GENERIC-NEXT: cmphs16 a0, a3
854 ; GENERIC-NEXT: mvcv16 a0
855 ; GENERIC-NEXT: addi16 sp, sp, 4
856 ; GENERIC-NEXT: rts16
858 %icmp = icmp ugt i16 %x, 1
862 define i1 @ICMP_CHAR_ugt(i8 %x, i8 %y) {
863 ; CHECK-LABEL: ICMP_CHAR_ugt:
864 ; CHECK: # %bb.0: # %entry
865 ; CHECK-NEXT: zextb16 a1, a1
866 ; CHECK-NEXT: zextb16 a0, a0
867 ; CHECK-NEXT: cmphs16 a0, a1
868 ; CHECK-NEXT: mvcv16 a0
871 ; GENERIC-LABEL: ICMP_CHAR_ugt:
872 ; GENERIC: # %bb.0: # %entry
873 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
874 ; GENERIC-NEXT: subi16 sp, sp, 4
875 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
876 ; GENERIC-NEXT: movi16 a2, 255
877 ; GENERIC-NEXT: and16 a1, a2
878 ; GENERIC-NEXT: and16 a0, a2
879 ; GENERIC-NEXT: cmphs16 a0, a1
880 ; GENERIC-NEXT: mvcv16 a0
881 ; GENERIC-NEXT: addi16 sp, sp, 4
882 ; GENERIC-NEXT: rts16
884 %icmp = icmp ugt i8 %y, %x
888 define i1 @ICMP_CHAR_I_ugt(i8 %x) {
889 ; CHECK-LABEL: ICMP_CHAR_I_ugt:
890 ; CHECK: # %bb.0: # %entry
891 ; CHECK-NEXT: zextb16 a0, a0
892 ; CHECK-NEXT: movi16 a1, 1
893 ; CHECK-NEXT: cmphs16 a1, a0
894 ; CHECK-NEXT: mvcv16 a0
897 ; GENERIC-LABEL: ICMP_CHAR_I_ugt:
898 ; GENERIC: # %bb.0: # %entry
899 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
900 ; GENERIC-NEXT: subi16 sp, sp, 4
901 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
902 ; GENERIC-NEXT: movi16 a1, 255
903 ; GENERIC-NEXT: and16 a1, a0
904 ; GENERIC-NEXT: movi16 a0, 1
905 ; GENERIC-NEXT: cmphs16 a0, a1
906 ; GENERIC-NEXT: mvcv16 a0
907 ; GENERIC-NEXT: addi16 sp, sp, 4
908 ; GENERIC-NEXT: rts16
910 %icmp = icmp ugt i8 %x, 1
914 define i1 @ICMP_BIT_ugt(i1 %x, i1 %y) {
915 ; CHECK-LABEL: ICMP_BIT_ugt:
916 ; CHECK: # %bb.0: # %entry
917 ; CHECK-NEXT: xori32 a0, a0, 1
918 ; CHECK-NEXT: and16 a0, a1
921 ; GENERIC-LABEL: ICMP_BIT_ugt:
922 ; GENERIC: # %bb.0: # %entry
923 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
924 ; GENERIC-NEXT: subi16 sp, sp, 4
925 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
926 ; GENERIC-NEXT: movi16 a2, 1
927 ; GENERIC-NEXT: xor16 a0, a2
928 ; GENERIC-NEXT: and16 a0, a1
929 ; GENERIC-NEXT: addi16 sp, sp, 4
930 ; GENERIC-NEXT: rts16
932 %icmp = icmp ugt i1 %y, %x
936 define i1 @ICMP_BIT_I_ugt(i1 %x) {
937 ; CHECK-LABEL: ICMP_BIT_I_ugt:
938 ; CHECK: # %bb.0: # %entry
939 ; CHECK-NEXT: movi16 a0, 0
942 ; GENERIC-LABEL: ICMP_BIT_I_ugt:
943 ; GENERIC: # %bb.0: # %entry
944 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
945 ; GENERIC-NEXT: subi16 sp, sp, 4
946 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
947 ; GENERIC-NEXT: movi16 a0, 0
948 ; GENERIC-NEXT: addi16 sp, sp, 4
949 ; GENERIC-NEXT: rts16
951 %icmp = icmp ugt i1 %x, 1
957 define i1 @icmpRR_uge(i32 %x, i32 %y) {
958 ; CHECK-LABEL: icmpRR_uge:
959 ; CHECK: # %bb.0: # %entry
960 ; CHECK-NEXT: cmphs16 a1, a0
961 ; CHECK-NEXT: mvc32 a0
964 ; GENERIC-LABEL: icmpRR_uge:
965 ; GENERIC: # %bb.0: # %entry
966 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
967 ; GENERIC-NEXT: subi16 sp, sp, 4
968 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
969 ; GENERIC-NEXT: cmphs16 a1, a0
970 ; GENERIC-NEXT: mvcv16 a1
971 ; GENERIC-NEXT: movi16 a0, 1
972 ; GENERIC-NEXT: subu16 a0, a1
973 ; GENERIC-NEXT: addi16 sp, sp, 4
974 ; GENERIC-NEXT: rts16
976 %icmp = icmp uge i32 %y, %x
980 define i1 @icmpRI_uge(i32 %x) {
981 ; CHECK-LABEL: icmpRI_uge:
982 ; CHECK: # %bb.0: # %entry
983 ; CHECK-NEXT: movi16 a1, 9
984 ; CHECK-NEXT: cmphs16 a1, a0
985 ; CHECK-NEXT: mvcv16 a0
988 ; GENERIC-LABEL: icmpRI_uge:
989 ; GENERIC: # %bb.0: # %entry
990 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
991 ; GENERIC-NEXT: subi16 sp, sp, 4
992 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
993 ; GENERIC-NEXT: movi16 a1, 9
994 ; GENERIC-NEXT: cmphs16 a1, a0
995 ; GENERIC-NEXT: mvcv16 a0
996 ; GENERIC-NEXT: addi16 sp, sp, 4
997 ; GENERIC-NEXT: rts16
999 %icmp = icmp uge i32 %x, 10
1003 define i1 @icmpRI_X_uge(i32 %x) {
1004 ; CHECK-LABEL: icmpRI_X_uge:
1005 ; CHECK: # %bb.0: # %entry
1006 ; CHECK-NEXT: movih32 a1, 62
1007 ; CHECK-NEXT: ori32 a1, a1, 33767
1008 ; CHECK-NEXT: cmphs16 a1, a0
1009 ; CHECK-NEXT: mvcv16 a0
1012 ; GENERIC-LABEL: icmpRI_X_uge:
1013 ; GENERIC: # %bb.0: # %entry
1014 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1015 ; GENERIC-NEXT: subi16 sp, sp, 4
1016 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1017 ; GENERIC-NEXT: movi16 a1, 0
1018 ; GENERIC-NEXT: lsli16 a1, a1, 24
1019 ; GENERIC-NEXT: movi16 a2, 62
1020 ; GENERIC-NEXT: lsli16 a2, a2, 16
1021 ; GENERIC-NEXT: or16 a2, a1
1022 ; GENERIC-NEXT: movi16 a1, 131
1023 ; GENERIC-NEXT: lsli16 a1, a1, 8
1024 ; GENERIC-NEXT: or16 a1, a2
1025 ; GENERIC-NEXT: movi16 a2, 231
1026 ; GENERIC-NEXT: or16 a2, a1
1027 ; GENERIC-NEXT: cmphs16 a2, a0
1028 ; GENERIC-NEXT: mvcv16 a0
1029 ; GENERIC-NEXT: addi16 sp, sp, 4
1030 ; GENERIC-NEXT: rts16
1032 %icmp = icmp uge i32 %x, 4097000
1036 define i1 @ICMP_LONG_uge(i64 %x, i64 %y) {
1037 ; CHECK-LABEL: ICMP_LONG_uge:
1038 ; CHECK: # %bb.0: # %entry
1039 ; CHECK-NEXT: .cfi_def_cfa_offset 0
1040 ; CHECK-NEXT: subi16 sp, sp, 16
1041 ; CHECK-NEXT: .cfi_def_cfa_offset 16
1042 ; CHECK-NEXT: cmphs16 a3, a1
1043 ; CHECK-NEXT: mvc32 t0
1044 ; CHECK-NEXT: st32.w t0, (sp, 12)
1045 ; CHECK-NEXT: cmphs16 a2, a0
1046 ; CHECK-NEXT: mvc32 a0
1047 ; CHECK-NEXT: st16.w a0, (sp, 4)
1048 ; CHECK-NEXT: cmpne16 a3, a1
1049 ; CHECK-NEXT: mvc32 a0
1050 ; CHECK-NEXT: st16.w a0, (sp, 8)
1051 ; CHECK-NEXT: ld16.w a0, (sp, 4)
1052 ; CHECK-NEXT: btsti16 a0, 0
1053 ; CHECK-NEXT: mvc32 a1
1054 ; CHECK-NEXT: ld16.w a0, (sp, 12)
1055 ; CHECK-NEXT: btsti16 a0, 0
1056 ; CHECK-NEXT: mvc32 a0
1057 ; CHECK-NEXT: ld16.w a2, (sp, 8)
1058 ; CHECK-NEXT: btsti16 a2, 0
1059 ; CHECK-NEXT: movf32 a0, a1
1060 ; CHECK-NEXT: addi16 sp, sp, 16
1063 ; GENERIC-LABEL: ICMP_LONG_uge:
1064 ; GENERIC: # %bb.0: # %entry
1065 ; GENERIC-NEXT: subi16 sp, sp, 8
1066 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
1067 ; GENERIC-NEXT: st16.w l1, (sp, 4) # 4-byte Folded Spill
1068 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
1069 ; GENERIC-NEXT: .cfi_offset l1, -4
1070 ; GENERIC-NEXT: .cfi_offset l0, -8
1071 ; GENERIC-NEXT: subi16 sp, sp, 4
1072 ; GENERIC-NEXT: .cfi_def_cfa_offset 12
1073 ; GENERIC-NEXT: mov16 l0, a0
1074 ; GENERIC-NEXT: cmphs16 a3, a1
1075 ; GENERIC-NEXT: mvcv16 l1
1076 ; GENERIC-NEXT: movi16 a0, 1
1077 ; GENERIC-NEXT: cmphs16 a2, l0
1078 ; GENERIC-NEXT: mvcv16 a2
1079 ; GENERIC-NEXT: cmpne16 a3, a1
1080 ; GENERIC-NEXT: mvcv16 a1
1081 ; GENERIC-NEXT: btsti16 a1, 0
1082 ; GENERIC-NEXT: bt16 .LBB37_2
1083 ; GENERIC-NEXT: # %bb.1: # %entry
1084 ; GENERIC-NEXT: subu16 a0, l1
1085 ; GENERIC-NEXT: br32 .LBB37_3
1086 ; GENERIC-NEXT: .LBB37_2:
1087 ; GENERIC-NEXT: subu16 a0, a2
1088 ; GENERIC-NEXT: .LBB37_3: # %entry
1089 ; GENERIC-NEXT: addi16 sp, sp, 4
1090 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
1091 ; GENERIC-NEXT: ld16.w l1, (sp, 4) # 4-byte Folded Reload
1092 ; GENERIC-NEXT: addi16 sp, sp, 8
1093 ; GENERIC-NEXT: rts16
1095 %icmp = icmp uge i64 %y, %x
1099 define i1 @ICMP_LONG_I_uge(i64 %x) {
1100 ; CHECK-LABEL: ICMP_LONG_I_uge:
1101 ; CHECK: # %bb.0: # %entry
1102 ; CHECK-NEXT: or16 a0, a1
1103 ; CHECK-NEXT: cmpnei16 a0, 0
1104 ; CHECK-NEXT: mvc32 a0
1107 ; GENERIC-LABEL: ICMP_LONG_I_uge:
1108 ; GENERIC: # %bb.0: # %entry
1109 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1110 ; GENERIC-NEXT: subi16 sp, sp, 4
1111 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1112 ; GENERIC-NEXT: or16 a0, a1
1113 ; GENERIC-NEXT: cmpnei16 a0, 0
1114 ; GENERIC-NEXT: mvcv16 a1
1115 ; GENERIC-NEXT: movi16 a0, 1
1116 ; GENERIC-NEXT: subu16 a0, a1
1117 ; GENERIC-NEXT: addi16 sp, sp, 4
1118 ; GENERIC-NEXT: rts16
1120 %icmp = icmp uge i64 %x, 1
1124 define i1 @ICMP_SHORT_uge(i16 %x, i16 %y) {
1125 ; CHECK-LABEL: ICMP_SHORT_uge:
1126 ; CHECK: # %bb.0: # %entry
1127 ; CHECK-NEXT: zexth16 a0, a0
1128 ; CHECK-NEXT: zexth16 a1, a1
1129 ; CHECK-NEXT: cmphs16 a1, a0
1130 ; CHECK-NEXT: mvc32 a0
1133 ; GENERIC-LABEL: ICMP_SHORT_uge:
1134 ; GENERIC: # %bb.0: # %entry
1135 ; GENERIC-NEXT: subi16 sp, sp, 4
1136 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1137 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
1138 ; GENERIC-NEXT: .cfi_offset l0, -4
1139 ; GENERIC-NEXT: subi16 sp, sp, 4
1140 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
1141 ; GENERIC-NEXT: movi16 a2, 0
1142 ; GENERIC-NEXT: lsli16 a3, a2, 24
1143 ; GENERIC-NEXT: lsli16 a2, a2, 16
1144 ; GENERIC-NEXT: or16 a2, a3
1145 ; GENERIC-NEXT: movi16 a3, 255
1146 ; GENERIC-NEXT: lsli16 l0, a3, 8
1147 ; GENERIC-NEXT: or16 l0, a2
1148 ; GENERIC-NEXT: or16 l0, a3
1149 ; GENERIC-NEXT: and16 a0, l0
1150 ; GENERIC-NEXT: and16 l0, a1
1151 ; GENERIC-NEXT: cmphs16 l0, a0
1152 ; GENERIC-NEXT: mvcv16 a1
1153 ; GENERIC-NEXT: movi16 a0, 1
1154 ; GENERIC-NEXT: subu16 a0, a1
1155 ; GENERIC-NEXT: addi16 sp, sp, 4
1156 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
1157 ; GENERIC-NEXT: addi16 sp, sp, 4
1158 ; GENERIC-NEXT: rts16
1160 %icmp = icmp uge i16 %y, %x
1164 define i1 @ICMP_SHORT_I_uge(i16 %x) {
1165 ; CHECK-LABEL: ICMP_SHORT_I_uge:
1166 ; CHECK: # %bb.0: # %entry
1167 ; CHECK-NEXT: zexth16 a0, a0
1168 ; CHECK-NEXT: cmpnei16 a0, 0
1169 ; CHECK-NEXT: mvc32 a0
1172 ; GENERIC-LABEL: ICMP_SHORT_I_uge:
1173 ; GENERIC: # %bb.0: # %entry
1174 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1175 ; GENERIC-NEXT: subi16 sp, sp, 4
1176 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1177 ; GENERIC-NEXT: movi16 a1, 0
1178 ; GENERIC-NEXT: lsli16 a2, a1, 24
1179 ; GENERIC-NEXT: lsli16 a1, a1, 16
1180 ; GENERIC-NEXT: or16 a1, a2
1181 ; GENERIC-NEXT: movi16 a2, 255
1182 ; GENERIC-NEXT: lsli16 a3, a2, 8
1183 ; GENERIC-NEXT: or16 a3, a1
1184 ; GENERIC-NEXT: or16 a3, a2
1185 ; GENERIC-NEXT: and16 a3, a0
1186 ; GENERIC-NEXT: cmpnei16 a3, 0
1187 ; GENERIC-NEXT: mvcv16 a1
1188 ; GENERIC-NEXT: movi16 a0, 1
1189 ; GENERIC-NEXT: subu16 a0, a1
1190 ; GENERIC-NEXT: addi16 sp, sp, 4
1191 ; GENERIC-NEXT: rts16
1193 %icmp = icmp uge i16 %x, 1
1197 define i1 @ICMP_CHAR_uge(i8 %x, i8 %y) {
1198 ; CHECK-LABEL: ICMP_CHAR_uge:
1199 ; CHECK: # %bb.0: # %entry
1200 ; CHECK-NEXT: zextb16 a0, a0
1201 ; CHECK-NEXT: zextb16 a1, a1
1202 ; CHECK-NEXT: cmphs16 a1, a0
1203 ; CHECK-NEXT: mvc32 a0
1206 ; GENERIC-LABEL: ICMP_CHAR_uge:
1207 ; GENERIC: # %bb.0: # %entry
1208 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1209 ; GENERIC-NEXT: subi16 sp, sp, 4
1210 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1211 ; GENERIC-NEXT: movi16 a2, 255
1212 ; GENERIC-NEXT: and16 a0, a2
1213 ; GENERIC-NEXT: and16 a1, a2
1214 ; GENERIC-NEXT: cmphs16 a1, a0
1215 ; GENERIC-NEXT: mvcv16 a1
1216 ; GENERIC-NEXT: movi16 a0, 1
1217 ; GENERIC-NEXT: subu16 a0, a1
1218 ; GENERIC-NEXT: addi16 sp, sp, 4
1219 ; GENERIC-NEXT: rts16
1221 %icmp = icmp uge i8 %y, %x
1225 define i1 @ICMP_CHAR_I_uge(i8 %x) {
1226 ; CHECK-LABEL: ICMP_CHAR_I_uge:
1227 ; CHECK: # %bb.0: # %entry
1228 ; CHECK-NEXT: zextb16 a0, a0
1229 ; CHECK-NEXT: cmpnei16 a0, 0
1230 ; CHECK-NEXT: mvc32 a0
1233 ; GENERIC-LABEL: ICMP_CHAR_I_uge:
1234 ; GENERIC: # %bb.0: # %entry
1235 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1236 ; GENERIC-NEXT: subi16 sp, sp, 4
1237 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1238 ; GENERIC-NEXT: movi16 a1, 255
1239 ; GENERIC-NEXT: and16 a1, a0
1240 ; GENERIC-NEXT: cmpnei16 a1, 0
1241 ; GENERIC-NEXT: mvcv16 a1
1242 ; GENERIC-NEXT: movi16 a0, 1
1243 ; GENERIC-NEXT: subu16 a0, a1
1244 ; GENERIC-NEXT: addi16 sp, sp, 4
1245 ; GENERIC-NEXT: rts16
1247 %icmp = icmp uge i8 %x, 1
1251 define i1 @ICMP_BIT_uge(i1 %x, i1 %y) {
1252 ; CHECK-LABEL: ICMP_BIT_uge:
1253 ; CHECK: # %bb.0: # %entry
1254 ; CHECK-NEXT: xori32 a0, a0, 1
1255 ; CHECK-NEXT: or16 a0, a1
1258 ; GENERIC-LABEL: ICMP_BIT_uge:
1259 ; GENERIC: # %bb.0: # %entry
1260 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1261 ; GENERIC-NEXT: subi16 sp, sp, 4
1262 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1263 ; GENERIC-NEXT: movi16 a2, 1
1264 ; GENERIC-NEXT: xor16 a0, a2
1265 ; GENERIC-NEXT: or16 a0, a1
1266 ; GENERIC-NEXT: addi16 sp, sp, 4
1267 ; GENERIC-NEXT: rts16
1269 %icmp = icmp uge i1 %y, %x
1273 define i1 @ICMP_BIT_I_uge(i1 %x) {
1274 ; CHECK-LABEL: ICMP_BIT_I_uge:
1275 ; CHECK: # %bb.0: # %entry
1278 ; GENERIC-LABEL: ICMP_BIT_I_uge:
1279 ; GENERIC: # %bb.0: # %entry
1280 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1281 ; GENERIC-NEXT: subi16 sp, sp, 4
1282 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1283 ; GENERIC-NEXT: addi16 sp, sp, 4
1284 ; GENERIC-NEXT: rts16
1286 %icmp = icmp uge i1 %x, 1
1292 define i1 @icmpRR_ult(i32 %x, i32 %y) {
1293 ; CHECK-LABEL: icmpRR_ult:
1294 ; CHECK: # %bb.0: # %entry
1295 ; CHECK-NEXT: cmphs16 a1, a0
1296 ; CHECK-NEXT: mvcv16 a0
1299 ; GENERIC-LABEL: icmpRR_ult:
1300 ; GENERIC: # %bb.0: # %entry
1301 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1302 ; GENERIC-NEXT: subi16 sp, sp, 4
1303 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1304 ; GENERIC-NEXT: cmphs16 a1, a0
1305 ; GENERIC-NEXT: mvcv16 a0
1306 ; GENERIC-NEXT: addi16 sp, sp, 4
1307 ; GENERIC-NEXT: rts16
1309 %icmp = icmp ult i32 %y, %x
1313 define i1 @icmpRI_ult(i32 %x) {
1314 ; CHECK-LABEL: icmpRI_ult:
1315 ; CHECK: # %bb.0: # %entry
1316 ; CHECK-NEXT: cmphsi16 a0, 10
1317 ; CHECK-NEXT: mvcv16 a0
1320 ; GENERIC-LABEL: icmpRI_ult:
1321 ; GENERIC: # %bb.0: # %entry
1322 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1323 ; GENERIC-NEXT: subi16 sp, sp, 4
1324 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1325 ; GENERIC-NEXT: cmphsi16 a0, 10
1326 ; GENERIC-NEXT: mvcv16 a0
1327 ; GENERIC-NEXT: addi16 sp, sp, 4
1328 ; GENERIC-NEXT: rts16
1330 %icmp = icmp ult i32 %x, 10
1334 define i1 @icmpRI_X_ult(i32 %x) {
1335 ; CHECK-LABEL: icmpRI_X_ult:
1336 ; CHECK: # %bb.0: # %entry
1337 ; CHECK-NEXT: movih32 a1, 62
1338 ; CHECK-NEXT: ori32 a1, a1, 33768
1339 ; CHECK-NEXT: cmphs16 a0, a1
1340 ; CHECK-NEXT: mvcv16 a0
1343 ; GENERIC-LABEL: icmpRI_X_ult:
1344 ; GENERIC: # %bb.0: # %entry
1345 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1346 ; GENERIC-NEXT: subi16 sp, sp, 4
1347 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1348 ; GENERIC-NEXT: movi16 a1, 0
1349 ; GENERIC-NEXT: lsli16 a1, a1, 24
1350 ; GENERIC-NEXT: movi16 a2, 62
1351 ; GENERIC-NEXT: lsli16 a2, a2, 16
1352 ; GENERIC-NEXT: or16 a2, a1
1353 ; GENERIC-NEXT: movi16 a1, 131
1354 ; GENERIC-NEXT: lsli16 a1, a1, 8
1355 ; GENERIC-NEXT: or16 a1, a2
1356 ; GENERIC-NEXT: movi16 a2, 232
1357 ; GENERIC-NEXT: or16 a2, a1
1358 ; GENERIC-NEXT: cmphs16 a0, a2
1359 ; GENERIC-NEXT: mvcv16 a0
1360 ; GENERIC-NEXT: addi16 sp, sp, 4
1361 ; GENERIC-NEXT: rts16
1363 %icmp = icmp ult i32 %x, 4097000
1367 define i1 @ICMP_LONG_ult(i64 %x, i64 %y) {
1368 ; CHECK-LABEL: ICMP_LONG_ult:
1369 ; CHECK: # %bb.0: # %entry
1370 ; CHECK-NEXT: .cfi_def_cfa_offset 0
1371 ; CHECK-NEXT: subi16 sp, sp, 8
1372 ; CHECK-NEXT: .cfi_def_cfa_offset 8
1373 ; CHECK-NEXT: cmpne16 a3, a1
1374 ; CHECK-NEXT: mvc32 t0
1375 ; CHECK-NEXT: st32.w t0, (sp, 4)
1376 ; CHECK-NEXT: cmphs16 a3, a1
1377 ; CHECK-NEXT: mvcv16 a1
1378 ; CHECK-NEXT: cmphs16 a2, a0
1379 ; CHECK-NEXT: mvcv16 a0
1380 ; CHECK-NEXT: ld16.w a2, (sp, 4)
1381 ; CHECK-NEXT: btsti16 a2, 0
1382 ; CHECK-NEXT: movf32 a1, a0
1383 ; CHECK-NEXT: mov16 a0, a1
1384 ; CHECK-NEXT: addi16 sp, sp, 8
1387 ; GENERIC-LABEL: ICMP_LONG_ult:
1388 ; GENERIC: # %bb.0: # %entry
1389 ; GENERIC-NEXT: subi16 sp, sp, 4
1390 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1391 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
1392 ; GENERIC-NEXT: .cfi_offset l0, -4
1393 ; GENERIC-NEXT: subi16 sp, sp, 4
1394 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
1395 ; GENERIC-NEXT: cmphs16 a3, a1
1396 ; GENERIC-NEXT: mvcv16 l0
1397 ; GENERIC-NEXT: cmphs16 a2, a0
1398 ; GENERIC-NEXT: mvcv16 a0
1399 ; GENERIC-NEXT: cmpne16 a3, a1
1400 ; GENERIC-NEXT: mvcv16 a1
1401 ; GENERIC-NEXT: btsti16 a1, 0
1402 ; GENERIC-NEXT: bt16 .LBB48_2
1403 ; GENERIC-NEXT: # %bb.1: # %entry
1404 ; GENERIC-NEXT: mov16 a0, l0
1405 ; GENERIC-NEXT: .LBB48_2: # %entry
1406 ; GENERIC-NEXT: addi16 sp, sp, 4
1407 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
1408 ; GENERIC-NEXT: addi16 sp, sp, 4
1409 ; GENERIC-NEXT: rts16
1411 %icmp = icmp ult i64 %y, %x
1415 define i1 @ICMP_LONG_I_ult(i64 %x) {
1416 ; CHECK-LABEL: ICMP_LONG_I_ult:
1417 ; CHECK: # %bb.0: # %entry
1418 ; CHECK-NEXT: or16 a0, a1
1419 ; CHECK-NEXT: cmpnei16 a0, 0
1420 ; CHECK-NEXT: mvcv16 a0
1423 ; GENERIC-LABEL: ICMP_LONG_I_ult:
1424 ; GENERIC: # %bb.0: # %entry
1425 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1426 ; GENERIC-NEXT: subi16 sp, sp, 4
1427 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1428 ; GENERIC-NEXT: or16 a0, a1
1429 ; GENERIC-NEXT: cmpnei16 a0, 0
1430 ; GENERIC-NEXT: mvcv16 a0
1431 ; GENERIC-NEXT: addi16 sp, sp, 4
1432 ; GENERIC-NEXT: rts16
1434 %icmp = icmp ult i64 %x, 1
1438 define i1 @ICMP_SHORT_ult(i16 %x, i16 %y) {
1439 ; CHECK-LABEL: ICMP_SHORT_ult:
1440 ; CHECK: # %bb.0: # %entry
1441 ; CHECK-NEXT: zexth16 a0, a0
1442 ; CHECK-NEXT: zexth16 a1, a1
1443 ; CHECK-NEXT: cmphs16 a1, a0
1444 ; CHECK-NEXT: mvcv16 a0
1447 ; GENERIC-LABEL: ICMP_SHORT_ult:
1448 ; GENERIC: # %bb.0: # %entry
1449 ; GENERIC-NEXT: subi16 sp, sp, 4
1450 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1451 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
1452 ; GENERIC-NEXT: .cfi_offset l0, -4
1453 ; GENERIC-NEXT: subi16 sp, sp, 4
1454 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
1455 ; GENERIC-NEXT: movi16 a2, 0
1456 ; GENERIC-NEXT: lsli16 a3, a2, 24
1457 ; GENERIC-NEXT: lsli16 a2, a2, 16
1458 ; GENERIC-NEXT: or16 a2, a3
1459 ; GENERIC-NEXT: movi16 a3, 255
1460 ; GENERIC-NEXT: lsli16 l0, a3, 8
1461 ; GENERIC-NEXT: or16 l0, a2
1462 ; GENERIC-NEXT: or16 l0, a3
1463 ; GENERIC-NEXT: and16 a0, l0
1464 ; GENERIC-NEXT: and16 l0, a1
1465 ; GENERIC-NEXT: cmphs16 l0, a0
1466 ; GENERIC-NEXT: mvcv16 a0
1467 ; GENERIC-NEXT: addi16 sp, sp, 4
1468 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
1469 ; GENERIC-NEXT: addi16 sp, sp, 4
1470 ; GENERIC-NEXT: rts16
1472 %icmp = icmp ult i16 %y, %x
1476 define i1 @ICMP_SHORT_I_ult(i16 %x) {
1477 ; CHECK-LABEL: ICMP_SHORT_I_ult:
1478 ; CHECK: # %bb.0: # %entry
1479 ; CHECK-NEXT: zexth16 a0, a0
1480 ; CHECK-NEXT: cmpnei16 a0, 0
1481 ; CHECK-NEXT: mvcv16 a0
1484 ; GENERIC-LABEL: ICMP_SHORT_I_ult:
1485 ; GENERIC: # %bb.0: # %entry
1486 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1487 ; GENERIC-NEXT: subi16 sp, sp, 4
1488 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1489 ; GENERIC-NEXT: movi16 a1, 0
1490 ; GENERIC-NEXT: lsli16 a2, a1, 24
1491 ; GENERIC-NEXT: lsli16 a1, a1, 16
1492 ; GENERIC-NEXT: or16 a1, a2
1493 ; GENERIC-NEXT: movi16 a2, 255
1494 ; GENERIC-NEXT: lsli16 a3, a2, 8
1495 ; GENERIC-NEXT: or16 a3, a1
1496 ; GENERIC-NEXT: or16 a3, a2
1497 ; GENERIC-NEXT: and16 a3, a0
1498 ; GENERIC-NEXT: cmpnei16 a3, 0
1499 ; GENERIC-NEXT: mvcv16 a0
1500 ; GENERIC-NEXT: addi16 sp, sp, 4
1501 ; GENERIC-NEXT: rts16
1503 %icmp = icmp ult i16 %x, 1
1507 define i1 @ICMP_CHAR_ult(i8 %x, i8 %y) {
1508 ; CHECK-LABEL: ICMP_CHAR_ult:
1509 ; CHECK: # %bb.0: # %entry
1510 ; CHECK-NEXT: zextb16 a0, a0
1511 ; CHECK-NEXT: zextb16 a1, a1
1512 ; CHECK-NEXT: cmphs16 a1, a0
1513 ; CHECK-NEXT: mvcv16 a0
1516 ; GENERIC-LABEL: ICMP_CHAR_ult:
1517 ; GENERIC: # %bb.0: # %entry
1518 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1519 ; GENERIC-NEXT: subi16 sp, sp, 4
1520 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1521 ; GENERIC-NEXT: movi16 a2, 255
1522 ; GENERIC-NEXT: and16 a0, a2
1523 ; GENERIC-NEXT: and16 a1, a2
1524 ; GENERIC-NEXT: cmphs16 a1, a0
1525 ; GENERIC-NEXT: mvcv16 a0
1526 ; GENERIC-NEXT: addi16 sp, sp, 4
1527 ; GENERIC-NEXT: rts16
1529 %icmp = icmp ult i8 %y, %x
1533 define i1 @ICMP_CHAR_I_ult(i8 %x) {
1534 ; CHECK-LABEL: ICMP_CHAR_I_ult:
1535 ; CHECK: # %bb.0: # %entry
1536 ; CHECK-NEXT: zextb16 a0, a0
1537 ; CHECK-NEXT: cmpnei16 a0, 0
1538 ; CHECK-NEXT: mvcv16 a0
1541 ; GENERIC-LABEL: ICMP_CHAR_I_ult:
1542 ; GENERIC: # %bb.0: # %entry
1543 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1544 ; GENERIC-NEXT: subi16 sp, sp, 4
1545 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1546 ; GENERIC-NEXT: movi16 a1, 255
1547 ; GENERIC-NEXT: and16 a1, a0
1548 ; GENERIC-NEXT: cmpnei16 a1, 0
1549 ; GENERIC-NEXT: mvcv16 a0
1550 ; GENERIC-NEXT: addi16 sp, sp, 4
1551 ; GENERIC-NEXT: rts16
1553 %icmp = icmp ult i8 %x, 1
1557 define i1 @ICMP_BIT_ult(i1 %x, i1 %y) {
1558 ; CHECK-LABEL: ICMP_BIT_ult:
1559 ; CHECK: # %bb.0: # %entry
1560 ; CHECK-NEXT: xori32 a1, a1, 1
1561 ; CHECK-NEXT: and16 a0, a1
1564 ; GENERIC-LABEL: ICMP_BIT_ult:
1565 ; GENERIC: # %bb.0: # %entry
1566 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1567 ; GENERIC-NEXT: subi16 sp, sp, 4
1568 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1569 ; GENERIC-NEXT: movi16 a2, 1
1570 ; GENERIC-NEXT: xor16 a2, a1
1571 ; GENERIC-NEXT: and16 a0, a2
1572 ; GENERIC-NEXT: addi16 sp, sp, 4
1573 ; GENERIC-NEXT: rts16
1575 %icmp = icmp ult i1 %y, %x
1579 define i1 @ICMP_BIT_I_ult(i1 %x) {
1580 ; CHECK-LABEL: ICMP_BIT_I_ult:
1581 ; CHECK: # %bb.0: # %entry
1582 ; CHECK-NEXT: xori32 a0, a0, 1
1585 ; GENERIC-LABEL: ICMP_BIT_I_ult:
1586 ; GENERIC: # %bb.0: # %entry
1587 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1588 ; GENERIC-NEXT: subi16 sp, sp, 4
1589 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1590 ; GENERIC-NEXT: movi16 a1, 1
1591 ; GENERIC-NEXT: xor16 a0, a1
1592 ; GENERIC-NEXT: addi16 sp, sp, 4
1593 ; GENERIC-NEXT: rts16
1595 %icmp = icmp ult i1 %x, 1
1601 define i1 @icmpRR_ule(i32 %x, i32 %y) {
1602 ; CHECK-LABEL: icmpRR_ule:
1603 ; CHECK: # %bb.0: # %entry
1604 ; CHECK-NEXT: cmphs16 a0, a1
1605 ; CHECK-NEXT: mvc32 a0
1608 ; GENERIC-LABEL: icmpRR_ule:
1609 ; GENERIC: # %bb.0: # %entry
1610 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1611 ; GENERIC-NEXT: subi16 sp, sp, 4
1612 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1613 ; GENERIC-NEXT: cmphs16 a0, a1
1614 ; GENERIC-NEXT: mvcv16 a1
1615 ; GENERIC-NEXT: movi16 a0, 1
1616 ; GENERIC-NEXT: subu16 a0, a1
1617 ; GENERIC-NEXT: addi16 sp, sp, 4
1618 ; GENERIC-NEXT: rts16
1620 %icmp = icmp ule i32 %y, %x
1624 define i1 @icmpRI_ule(i32 %x) {
1625 ; CHECK-LABEL: icmpRI_ule:
1626 ; CHECK: # %bb.0: # %entry
1627 ; CHECK-NEXT: cmphsi16 a0, 11
1628 ; CHECK-NEXT: mvcv16 a0
1631 ; GENERIC-LABEL: icmpRI_ule:
1632 ; GENERIC: # %bb.0: # %entry
1633 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1634 ; GENERIC-NEXT: subi16 sp, sp, 4
1635 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1636 ; GENERIC-NEXT: cmphsi16 a0, 11
1637 ; GENERIC-NEXT: mvcv16 a0
1638 ; GENERIC-NEXT: addi16 sp, sp, 4
1639 ; GENERIC-NEXT: rts16
1641 %icmp = icmp ule i32 %x, 10
1645 define i1 @icmpRI_X_ule(i32 %x) {
1646 ; CHECK-LABEL: icmpRI_X_ule:
1647 ; CHECK: # %bb.0: # %entry
1648 ; CHECK-NEXT: movih32 a1, 62
1649 ; CHECK-NEXT: ori32 a1, a1, 33769
1650 ; CHECK-NEXT: cmphs16 a0, a1
1651 ; CHECK-NEXT: mvcv16 a0
1654 ; GENERIC-LABEL: icmpRI_X_ule:
1655 ; GENERIC: # %bb.0: # %entry
1656 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1657 ; GENERIC-NEXT: subi16 sp, sp, 4
1658 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1659 ; GENERIC-NEXT: movi16 a1, 0
1660 ; GENERIC-NEXT: lsli16 a1, a1, 24
1661 ; GENERIC-NEXT: movi16 a2, 62
1662 ; GENERIC-NEXT: lsli16 a2, a2, 16
1663 ; GENERIC-NEXT: or16 a2, a1
1664 ; GENERIC-NEXT: movi16 a1, 131
1665 ; GENERIC-NEXT: lsli16 a1, a1, 8
1666 ; GENERIC-NEXT: or16 a1, a2
1667 ; GENERIC-NEXT: movi16 a2, 233
1668 ; GENERIC-NEXT: or16 a2, a1
1669 ; GENERIC-NEXT: cmphs16 a0, a2
1670 ; GENERIC-NEXT: mvcv16 a0
1671 ; GENERIC-NEXT: addi16 sp, sp, 4
1672 ; GENERIC-NEXT: rts16
1674 %icmp = icmp ule i32 %x, 4097000
1678 define i1 @ICMP_LONG_ule(i64 %x, i64 %y) {
1679 ; CHECK-LABEL: ICMP_LONG_ule:
1680 ; CHECK: # %bb.0: # %entry
1681 ; CHECK-NEXT: .cfi_def_cfa_offset 0
1682 ; CHECK-NEXT: subi16 sp, sp, 16
1683 ; CHECK-NEXT: .cfi_def_cfa_offset 16
1684 ; CHECK-NEXT: cmphs16 a1, a3
1685 ; CHECK-NEXT: mvc32 t0
1686 ; CHECK-NEXT: st32.w t0, (sp, 12)
1687 ; CHECK-NEXT: cmphs16 a0, a2
1688 ; CHECK-NEXT: mvc32 a0
1689 ; CHECK-NEXT: st16.w a0, (sp, 4)
1690 ; CHECK-NEXT: cmpne16 a3, a1
1691 ; CHECK-NEXT: mvc32 a0
1692 ; CHECK-NEXT: st16.w a0, (sp, 8)
1693 ; CHECK-NEXT: ld16.w a0, (sp, 4)
1694 ; CHECK-NEXT: btsti16 a0, 0
1695 ; CHECK-NEXT: mvc32 a1
1696 ; CHECK-NEXT: ld16.w a0, (sp, 12)
1697 ; CHECK-NEXT: btsti16 a0, 0
1698 ; CHECK-NEXT: mvc32 a0
1699 ; CHECK-NEXT: ld16.w a2, (sp, 8)
1700 ; CHECK-NEXT: btsti16 a2, 0
1701 ; CHECK-NEXT: movf32 a0, a1
1702 ; CHECK-NEXT: addi16 sp, sp, 16
1705 ; GENERIC-LABEL: ICMP_LONG_ule:
1706 ; GENERIC: # %bb.0: # %entry
1707 ; GENERIC-NEXT: subi16 sp, sp, 8
1708 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
1709 ; GENERIC-NEXT: st16.w l1, (sp, 4) # 4-byte Folded Spill
1710 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
1711 ; GENERIC-NEXT: .cfi_offset l1, -4
1712 ; GENERIC-NEXT: .cfi_offset l0, -8
1713 ; GENERIC-NEXT: subi16 sp, sp, 4
1714 ; GENERIC-NEXT: .cfi_def_cfa_offset 12
1715 ; GENERIC-NEXT: mov16 l0, a0
1716 ; GENERIC-NEXT: cmphs16 a1, a3
1717 ; GENERIC-NEXT: mvcv16 l1
1718 ; GENERIC-NEXT: movi16 a0, 1
1719 ; GENERIC-NEXT: cmphs16 l0, a2
1720 ; GENERIC-NEXT: mvcv16 a2
1721 ; GENERIC-NEXT: cmpne16 a3, a1
1722 ; GENERIC-NEXT: mvcv16 a1
1723 ; GENERIC-NEXT: btsti16 a1, 0
1724 ; GENERIC-NEXT: bt16 .LBB59_2
1725 ; GENERIC-NEXT: # %bb.1: # %entry
1726 ; GENERIC-NEXT: subu16 a0, l1
1727 ; GENERIC-NEXT: br32 .LBB59_3
1728 ; GENERIC-NEXT: .LBB59_2:
1729 ; GENERIC-NEXT: subu16 a0, a2
1730 ; GENERIC-NEXT: .LBB59_3: # %entry
1731 ; GENERIC-NEXT: addi16 sp, sp, 4
1732 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
1733 ; GENERIC-NEXT: ld16.w l1, (sp, 4) # 4-byte Folded Reload
1734 ; GENERIC-NEXT: addi16 sp, sp, 8
1735 ; GENERIC-NEXT: rts16
1737 %icmp = icmp ule i64 %y, %x
1741 define i1 @ICMP_LONG_I_ule(i64 %x) {
1742 ; CHECK-LABEL: ICMP_LONG_I_ule:
1743 ; CHECK: # %bb.0: # %entry
1744 ; CHECK-NEXT: .cfi_def_cfa_offset 0
1745 ; CHECK-NEXT: subi16 sp, sp, 8
1746 ; CHECK-NEXT: .cfi_def_cfa_offset 8
1747 ; CHECK-NEXT: cmpnei16 a1, 0
1748 ; CHECK-NEXT: mvc32 a1
1749 ; CHECK-NEXT: st16.w a1, (sp, 4)
1750 ; CHECK-NEXT: cmphsi16 a0, 2
1751 ; CHECK-NEXT: mvcv16 a1
1752 ; CHECK-NEXT: movi16 a0, 0
1753 ; CHECK-NEXT: ld16.w a2, (sp, 4)
1754 ; CHECK-NEXT: btsti16 a2, 0
1755 ; CHECK-NEXT: movf32 a0, a1
1756 ; CHECK-NEXT: addi16 sp, sp, 8
1759 ; GENERIC-LABEL: ICMP_LONG_I_ule:
1760 ; GENERIC: # %bb.0: # %entry
1761 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1762 ; GENERIC-NEXT: subi16 sp, sp, 4
1763 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1764 ; GENERIC-NEXT: cmphsi16 a0, 2
1765 ; GENERIC-NEXT: mvcv16 a0
1766 ; GENERIC-NEXT: cmpnei16 a1, 0
1767 ; GENERIC-NEXT: mvcv16 a1
1768 ; GENERIC-NEXT: btsti16 a1, 0
1769 ; GENERIC-NEXT: bt16 .LBB60_2
1770 ; GENERIC-NEXT: # %bb.1: # %entry
1771 ; GENERIC-NEXT: movi16 a0, 0
1772 ; GENERIC-NEXT: .LBB60_2: # %entry
1773 ; GENERIC-NEXT: addi16 sp, sp, 4
1774 ; GENERIC-NEXT: rts16
1776 %icmp = icmp ule i64 %x, 1
1780 define i1 @ICMP_SHORT_ule(i16 %x, i16 %y) {
1781 ; CHECK-LABEL: ICMP_SHORT_ule:
1782 ; CHECK: # %bb.0: # %entry
1783 ; CHECK-NEXT: zexth16 a1, a1
1784 ; CHECK-NEXT: zexth16 a0, a0
1785 ; CHECK-NEXT: cmphs16 a0, a1
1786 ; CHECK-NEXT: mvc32 a0
1789 ; GENERIC-LABEL: ICMP_SHORT_ule:
1790 ; GENERIC: # %bb.0: # %entry
1791 ; GENERIC-NEXT: subi16 sp, sp, 4
1792 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1793 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
1794 ; GENERIC-NEXT: .cfi_offset l0, -4
1795 ; GENERIC-NEXT: subi16 sp, sp, 4
1796 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
1797 ; GENERIC-NEXT: movi16 a2, 0
1798 ; GENERIC-NEXT: lsli16 a3, a2, 24
1799 ; GENERIC-NEXT: lsli16 a2, a2, 16
1800 ; GENERIC-NEXT: or16 a2, a3
1801 ; GENERIC-NEXT: movi16 a3, 255
1802 ; GENERIC-NEXT: lsli16 l0, a3, 8
1803 ; GENERIC-NEXT: or16 l0, a2
1804 ; GENERIC-NEXT: or16 l0, a3
1805 ; GENERIC-NEXT: and16 a1, l0
1806 ; GENERIC-NEXT: and16 l0, a0
1807 ; GENERIC-NEXT: cmphs16 l0, a1
1808 ; GENERIC-NEXT: mvcv16 a1
1809 ; GENERIC-NEXT: movi16 a0, 1
1810 ; GENERIC-NEXT: subu16 a0, a1
1811 ; GENERIC-NEXT: addi16 sp, sp, 4
1812 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
1813 ; GENERIC-NEXT: addi16 sp, sp, 4
1814 ; GENERIC-NEXT: rts16
1816 %icmp = icmp ule i16 %y, %x
1820 define i1 @ICMP_SHORT_I_ule(i16 %x) {
1821 ; CHECK-LABEL: ICMP_SHORT_I_ule:
1822 ; CHECK: # %bb.0: # %entry
1823 ; CHECK-NEXT: zexth16 a0, a0
1824 ; CHECK-NEXT: cmphsi16 a0, 2
1825 ; CHECK-NEXT: mvcv16 a0
1828 ; GENERIC-LABEL: ICMP_SHORT_I_ule:
1829 ; GENERIC: # %bb.0: # %entry
1830 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1831 ; GENERIC-NEXT: subi16 sp, sp, 4
1832 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1833 ; GENERIC-NEXT: movi16 a1, 0
1834 ; GENERIC-NEXT: lsli16 a2, a1, 24
1835 ; GENERIC-NEXT: lsli16 a1, a1, 16
1836 ; GENERIC-NEXT: or16 a1, a2
1837 ; GENERIC-NEXT: movi16 a2, 255
1838 ; GENERIC-NEXT: lsli16 a3, a2, 8
1839 ; GENERIC-NEXT: or16 a3, a1
1840 ; GENERIC-NEXT: or16 a3, a2
1841 ; GENERIC-NEXT: and16 a3, a0
1842 ; GENERIC-NEXT: cmphsi16 a3, 2
1843 ; GENERIC-NEXT: mvcv16 a0
1844 ; GENERIC-NEXT: addi16 sp, sp, 4
1845 ; GENERIC-NEXT: rts16
1847 %icmp = icmp ule i16 %x, 1
1851 define i1 @ICMP_CHAR_ule(i8 %x, i8 %y) {
1852 ; CHECK-LABEL: ICMP_CHAR_ule:
1853 ; CHECK: # %bb.0: # %entry
1854 ; CHECK-NEXT: zextb16 a1, a1
1855 ; CHECK-NEXT: zextb16 a0, a0
1856 ; CHECK-NEXT: cmphs16 a0, a1
1857 ; CHECK-NEXT: mvc32 a0
1860 ; GENERIC-LABEL: ICMP_CHAR_ule:
1861 ; GENERIC: # %bb.0: # %entry
1862 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1863 ; GENERIC-NEXT: subi16 sp, sp, 4
1864 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1865 ; GENERIC-NEXT: movi16 a2, 255
1866 ; GENERIC-NEXT: and16 a1, a2
1867 ; GENERIC-NEXT: and16 a0, a2
1868 ; GENERIC-NEXT: cmphs16 a0, a1
1869 ; GENERIC-NEXT: mvcv16 a1
1870 ; GENERIC-NEXT: movi16 a0, 1
1871 ; GENERIC-NEXT: subu16 a0, a1
1872 ; GENERIC-NEXT: addi16 sp, sp, 4
1873 ; GENERIC-NEXT: rts16
1875 %icmp = icmp ule i8 %y, %x
1879 define i1 @ICMP_CHAR_I_ule(i8 %x) {
1880 ; CHECK-LABEL: ICMP_CHAR_I_ule:
1881 ; CHECK: # %bb.0: # %entry
1882 ; CHECK-NEXT: zextb16 a0, a0
1883 ; CHECK-NEXT: cmphsi16 a0, 2
1884 ; CHECK-NEXT: mvcv16 a0
1887 ; GENERIC-LABEL: ICMP_CHAR_I_ule:
1888 ; GENERIC: # %bb.0: # %entry
1889 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1890 ; GENERIC-NEXT: subi16 sp, sp, 4
1891 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1892 ; GENERIC-NEXT: movi16 a1, 255
1893 ; GENERIC-NEXT: and16 a1, a0
1894 ; GENERIC-NEXT: cmphsi16 a1, 2
1895 ; GENERIC-NEXT: mvcv16 a0
1896 ; GENERIC-NEXT: addi16 sp, sp, 4
1897 ; GENERIC-NEXT: rts16
1899 %icmp = icmp ule i8 %x, 1
1903 define i1 @ICMP_BIT_ule(i1 %x, i1 %y) {
1904 ; CHECK-LABEL: ICMP_BIT_ule:
1905 ; CHECK: # %bb.0: # %entry
1906 ; CHECK-NEXT: xori32 a1, a1, 1
1907 ; CHECK-NEXT: or16 a0, a1
1910 ; GENERIC-LABEL: ICMP_BIT_ule:
1911 ; GENERIC: # %bb.0: # %entry
1912 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1913 ; GENERIC-NEXT: subi16 sp, sp, 4
1914 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1915 ; GENERIC-NEXT: movi16 a2, 1
1916 ; GENERIC-NEXT: xor16 a2, a1
1917 ; GENERIC-NEXT: or16 a0, a2
1918 ; GENERIC-NEXT: addi16 sp, sp, 4
1919 ; GENERIC-NEXT: rts16
1921 %icmp = icmp ule i1 %y, %x
1925 define i1 @ICMP_BIT_I_ule(i1 %x) {
1926 ; CHECK-LABEL: ICMP_BIT_I_ule:
1927 ; CHECK: # %bb.0: # %entry
1928 ; CHECK-NEXT: movi16 a0, 1
1931 ; GENERIC-LABEL: ICMP_BIT_I_ule:
1932 ; GENERIC: # %bb.0: # %entry
1933 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1934 ; GENERIC-NEXT: subi16 sp, sp, 4
1935 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1936 ; GENERIC-NEXT: movi16 a0, 1
1937 ; GENERIC-NEXT: addi16 sp, sp, 4
1938 ; GENERIC-NEXT: rts16
1940 %icmp = icmp ule i1 %x, 1
1945 define i1 @icmpRR_sgt(i32 %x, i32 %y) {
1946 ; CHECK-LABEL: icmpRR_sgt:
1947 ; CHECK: # %bb.0: # %entry
1948 ; CHECK-NEXT: cmplt16 a0, a1
1949 ; CHECK-NEXT: mvc32 a0
1952 ; GENERIC-LABEL: icmpRR_sgt:
1953 ; GENERIC: # %bb.0: # %entry
1954 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1955 ; GENERIC-NEXT: subi16 sp, sp, 4
1956 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1957 ; GENERIC-NEXT: cmplt16 a0, a1
1958 ; GENERIC-NEXT: mvcv16 a1
1959 ; GENERIC-NEXT: movi16 a0, 1
1960 ; GENERIC-NEXT: subu16 a0, a1
1961 ; GENERIC-NEXT: addi16 sp, sp, 4
1962 ; GENERIC-NEXT: rts16
1964 %icmp = icmp sgt i32 %y, %x
1968 define i1 @icmpRI_sgt(i32 %x) {
1969 ; CHECK-LABEL: icmpRI_sgt:
1970 ; CHECK: # %bb.0: # %entry
1971 ; CHECK-NEXT: movi16 a1, 10
1972 ; CHECK-NEXT: cmplt16 a1, a0
1973 ; CHECK-NEXT: mvc32 a0
1976 ; GENERIC-LABEL: icmpRI_sgt:
1977 ; GENERIC: # %bb.0: # %entry
1978 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
1979 ; GENERIC-NEXT: subi16 sp, sp, 4
1980 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
1981 ; GENERIC-NEXT: movi16 a1, 10
1982 ; GENERIC-NEXT: cmplt16 a1, a0
1983 ; GENERIC-NEXT: mvcv16 a1
1984 ; GENERIC-NEXT: movi16 a0, 1
1985 ; GENERIC-NEXT: subu16 a0, a1
1986 ; GENERIC-NEXT: addi16 sp, sp, 4
1987 ; GENERIC-NEXT: rts16
1989 %icmp = icmp sgt i32 %x, 10
1993 define i1 @icmpRI_X_sgt(i32 %x) {
1994 ; CHECK-LABEL: icmpRI_X_sgt:
1995 ; CHECK: # %bb.0: # %entry
1996 ; CHECK-NEXT: movih32 a1, 62
1997 ; CHECK-NEXT: ori32 a1, a1, 33768
1998 ; CHECK-NEXT: cmplt16 a1, a0
1999 ; CHECK-NEXT: mvc32 a0
2002 ; GENERIC-LABEL: icmpRI_X_sgt:
2003 ; GENERIC: # %bb.0: # %entry
2004 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2005 ; GENERIC-NEXT: subi16 sp, sp, 4
2006 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2007 ; GENERIC-NEXT: movi16 a1, 0
2008 ; GENERIC-NEXT: lsli16 a1, a1, 24
2009 ; GENERIC-NEXT: movi16 a2, 62
2010 ; GENERIC-NEXT: lsli16 a2, a2, 16
2011 ; GENERIC-NEXT: or16 a2, a1
2012 ; GENERIC-NEXT: movi16 a1, 131
2013 ; GENERIC-NEXT: lsli16 a1, a1, 8
2014 ; GENERIC-NEXT: or16 a1, a2
2015 ; GENERIC-NEXT: movi16 a2, 232
2016 ; GENERIC-NEXT: or16 a2, a1
2017 ; GENERIC-NEXT: cmplt16 a2, a0
2018 ; GENERIC-NEXT: mvcv16 a1
2019 ; GENERIC-NEXT: movi16 a0, 1
2020 ; GENERIC-NEXT: subu16 a0, a1
2021 ; GENERIC-NEXT: addi16 sp, sp, 4
2022 ; GENERIC-NEXT: rts16
2024 %icmp = icmp sgt i32 %x, 4097000
2028 define i1 @ICMP_LONG_sgt(i64 %x, i64 %y) {
2029 ; CHECK-LABEL: ICMP_LONG_sgt:
2030 ; CHECK: # %bb.0: # %entry
2031 ; CHECK-NEXT: .cfi_def_cfa_offset 0
2032 ; CHECK-NEXT: subi16 sp, sp, 12
2033 ; CHECK-NEXT: .cfi_def_cfa_offset 12
2034 ; CHECK-NEXT: cmplt16 a1, a3
2035 ; CHECK-NEXT: mvc32 t0
2036 ; CHECK-NEXT: st32.w t0, (sp, 4)
2037 ; CHECK-NEXT: cmpne16 a3, a1
2038 ; CHECK-NEXT: mvc32 a1
2039 ; CHECK-NEXT: st16.w a1, (sp, 8)
2040 ; CHECK-NEXT: cmphs16 a0, a2
2041 ; CHECK-NEXT: mvcv16 a1
2042 ; CHECK-NEXT: ld16.w a0, (sp, 4)
2043 ; CHECK-NEXT: btsti16 a0, 0
2044 ; CHECK-NEXT: mvc32 a0
2045 ; CHECK-NEXT: ld16.w a2, (sp, 8)
2046 ; CHECK-NEXT: btsti16 a2, 0
2047 ; CHECK-NEXT: movf32 a0, a1
2048 ; CHECK-NEXT: addi16 sp, sp, 12
2051 ; GENERIC-LABEL: ICMP_LONG_sgt:
2052 ; GENERIC: # %bb.0: # %entry
2053 ; GENERIC-NEXT: subi16 sp, sp, 4
2054 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2055 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
2056 ; GENERIC-NEXT: .cfi_offset l0, -4
2057 ; GENERIC-NEXT: subi16 sp, sp, 4
2058 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
2059 ; GENERIC-NEXT: cmplt16 a1, a3
2060 ; GENERIC-NEXT: mvcv16 l0
2061 ; GENERIC-NEXT: cmphs16 a0, a2
2062 ; GENERIC-NEXT: mvcv16 a0
2063 ; GENERIC-NEXT: cmpne16 a3, a1
2064 ; GENERIC-NEXT: mvcv16 a1
2065 ; GENERIC-NEXT: btsti16 a1, 0
2066 ; GENERIC-NEXT: bt16 .LBB70_2
2067 ; GENERIC-NEXT: # %bb.1: # %entry
2068 ; GENERIC-NEXT: movi16 a0, 1
2069 ; GENERIC-NEXT: subu16 a0, l0
2070 ; GENERIC-NEXT: .LBB70_2: # %entry
2071 ; GENERIC-NEXT: addi16 sp, sp, 4
2072 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
2073 ; GENERIC-NEXT: addi16 sp, sp, 4
2074 ; GENERIC-NEXT: rts16
2076 %icmp = icmp sgt i64 %y, %x
2080 define i1 @ICMP_LONG_I_sgt(i64 %x) {
2081 ; CHECK-LABEL: ICMP_LONG_I_sgt:
2082 ; CHECK: # %bb.0: # %entry
2083 ; CHECK-NEXT: .cfi_def_cfa_offset 0
2084 ; CHECK-NEXT: subi16 sp, sp, 12
2085 ; CHECK-NEXT: .cfi_def_cfa_offset 12
2086 ; CHECK-NEXT: movi16 a2, 0
2087 ; CHECK-NEXT: cmplt16 a2, a1
2088 ; CHECK-NEXT: mvc32 a2
2089 ; CHECK-NEXT: st16.w a2, (sp, 8)
2090 ; CHECK-NEXT: movi16 a2, 1
2091 ; CHECK-NEXT: cmphs16 a2, a0
2092 ; CHECK-NEXT: mvcv16 a2
2093 ; CHECK-NEXT: cmpnei16 a1, 0
2094 ; CHECK-NEXT: mvc32 a0
2095 ; CHECK-NEXT: st16.w a0, (sp, 4)
2096 ; CHECK-NEXT: ld16.w a0, (sp, 8)
2097 ; CHECK-NEXT: btsti16 a0, 0
2098 ; CHECK-NEXT: mvc32 a0
2099 ; CHECK-NEXT: ld16.w a1, (sp, 4)
2100 ; CHECK-NEXT: btsti16 a1, 0
2101 ; CHECK-NEXT: movf32 a0, a2
2102 ; CHECK-NEXT: addi16 sp, sp, 12
2105 ; GENERIC-LABEL: ICMP_LONG_I_sgt:
2106 ; GENERIC: # %bb.0: # %entry
2107 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2108 ; GENERIC-NEXT: subi16 sp, sp, 4
2109 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2110 ; GENERIC-NEXT: movi16 a2, 0
2111 ; GENERIC-NEXT: cmplt16 a2, a1
2112 ; GENERIC-NEXT: mvcv16 a2
2113 ; GENERIC-NEXT: movi16 a3, 1
2114 ; GENERIC-NEXT: cmphs16 a3, a0
2115 ; GENERIC-NEXT: mvcv16 a0
2116 ; GENERIC-NEXT: cmpnei16 a1, 0
2117 ; GENERIC-NEXT: mvcv16 a1
2118 ; GENERIC-NEXT: btsti16 a1, 0
2119 ; GENERIC-NEXT: bt16 .LBB71_2
2120 ; GENERIC-NEXT: # %bb.1: # %entry
2121 ; GENERIC-NEXT: subu16 a3, a2
2122 ; GENERIC-NEXT: mov16 a0, a3
2123 ; GENERIC-NEXT: .LBB71_2: # %entry
2124 ; GENERIC-NEXT: addi16 sp, sp, 4
2125 ; GENERIC-NEXT: rts16
2127 %icmp = icmp sgt i64 %x, 1
2131 define i1 @ICMP_SHORT_sgt(i16 %x, i16 %y) {
2132 ; CHECK-LABEL: ICMP_SHORT_sgt:
2133 ; CHECK: # %bb.0: # %entry
2134 ; CHECK-NEXT: sexth16 a1, a1
2135 ; CHECK-NEXT: sexth16 a0, a0
2136 ; CHECK-NEXT: cmplt16 a0, a1
2137 ; CHECK-NEXT: mvc32 a0
2140 ; GENERIC-LABEL: ICMP_SHORT_sgt:
2141 ; GENERIC: # %bb.0: # %entry
2142 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2143 ; GENERIC-NEXT: subi16 sp, sp, 4
2144 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2145 ; GENERIC-NEXT: sexth16 a1, a1
2146 ; GENERIC-NEXT: sexth16 a0, a0
2147 ; GENERIC-NEXT: cmplt16 a0, a1
2148 ; GENERIC-NEXT: mvcv16 a1
2149 ; GENERIC-NEXT: movi16 a0, 1
2150 ; GENERIC-NEXT: subu16 a0, a1
2151 ; GENERIC-NEXT: addi16 sp, sp, 4
2152 ; GENERIC-NEXT: rts16
2154 %icmp = icmp sgt i16 %y, %x
2158 define i1 @ICMP_SHORT_I_sgt(i16 %x) {
2159 ; CHECK-LABEL: ICMP_SHORT_I_sgt:
2160 ; CHECK: # %bb.0: # %entry
2161 ; CHECK-NEXT: sexth16 a0, a0
2162 ; CHECK-NEXT: movi16 a1, 1
2163 ; CHECK-NEXT: cmplt16 a1, a0
2164 ; CHECK-NEXT: mvc32 a0
2167 ; GENERIC-LABEL: ICMP_SHORT_I_sgt:
2168 ; GENERIC: # %bb.0: # %entry
2169 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2170 ; GENERIC-NEXT: subi16 sp, sp, 4
2171 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2172 ; GENERIC-NEXT: sexth16 a1, a0
2173 ; GENERIC-NEXT: movi16 a0, 1
2174 ; GENERIC-NEXT: cmplt16 a0, a1
2175 ; GENERIC-NEXT: mvcv16 a1
2176 ; GENERIC-NEXT: subu16 a0, a1
2177 ; GENERIC-NEXT: addi16 sp, sp, 4
2178 ; GENERIC-NEXT: rts16
2180 %icmp = icmp sgt i16 %x, 1
2184 define i1 @ICMP_CHAR_sgt(i8 %x, i8 %y) {
2185 ; CHECK-LABEL: ICMP_CHAR_sgt:
2186 ; CHECK: # %bb.0: # %entry
2187 ; CHECK-NEXT: sextb16 a1, a1
2188 ; CHECK-NEXT: sextb16 a0, a0
2189 ; CHECK-NEXT: cmplt16 a0, a1
2190 ; CHECK-NEXT: mvc32 a0
2193 ; GENERIC-LABEL: ICMP_CHAR_sgt:
2194 ; GENERIC: # %bb.0: # %entry
2195 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2196 ; GENERIC-NEXT: subi16 sp, sp, 4
2197 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2198 ; GENERIC-NEXT: sextb16 a1, a1
2199 ; GENERIC-NEXT: sextb16 a0, a0
2200 ; GENERIC-NEXT: cmplt16 a0, a1
2201 ; GENERIC-NEXT: mvcv16 a1
2202 ; GENERIC-NEXT: movi16 a0, 1
2203 ; GENERIC-NEXT: subu16 a0, a1
2204 ; GENERIC-NEXT: addi16 sp, sp, 4
2205 ; GENERIC-NEXT: rts16
2207 %icmp = icmp sgt i8 %y, %x
2211 define i1 @ICMP_CHAR_I_sgt(i8 %x) {
2212 ; CHECK-LABEL: ICMP_CHAR_I_sgt:
2213 ; CHECK: # %bb.0: # %entry
2214 ; CHECK-NEXT: sextb16 a0, a0
2215 ; CHECK-NEXT: movi16 a1, 1
2216 ; CHECK-NEXT: cmplt16 a1, a0
2217 ; CHECK-NEXT: mvc32 a0
2220 ; GENERIC-LABEL: ICMP_CHAR_I_sgt:
2221 ; GENERIC: # %bb.0: # %entry
2222 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2223 ; GENERIC-NEXT: subi16 sp, sp, 4
2224 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2225 ; GENERIC-NEXT: sextb16 a1, a0
2226 ; GENERIC-NEXT: movi16 a0, 1
2227 ; GENERIC-NEXT: cmplt16 a0, a1
2228 ; GENERIC-NEXT: mvcv16 a1
2229 ; GENERIC-NEXT: subu16 a0, a1
2230 ; GENERIC-NEXT: addi16 sp, sp, 4
2231 ; GENERIC-NEXT: rts16
2233 %icmp = icmp sgt i8 %x, 1
2237 define i1 @ICMP_BIT_sgt(i1 %x, i1 %y) {
2238 ; CHECK-LABEL: ICMP_BIT_sgt:
2239 ; CHECK: # %bb.0: # %entry
2240 ; CHECK-NEXT: xori32 a1, a1, 1
2241 ; CHECK-NEXT: and16 a0, a1
2244 ; GENERIC-LABEL: ICMP_BIT_sgt:
2245 ; GENERIC: # %bb.0: # %entry
2246 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2247 ; GENERIC-NEXT: subi16 sp, sp, 4
2248 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2249 ; GENERIC-NEXT: movi16 a2, 1
2250 ; GENERIC-NEXT: xor16 a2, a1
2251 ; GENERIC-NEXT: and16 a0, a2
2252 ; GENERIC-NEXT: addi16 sp, sp, 4
2253 ; GENERIC-NEXT: rts16
2255 %icmp = icmp sgt i1 %y, %x
2259 define i1 @ICMP_BIT_I_sgt(i1 %x) {
2260 ; CHECK-LABEL: ICMP_BIT_I_sgt:
2261 ; CHECK: # %bb.0: # %entry
2262 ; CHECK-NEXT: xori32 a0, a0, 1
2265 ; GENERIC-LABEL: ICMP_BIT_I_sgt:
2266 ; GENERIC: # %bb.0: # %entry
2267 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2268 ; GENERIC-NEXT: subi16 sp, sp, 4
2269 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2270 ; GENERIC-NEXT: movi16 a1, 1
2271 ; GENERIC-NEXT: xor16 a0, a1
2272 ; GENERIC-NEXT: addi16 sp, sp, 4
2273 ; GENERIC-NEXT: rts16
2275 %icmp = icmp sgt i1 %x, 1
2280 define i1 @icmpRR_sge(i32 %x, i32 %y) {
2281 ; CHECK-LABEL: icmpRR_sge:
2282 ; CHECK: # %bb.0: # %entry
2283 ; CHECK-NEXT: cmplt16 a1, a0
2284 ; CHECK-NEXT: mvcv16 a0
2287 ; GENERIC-LABEL: icmpRR_sge:
2288 ; GENERIC: # %bb.0: # %entry
2289 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2290 ; GENERIC-NEXT: subi16 sp, sp, 4
2291 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2292 ; GENERIC-NEXT: cmplt16 a1, a0
2293 ; GENERIC-NEXT: mvcv16 a0
2294 ; GENERIC-NEXT: addi16 sp, sp, 4
2295 ; GENERIC-NEXT: rts16
2297 %icmp = icmp sge i32 %y, %x
2301 define i1 @icmpRI_sge(i32 %x) {
2302 ; CHECK-LABEL: icmpRI_sge:
2303 ; CHECK: # %bb.0: # %entry
2304 ; CHECK-NEXT: movi16 a1, 9
2305 ; CHECK-NEXT: cmplt16 a1, a0
2306 ; CHECK-NEXT: mvc32 a0
2309 ; GENERIC-LABEL: icmpRI_sge:
2310 ; GENERIC: # %bb.0: # %entry
2311 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2312 ; GENERIC-NEXT: subi16 sp, sp, 4
2313 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2314 ; GENERIC-NEXT: movi16 a1, 9
2315 ; GENERIC-NEXT: cmplt16 a1, a0
2316 ; GENERIC-NEXT: mvcv16 a1
2317 ; GENERIC-NEXT: movi16 a0, 1
2318 ; GENERIC-NEXT: subu16 a0, a1
2319 ; GENERIC-NEXT: addi16 sp, sp, 4
2320 ; GENERIC-NEXT: rts16
2322 %icmp = icmp sge i32 %x, 10
2326 define i1 @icmpRI_X_sge(i32 %x) {
2327 ; CHECK-LABEL: icmpRI_X_sge:
2328 ; CHECK: # %bb.0: # %entry
2329 ; CHECK-NEXT: movih32 a1, 62
2330 ; CHECK-NEXT: ori32 a1, a1, 33767
2331 ; CHECK-NEXT: cmplt16 a1, a0
2332 ; CHECK-NEXT: mvc32 a0
2335 ; GENERIC-LABEL: icmpRI_X_sge:
2336 ; GENERIC: # %bb.0: # %entry
2337 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2338 ; GENERIC-NEXT: subi16 sp, sp, 4
2339 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2340 ; GENERIC-NEXT: movi16 a1, 0
2341 ; GENERIC-NEXT: lsli16 a1, a1, 24
2342 ; GENERIC-NEXT: movi16 a2, 62
2343 ; GENERIC-NEXT: lsli16 a2, a2, 16
2344 ; GENERIC-NEXT: or16 a2, a1
2345 ; GENERIC-NEXT: movi16 a1, 131
2346 ; GENERIC-NEXT: lsli16 a1, a1, 8
2347 ; GENERIC-NEXT: or16 a1, a2
2348 ; GENERIC-NEXT: movi16 a2, 231
2349 ; GENERIC-NEXT: or16 a2, a1
2350 ; GENERIC-NEXT: cmplt16 a2, a0
2351 ; GENERIC-NEXT: mvcv16 a1
2352 ; GENERIC-NEXT: movi16 a0, 1
2353 ; GENERIC-NEXT: subu16 a0, a1
2354 ; GENERIC-NEXT: addi16 sp, sp, 4
2355 ; GENERIC-NEXT: rts16
2357 %icmp = icmp sge i32 %x, 4097000
2361 define i1 @ICMP_LONG_sge(i64 %x, i64 %y) {
2362 ; CHECK-LABEL: ICMP_LONG_sge:
2363 ; CHECK: # %bb.0: # %entry
2364 ; CHECK-NEXT: .cfi_def_cfa_offset 0
2365 ; CHECK-NEXT: subi16 sp, sp, 12
2366 ; CHECK-NEXT: .cfi_def_cfa_offset 12
2367 ; CHECK-NEXT: cmphs16 a2, a0
2368 ; CHECK-NEXT: mvc32 a0
2369 ; CHECK-NEXT: st16.w a0, (sp, 4)
2370 ; CHECK-NEXT: cmpne16 a3, a1
2371 ; CHECK-NEXT: mvc32 a0
2372 ; CHECK-NEXT: st16.w a0, (sp, 8)
2373 ; CHECK-NEXT: cmplt16 a3, a1
2374 ; CHECK-NEXT: mvcv16 a0
2375 ; CHECK-NEXT: ld16.w a1, (sp, 4)
2376 ; CHECK-NEXT: btsti16 a1, 0
2377 ; CHECK-NEXT: mvc32 a1
2378 ; CHECK-NEXT: ld16.w a2, (sp, 8)
2379 ; CHECK-NEXT: btsti16 a2, 0
2380 ; CHECK-NEXT: movf32 a0, a1
2381 ; CHECK-NEXT: addi16 sp, sp, 12
2384 ; GENERIC-LABEL: ICMP_LONG_sge:
2385 ; GENERIC: # %bb.0: # %entry
2386 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2387 ; GENERIC-NEXT: subi16 sp, sp, 4
2388 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2389 ; GENERIC-NEXT: cmphs16 a2, a0
2390 ; GENERIC-NEXT: mvcv16 a2
2391 ; GENERIC-NEXT: cmplt16 a3, a1
2392 ; GENERIC-NEXT: mvcv16 a0
2393 ; GENERIC-NEXT: cmpne16 a3, a1
2394 ; GENERIC-NEXT: mvcv16 a1
2395 ; GENERIC-NEXT: btsti16 a1, 0
2396 ; GENERIC-NEXT: bf16 .LBB81_2
2397 ; GENERIC-NEXT: # %bb.1:
2398 ; GENERIC-NEXT: movi16 a0, 1
2399 ; GENERIC-NEXT: subu16 a0, a2
2400 ; GENERIC-NEXT: .LBB81_2: # %entry
2401 ; GENERIC-NEXT: addi16 sp, sp, 4
2402 ; GENERIC-NEXT: rts16
2404 %icmp = icmp sge i64 %y, %x
2408 define i1 @ICMP_LONG_I_sge(i64 %x) {
2409 ; CHECK-LABEL: ICMP_LONG_I_sge:
2410 ; CHECK: # %bb.0: # %entry
2411 ; CHECK-NEXT: .cfi_def_cfa_offset 0
2412 ; CHECK-NEXT: subi16 sp, sp, 16
2413 ; CHECK-NEXT: .cfi_def_cfa_offset 16
2414 ; CHECK-NEXT: movi16 a2, 0
2415 ; CHECK-NEXT: cmplt16 a2, a1
2416 ; CHECK-NEXT: mvc32 a2
2417 ; CHECK-NEXT: st16.w a2, (sp, 12)
2418 ; CHECK-NEXT: cmpnei16 a0, 0
2419 ; CHECK-NEXT: mvc32 a0
2420 ; CHECK-NEXT: st16.w a0, (sp, 4)
2421 ; CHECK-NEXT: cmpnei16 a1, 0
2422 ; CHECK-NEXT: mvc32 a0
2423 ; CHECK-NEXT: st16.w a0, (sp, 8)
2424 ; CHECK-NEXT: ld16.w a0, (sp, 4)
2425 ; CHECK-NEXT: btsti16 a0, 0
2426 ; CHECK-NEXT: mvc32 a1
2427 ; CHECK-NEXT: ld16.w a0, (sp, 12)
2428 ; CHECK-NEXT: btsti16 a0, 0
2429 ; CHECK-NEXT: mvc32 a0
2430 ; CHECK-NEXT: ld16.w a2, (sp, 8)
2431 ; CHECK-NEXT: btsti16 a2, 0
2432 ; CHECK-NEXT: movf32 a0, a1
2433 ; CHECK-NEXT: addi16 sp, sp, 16
2436 ; GENERIC-LABEL: ICMP_LONG_I_sge:
2437 ; GENERIC: # %bb.0: # %entry
2438 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2439 ; GENERIC-NEXT: subi16 sp, sp, 4
2440 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2441 ; GENERIC-NEXT: mov16 a2, a0
2442 ; GENERIC-NEXT: movi16 a0, 0
2443 ; GENERIC-NEXT: cmplt16 a0, a1
2444 ; GENERIC-NEXT: mvcv16 a3
2445 ; GENERIC-NEXT: movi16 a0, 1
2446 ; GENERIC-NEXT: cmpnei16 a2, 0
2447 ; GENERIC-NEXT: mvcv16 a2
2448 ; GENERIC-NEXT: cmpnei16 a1, 0
2449 ; GENERIC-NEXT: mvcv16 a1
2450 ; GENERIC-NEXT: btsti16 a1, 0
2451 ; GENERIC-NEXT: bt16 .LBB82_2
2452 ; GENERIC-NEXT: # %bb.1: # %entry
2453 ; GENERIC-NEXT: subu16 a0, a3
2454 ; GENERIC-NEXT: addi16 sp, sp, 4
2455 ; GENERIC-NEXT: rts16
2456 ; GENERIC-NEXT: .LBB82_2:
2457 ; GENERIC-NEXT: subu16 a0, a2
2458 ; GENERIC-NEXT: addi16 sp, sp, 4
2459 ; GENERIC-NEXT: rts16
2461 %icmp = icmp sge i64 %x, 1
2465 define i1 @ICMP_SHORT_sge(i16 %x, i16 %y) {
2466 ; CHECK-LABEL: ICMP_SHORT_sge:
2467 ; CHECK: # %bb.0: # %entry
2468 ; CHECK-NEXT: sexth16 a0, a0
2469 ; CHECK-NEXT: sexth16 a1, a1
2470 ; CHECK-NEXT: cmplt16 a1, a0
2471 ; CHECK-NEXT: mvcv16 a0
2474 ; GENERIC-LABEL: ICMP_SHORT_sge:
2475 ; GENERIC: # %bb.0: # %entry
2476 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2477 ; GENERIC-NEXT: subi16 sp, sp, 4
2478 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2479 ; GENERIC-NEXT: sexth16 a0, a0
2480 ; GENERIC-NEXT: sexth16 a1, a1
2481 ; GENERIC-NEXT: cmplt16 a1, a0
2482 ; GENERIC-NEXT: mvcv16 a0
2483 ; GENERIC-NEXT: addi16 sp, sp, 4
2484 ; GENERIC-NEXT: rts16
2486 %icmp = icmp sge i16 %y, %x
2490 define i1 @ICMP_SHORT_I_sge(i16 %x) {
2491 ; CHECK-LABEL: ICMP_SHORT_I_sge:
2492 ; CHECK: # %bb.0: # %entry
2493 ; CHECK-NEXT: sexth16 a0, a0
2494 ; CHECK-NEXT: movi16 a1, 0
2495 ; CHECK-NEXT: cmplt16 a1, a0
2496 ; CHECK-NEXT: mvc32 a0
2499 ; GENERIC-LABEL: ICMP_SHORT_I_sge:
2500 ; GENERIC: # %bb.0: # %entry
2501 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2502 ; GENERIC-NEXT: subi16 sp, sp, 4
2503 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2504 ; GENERIC-NEXT: sexth16 a0, a0
2505 ; GENERIC-NEXT: movi16 a1, 0
2506 ; GENERIC-NEXT: cmplt16 a1, a0
2507 ; GENERIC-NEXT: mvcv16 a1
2508 ; GENERIC-NEXT: movi16 a0, 1
2509 ; GENERIC-NEXT: subu16 a0, a1
2510 ; GENERIC-NEXT: addi16 sp, sp, 4
2511 ; GENERIC-NEXT: rts16
2513 %icmp = icmp sge i16 %x, 1
2517 define i1 @ICMP_CHAR_sge(i8 %x, i8 %y) {
2518 ; CHECK-LABEL: ICMP_CHAR_sge:
2519 ; CHECK: # %bb.0: # %entry
2520 ; CHECK-NEXT: sextb16 a0, a0
2521 ; CHECK-NEXT: sextb16 a1, a1
2522 ; CHECK-NEXT: cmplt16 a1, a0
2523 ; CHECK-NEXT: mvcv16 a0
2526 ; GENERIC-LABEL: ICMP_CHAR_sge:
2527 ; GENERIC: # %bb.0: # %entry
2528 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2529 ; GENERIC-NEXT: subi16 sp, sp, 4
2530 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2531 ; GENERIC-NEXT: sextb16 a0, a0
2532 ; GENERIC-NEXT: sextb16 a1, a1
2533 ; GENERIC-NEXT: cmplt16 a1, a0
2534 ; GENERIC-NEXT: mvcv16 a0
2535 ; GENERIC-NEXT: addi16 sp, sp, 4
2536 ; GENERIC-NEXT: rts16
2538 %icmp = icmp sge i8 %y, %x
2542 define i1 @ICMP_CHAR_I_sge(i8 %x) {
2543 ; CHECK-LABEL: ICMP_CHAR_I_sge:
2544 ; CHECK: # %bb.0: # %entry
2545 ; CHECK-NEXT: sextb16 a0, a0
2546 ; CHECK-NEXT: movi16 a1, 0
2547 ; CHECK-NEXT: cmplt16 a1, a0
2548 ; CHECK-NEXT: mvc32 a0
2551 ; GENERIC-LABEL: ICMP_CHAR_I_sge:
2552 ; GENERIC: # %bb.0: # %entry
2553 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2554 ; GENERIC-NEXT: subi16 sp, sp, 4
2555 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2556 ; GENERIC-NEXT: sextb16 a0, a0
2557 ; GENERIC-NEXT: movi16 a1, 0
2558 ; GENERIC-NEXT: cmplt16 a1, a0
2559 ; GENERIC-NEXT: mvcv16 a1
2560 ; GENERIC-NEXT: movi16 a0, 1
2561 ; GENERIC-NEXT: subu16 a0, a1
2562 ; GENERIC-NEXT: addi16 sp, sp, 4
2563 ; GENERIC-NEXT: rts16
2565 %icmp = icmp sge i8 %x, 1
2569 define i1 @ICMP_BIT_sge(i1 %x, i1 %y) {
2570 ; CHECK-LABEL: ICMP_BIT_sge:
2571 ; CHECK: # %bb.0: # %entry
2572 ; CHECK-NEXT: xori32 a1, a1, 1
2573 ; CHECK-NEXT: or16 a0, a1
2576 ; GENERIC-LABEL: ICMP_BIT_sge:
2577 ; GENERIC: # %bb.0: # %entry
2578 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2579 ; GENERIC-NEXT: subi16 sp, sp, 4
2580 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2581 ; GENERIC-NEXT: movi16 a2, 1
2582 ; GENERIC-NEXT: xor16 a2, a1
2583 ; GENERIC-NEXT: or16 a0, a2
2584 ; GENERIC-NEXT: addi16 sp, sp, 4
2585 ; GENERIC-NEXT: rts16
2587 %icmp = icmp sge i1 %y, %x
2591 define i1 @ICMP_BIT_I_sge(i1 %x) {
2592 ; CHECK-LABEL: ICMP_BIT_I_sge:
2593 ; CHECK: # %bb.0: # %entry
2594 ; CHECK-NEXT: movi16 a0, 1
2597 ; GENERIC-LABEL: ICMP_BIT_I_sge:
2598 ; GENERIC: # %bb.0: # %entry
2599 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2600 ; GENERIC-NEXT: subi16 sp, sp, 4
2601 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2602 ; GENERIC-NEXT: movi16 a0, 1
2603 ; GENERIC-NEXT: addi16 sp, sp, 4
2604 ; GENERIC-NEXT: rts16
2606 %icmp = icmp sge i1 %x, 1
2611 define i1 @icmpRR_slt(i32 %x, i32 %y) {
2612 ; CHECK-LABEL: icmpRR_slt:
2613 ; CHECK: # %bb.0: # %entry
2614 ; CHECK-NEXT: cmplt16 a1, a0
2615 ; CHECK-NEXT: mvc32 a0
2618 ; GENERIC-LABEL: icmpRR_slt:
2619 ; GENERIC: # %bb.0: # %entry
2620 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2621 ; GENERIC-NEXT: subi16 sp, sp, 4
2622 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2623 ; GENERIC-NEXT: cmplt16 a1, a0
2624 ; GENERIC-NEXT: mvcv16 a1
2625 ; GENERIC-NEXT: movi16 a0, 1
2626 ; GENERIC-NEXT: subu16 a0, a1
2627 ; GENERIC-NEXT: addi16 sp, sp, 4
2628 ; GENERIC-NEXT: rts16
2630 %icmp = icmp slt i32 %y, %x
2634 define i1 @icmpRI_slt(i32 %x) {
2635 ; CHECK-LABEL: icmpRI_slt:
2636 ; CHECK: # %bb.0: # %entry
2637 ; CHECK-NEXT: cmplti16 a0, 10
2638 ; CHECK-NEXT: mvc32 a0
2641 ; GENERIC-LABEL: icmpRI_slt:
2642 ; GENERIC: # %bb.0: # %entry
2643 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2644 ; GENERIC-NEXT: subi16 sp, sp, 4
2645 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2646 ; GENERIC-NEXT: cmplti16 a0, 10
2647 ; GENERIC-NEXT: mvcv16 a1
2648 ; GENERIC-NEXT: movi16 a0, 1
2649 ; GENERIC-NEXT: subu16 a0, a1
2650 ; GENERIC-NEXT: addi16 sp, sp, 4
2651 ; GENERIC-NEXT: rts16
2653 %icmp = icmp slt i32 %x, 10
2657 define i1 @icmpRI_X_slt(i32 %x) {
2658 ; CHECK-LABEL: icmpRI_X_slt:
2659 ; CHECK: # %bb.0: # %entry
2660 ; CHECK-NEXT: movih32 a1, 62
2661 ; CHECK-NEXT: ori32 a1, a1, 33768
2662 ; CHECK-NEXT: cmplt16 a0, a1
2663 ; CHECK-NEXT: mvc32 a0
2666 ; GENERIC-LABEL: icmpRI_X_slt:
2667 ; GENERIC: # %bb.0: # %entry
2668 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2669 ; GENERIC-NEXT: subi16 sp, sp, 4
2670 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2671 ; GENERIC-NEXT: movi16 a1, 0
2672 ; GENERIC-NEXT: lsli16 a1, a1, 24
2673 ; GENERIC-NEXT: movi16 a2, 62
2674 ; GENERIC-NEXT: lsli16 a2, a2, 16
2675 ; GENERIC-NEXT: or16 a2, a1
2676 ; GENERIC-NEXT: movi16 a1, 131
2677 ; GENERIC-NEXT: lsli16 a1, a1, 8
2678 ; GENERIC-NEXT: or16 a1, a2
2679 ; GENERIC-NEXT: movi16 a2, 232
2680 ; GENERIC-NEXT: or16 a2, a1
2681 ; GENERIC-NEXT: cmplt16 a0, a2
2682 ; GENERIC-NEXT: mvcv16 a1
2683 ; GENERIC-NEXT: movi16 a0, 1
2684 ; GENERIC-NEXT: subu16 a0, a1
2685 ; GENERIC-NEXT: addi16 sp, sp, 4
2686 ; GENERIC-NEXT: rts16
2688 %icmp = icmp slt i32 %x, 4097000
2692 define i1 @ICMP_LONG_slt(i64 %x, i64 %y) {
2693 ; CHECK-LABEL: ICMP_LONG_slt:
2694 ; CHECK: # %bb.0: # %entry
2695 ; CHECK-NEXT: .cfi_def_cfa_offset 0
2696 ; CHECK-NEXT: subi16 sp, sp, 12
2697 ; CHECK-NEXT: .cfi_def_cfa_offset 12
2698 ; CHECK-NEXT: cmplt16 a3, a1
2699 ; CHECK-NEXT: mvc32 t0
2700 ; CHECK-NEXT: st32.w t0, (sp, 4)
2701 ; CHECK-NEXT: cmpne16 a3, a1
2702 ; CHECK-NEXT: mvc32 a1
2703 ; CHECK-NEXT: st16.w a1, (sp, 8)
2704 ; CHECK-NEXT: cmphs16 a2, a0
2705 ; CHECK-NEXT: mvcv16 a1
2706 ; CHECK-NEXT: ld16.w a0, (sp, 4)
2707 ; CHECK-NEXT: btsti16 a0, 0
2708 ; CHECK-NEXT: mvc32 a0
2709 ; CHECK-NEXT: ld16.w a2, (sp, 8)
2710 ; CHECK-NEXT: btsti16 a2, 0
2711 ; CHECK-NEXT: movf32 a0, a1
2712 ; CHECK-NEXT: addi16 sp, sp, 12
2715 ; GENERIC-LABEL: ICMP_LONG_slt:
2716 ; GENERIC: # %bb.0: # %entry
2717 ; GENERIC-NEXT: subi16 sp, sp, 4
2718 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2719 ; GENERIC-NEXT: st16.w l0, (sp, 0) # 4-byte Folded Spill
2720 ; GENERIC-NEXT: .cfi_offset l0, -4
2721 ; GENERIC-NEXT: subi16 sp, sp, 4
2722 ; GENERIC-NEXT: .cfi_def_cfa_offset 8
2723 ; GENERIC-NEXT: cmplt16 a3, a1
2724 ; GENERIC-NEXT: mvcv16 l0
2725 ; GENERIC-NEXT: cmphs16 a2, a0
2726 ; GENERIC-NEXT: mvcv16 a0
2727 ; GENERIC-NEXT: cmpne16 a3, a1
2728 ; GENERIC-NEXT: mvcv16 a1
2729 ; GENERIC-NEXT: btsti16 a1, 0
2730 ; GENERIC-NEXT: bt16 .LBB92_2
2731 ; GENERIC-NEXT: # %bb.1: # %entry
2732 ; GENERIC-NEXT: movi16 a0, 1
2733 ; GENERIC-NEXT: subu16 a0, l0
2734 ; GENERIC-NEXT: .LBB92_2: # %entry
2735 ; GENERIC-NEXT: addi16 sp, sp, 4
2736 ; GENERIC-NEXT: ld16.w l0, (sp, 0) # 4-byte Folded Reload
2737 ; GENERIC-NEXT: addi16 sp, sp, 4
2738 ; GENERIC-NEXT: rts16
2740 %icmp = icmp slt i64 %y, %x
2744 define i1 @ICMP_LONG_I_slt(i64 %x) {
2745 ; CHECK-LABEL: ICMP_LONG_I_slt:
2746 ; CHECK: # %bb.0: # %entry
2747 ; CHECK-NEXT: .cfi_def_cfa_offset 0
2748 ; CHECK-NEXT: subi16 sp, sp, 12
2749 ; CHECK-NEXT: .cfi_def_cfa_offset 12
2750 ; CHECK-NEXT: movi16 a2, 0
2751 ; CHECK-NEXT: cmplt16 a1, a2
2752 ; CHECK-NEXT: mvc32 a2
2753 ; CHECK-NEXT: st16.w a2, (sp, 4)
2754 ; CHECK-NEXT: cmpnei16 a1, 0
2755 ; CHECK-NEXT: mvc32 a1
2756 ; CHECK-NEXT: st16.w a1, (sp, 8)
2757 ; CHECK-NEXT: cmpnei16 a0, 0
2758 ; CHECK-NEXT: mvcv16 a1
2759 ; CHECK-NEXT: ld16.w a0, (sp, 4)
2760 ; CHECK-NEXT: btsti16 a0, 0
2761 ; CHECK-NEXT: mvc32 a0
2762 ; CHECK-NEXT: ld16.w a2, (sp, 8)
2763 ; CHECK-NEXT: btsti16 a2, 0
2764 ; CHECK-NEXT: movf32 a0, a1
2765 ; CHECK-NEXT: addi16 sp, sp, 12
2768 ; GENERIC-LABEL: ICMP_LONG_I_slt:
2769 ; GENERIC: # %bb.0: # %entry
2770 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2771 ; GENERIC-NEXT: subi16 sp, sp, 4
2772 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2773 ; GENERIC-NEXT: movi16 a2, 0
2774 ; GENERIC-NEXT: cmplt16 a1, a2
2775 ; GENERIC-NEXT: mvcv16 a2
2776 ; GENERIC-NEXT: cmpnei16 a0, 0
2777 ; GENERIC-NEXT: mvcv16 a0
2778 ; GENERIC-NEXT: cmpnei16 a1, 0
2779 ; GENERIC-NEXT: mvcv16 a1
2780 ; GENERIC-NEXT: btsti16 a1, 0
2781 ; GENERIC-NEXT: bt16 .LBB93_2
2782 ; GENERIC-NEXT: # %bb.1: # %entry
2783 ; GENERIC-NEXT: movi16 a0, 1
2784 ; GENERIC-NEXT: subu16 a0, a2
2785 ; GENERIC-NEXT: .LBB93_2: # %entry
2786 ; GENERIC-NEXT: addi16 sp, sp, 4
2787 ; GENERIC-NEXT: rts16
2789 %icmp = icmp slt i64 %x, 1
2793 define i1 @ICMP_SHORT_slt(i16 %x, i16 %y) {
2794 ; CHECK-LABEL: ICMP_SHORT_slt:
2795 ; CHECK: # %bb.0: # %entry
2796 ; CHECK-NEXT: sexth16 a0, a0
2797 ; CHECK-NEXT: sexth16 a1, a1
2798 ; CHECK-NEXT: cmplt16 a1, a0
2799 ; CHECK-NEXT: mvc32 a0
2802 ; GENERIC-LABEL: ICMP_SHORT_slt:
2803 ; GENERIC: # %bb.0: # %entry
2804 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2805 ; GENERIC-NEXT: subi16 sp, sp, 4
2806 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2807 ; GENERIC-NEXT: sexth16 a0, a0
2808 ; GENERIC-NEXT: sexth16 a1, a1
2809 ; GENERIC-NEXT: cmplt16 a1, a0
2810 ; GENERIC-NEXT: mvcv16 a1
2811 ; GENERIC-NEXT: movi16 a0, 1
2812 ; GENERIC-NEXT: subu16 a0, a1
2813 ; GENERIC-NEXT: addi16 sp, sp, 4
2814 ; GENERIC-NEXT: rts16
2816 %icmp = icmp slt i16 %y, %x
2820 define i1 @ICMP_SHORT_I_slt(i16 %x) {
2821 ; CHECK-LABEL: ICMP_SHORT_I_slt:
2822 ; CHECK: # %bb.0: # %entry
2823 ; CHECK-NEXT: sexth16 a0, a0
2824 ; CHECK-NEXT: cmplti16 a0, 1
2825 ; CHECK-NEXT: mvc32 a0
2828 ; GENERIC-LABEL: ICMP_SHORT_I_slt:
2829 ; GENERIC: # %bb.0: # %entry
2830 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2831 ; GENERIC-NEXT: subi16 sp, sp, 4
2832 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2833 ; GENERIC-NEXT: sexth16 a0, a0
2834 ; GENERIC-NEXT: cmplti16 a0, 1
2835 ; GENERIC-NEXT: mvcv16 a1
2836 ; GENERIC-NEXT: movi16 a0, 1
2837 ; GENERIC-NEXT: subu16 a0, a1
2838 ; GENERIC-NEXT: addi16 sp, sp, 4
2839 ; GENERIC-NEXT: rts16
2841 %icmp = icmp slt i16 %x, 1
2845 define i1 @ICMP_CHAR_slt(i8 %x, i8 %y) {
2846 ; CHECK-LABEL: ICMP_CHAR_slt:
2847 ; CHECK: # %bb.0: # %entry
2848 ; CHECK-NEXT: sextb16 a0, a0
2849 ; CHECK-NEXT: sextb16 a1, a1
2850 ; CHECK-NEXT: cmplt16 a1, a0
2851 ; CHECK-NEXT: mvc32 a0
2854 ; GENERIC-LABEL: ICMP_CHAR_slt:
2855 ; GENERIC: # %bb.0: # %entry
2856 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2857 ; GENERIC-NEXT: subi16 sp, sp, 4
2858 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2859 ; GENERIC-NEXT: sextb16 a0, a0
2860 ; GENERIC-NEXT: sextb16 a1, a1
2861 ; GENERIC-NEXT: cmplt16 a1, a0
2862 ; GENERIC-NEXT: mvcv16 a1
2863 ; GENERIC-NEXT: movi16 a0, 1
2864 ; GENERIC-NEXT: subu16 a0, a1
2865 ; GENERIC-NEXT: addi16 sp, sp, 4
2866 ; GENERIC-NEXT: rts16
2868 %icmp = icmp slt i8 %y, %x
2872 define i1 @ICMP_CHAR_I_slt(i8 %x) {
2873 ; CHECK-LABEL: ICMP_CHAR_I_slt:
2874 ; CHECK: # %bb.0: # %entry
2875 ; CHECK-NEXT: sextb16 a0, a0
2876 ; CHECK-NEXT: cmplti16 a0, 1
2877 ; CHECK-NEXT: mvc32 a0
2880 ; GENERIC-LABEL: ICMP_CHAR_I_slt:
2881 ; GENERIC: # %bb.0: # %entry
2882 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2883 ; GENERIC-NEXT: subi16 sp, sp, 4
2884 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2885 ; GENERIC-NEXT: sextb16 a0, a0
2886 ; GENERIC-NEXT: cmplti16 a0, 1
2887 ; GENERIC-NEXT: mvcv16 a1
2888 ; GENERIC-NEXT: movi16 a0, 1
2889 ; GENERIC-NEXT: subu16 a0, a1
2890 ; GENERIC-NEXT: addi16 sp, sp, 4
2891 ; GENERIC-NEXT: rts16
2893 %icmp = icmp slt i8 %x, 1
2897 define i1 @ICMP_BIT_slt(i1 %x, i1 %y) {
2898 ; CHECK-LABEL: ICMP_BIT_slt:
2899 ; CHECK: # %bb.0: # %entry
2900 ; CHECK-NEXT: xori32 a0, a0, 1
2901 ; CHECK-NEXT: and16 a0, a1
2904 ; GENERIC-LABEL: ICMP_BIT_slt:
2905 ; GENERIC: # %bb.0: # %entry
2906 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2907 ; GENERIC-NEXT: subi16 sp, sp, 4
2908 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2909 ; GENERIC-NEXT: movi16 a2, 1
2910 ; GENERIC-NEXT: xor16 a0, a2
2911 ; GENERIC-NEXT: and16 a0, a1
2912 ; GENERIC-NEXT: addi16 sp, sp, 4
2913 ; GENERIC-NEXT: rts16
2915 %icmp = icmp slt i1 %y, %x
2919 define i1 @ICMP_BIT_I_slt(i1 %x) {
2920 ; CHECK-LABEL: ICMP_BIT_I_slt:
2921 ; CHECK: # %bb.0: # %entry
2922 ; CHECK-NEXT: movi16 a0, 0
2925 ; GENERIC-LABEL: ICMP_BIT_I_slt:
2926 ; GENERIC: # %bb.0: # %entry
2927 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2928 ; GENERIC-NEXT: subi16 sp, sp, 4
2929 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2930 ; GENERIC-NEXT: movi16 a0, 0
2931 ; GENERIC-NEXT: addi16 sp, sp, 4
2932 ; GENERIC-NEXT: rts16
2934 %icmp = icmp slt i1 %x, 1
2940 define i1 @icmpRR_sle(i32 %x, i32 %y) {
2941 ; CHECK-LABEL: icmpRR_sle:
2942 ; CHECK: # %bb.0: # %entry
2943 ; CHECK-NEXT: cmplt16 a0, a1
2944 ; CHECK-NEXT: mvcv16 a0
2947 ; GENERIC-LABEL: icmpRR_sle:
2948 ; GENERIC: # %bb.0: # %entry
2949 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2950 ; GENERIC-NEXT: subi16 sp, sp, 4
2951 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2952 ; GENERIC-NEXT: cmplt16 a0, a1
2953 ; GENERIC-NEXT: mvcv16 a0
2954 ; GENERIC-NEXT: addi16 sp, sp, 4
2955 ; GENERIC-NEXT: rts16
2957 %icmp = icmp sle i32 %y, %x
2961 define i1 @icmpRI_sle(i32 %x) {
2962 ; CHECK-LABEL: icmpRI_sle:
2963 ; CHECK: # %bb.0: # %entry
2964 ; CHECK-NEXT: cmplti16 a0, 11
2965 ; CHECK-NEXT: mvc32 a0
2968 ; GENERIC-LABEL: icmpRI_sle:
2969 ; GENERIC: # %bb.0: # %entry
2970 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2971 ; GENERIC-NEXT: subi16 sp, sp, 4
2972 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2973 ; GENERIC-NEXT: cmplti16 a0, 11
2974 ; GENERIC-NEXT: mvcv16 a1
2975 ; GENERIC-NEXT: movi16 a0, 1
2976 ; GENERIC-NEXT: subu16 a0, a1
2977 ; GENERIC-NEXT: addi16 sp, sp, 4
2978 ; GENERIC-NEXT: rts16
2980 %icmp = icmp sle i32 %x, 10
2984 define i1 @icmpRI_X_sle(i32 %x) {
2985 ; CHECK-LABEL: icmpRI_X_sle:
2986 ; CHECK: # %bb.0: # %entry
2987 ; CHECK-NEXT: movih32 a1, 62
2988 ; CHECK-NEXT: ori32 a1, a1, 33769
2989 ; CHECK-NEXT: cmplt16 a0, a1
2990 ; CHECK-NEXT: mvc32 a0
2993 ; GENERIC-LABEL: icmpRI_X_sle:
2994 ; GENERIC: # %bb.0: # %entry
2995 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
2996 ; GENERIC-NEXT: subi16 sp, sp, 4
2997 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
2998 ; GENERIC-NEXT: movi16 a1, 0
2999 ; GENERIC-NEXT: lsli16 a1, a1, 24
3000 ; GENERIC-NEXT: movi16 a2, 62
3001 ; GENERIC-NEXT: lsli16 a2, a2, 16
3002 ; GENERIC-NEXT: or16 a2, a1
3003 ; GENERIC-NEXT: movi16 a1, 131
3004 ; GENERIC-NEXT: lsli16 a1, a1, 8
3005 ; GENERIC-NEXT: or16 a1, a2
3006 ; GENERIC-NEXT: movi16 a2, 233
3007 ; GENERIC-NEXT: or16 a2, a1
3008 ; GENERIC-NEXT: cmplt16 a0, a2
3009 ; GENERIC-NEXT: mvcv16 a1
3010 ; GENERIC-NEXT: movi16 a0, 1
3011 ; GENERIC-NEXT: subu16 a0, a1
3012 ; GENERIC-NEXT: addi16 sp, sp, 4
3013 ; GENERIC-NEXT: rts16
3015 %icmp = icmp sle i32 %x, 4097000
3019 define i1 @ICMP_LONG_sle(i64 %x, i64 %y) {
3020 ; CHECK-LABEL: ICMP_LONG_sle:
3021 ; CHECK: # %bb.0: # %entry
3022 ; CHECK-NEXT: .cfi_def_cfa_offset 0
3023 ; CHECK-NEXT: subi16 sp, sp, 12
3024 ; CHECK-NEXT: .cfi_def_cfa_offset 12
3025 ; CHECK-NEXT: cmphs16 a0, a2
3026 ; CHECK-NEXT: mvc32 a0
3027 ; CHECK-NEXT: st16.w a0, (sp, 4)
3028 ; CHECK-NEXT: cmpne16 a3, a1
3029 ; CHECK-NEXT: mvc32 a0
3030 ; CHECK-NEXT: st16.w a0, (sp, 8)
3031 ; CHECK-NEXT: cmplt16 a1, a3
3032 ; CHECK-NEXT: mvcv16 a0
3033 ; CHECK-NEXT: ld16.w a1, (sp, 4)
3034 ; CHECK-NEXT: btsti16 a1, 0
3035 ; CHECK-NEXT: mvc32 a1
3036 ; CHECK-NEXT: ld16.w a2, (sp, 8)
3037 ; CHECK-NEXT: btsti16 a2, 0
3038 ; CHECK-NEXT: movf32 a0, a1
3039 ; CHECK-NEXT: addi16 sp, sp, 12
3042 ; GENERIC-LABEL: ICMP_LONG_sle:
3043 ; GENERIC: # %bb.0: # %entry
3044 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
3045 ; GENERIC-NEXT: subi16 sp, sp, 4
3046 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
3047 ; GENERIC-NEXT: cmphs16 a0, a2
3048 ; GENERIC-NEXT: mvcv16 a2
3049 ; GENERIC-NEXT: cmplt16 a1, a3
3050 ; GENERIC-NEXT: mvcv16 a0
3051 ; GENERIC-NEXT: cmpne16 a3, a1
3052 ; GENERIC-NEXT: mvcv16 a1
3053 ; GENERIC-NEXT: btsti16 a1, 0
3054 ; GENERIC-NEXT: bf16 .LBB103_2
3055 ; GENERIC-NEXT: # %bb.1:
3056 ; GENERIC-NEXT: movi16 a0, 1
3057 ; GENERIC-NEXT: subu16 a0, a2
3058 ; GENERIC-NEXT: .LBB103_2: # %entry
3059 ; GENERIC-NEXT: addi16 sp, sp, 4
3060 ; GENERIC-NEXT: rts16
3062 %icmp = icmp sle i64 %y, %x
3066 define i1 @ICMP_LONG_I_sle(i64 %x) {
3067 ; CHECK-LABEL: ICMP_LONG_I_sle:
3068 ; CHECK: # %bb.0: # %entry
3069 ; CHECK-NEXT: .cfi_def_cfa_offset 0
3070 ; CHECK-NEXT: subi16 sp, sp, 12
3071 ; CHECK-NEXT: .cfi_def_cfa_offset 12
3072 ; CHECK-NEXT: movi16 a2, 0
3073 ; CHECK-NEXT: cmplt16 a1, a2
3074 ; CHECK-NEXT: mvc32 a2
3075 ; CHECK-NEXT: st16.w a2, (sp, 4)
3076 ; CHECK-NEXT: cmpnei16 a1, 0
3077 ; CHECK-NEXT: mvc32 a1
3078 ; CHECK-NEXT: st16.w a1, (sp, 8)
3079 ; CHECK-NEXT: cmphsi16 a0, 2
3080 ; CHECK-NEXT: mvcv16 a1
3081 ; CHECK-NEXT: ld16.w a0, (sp, 4)
3082 ; CHECK-NEXT: btsti16 a0, 0
3083 ; CHECK-NEXT: mvc32 a0
3084 ; CHECK-NEXT: ld16.w a2, (sp, 8)
3085 ; CHECK-NEXT: btsti16 a2, 0
3086 ; CHECK-NEXT: movf32 a0, a1
3087 ; CHECK-NEXT: addi16 sp, sp, 12
3090 ; GENERIC-LABEL: ICMP_LONG_I_sle:
3091 ; GENERIC: # %bb.0: # %entry
3092 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
3093 ; GENERIC-NEXT: subi16 sp, sp, 4
3094 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
3095 ; GENERIC-NEXT: movi16 a2, 0
3096 ; GENERIC-NEXT: cmplt16 a1, a2
3097 ; GENERIC-NEXT: mvcv16 a2
3098 ; GENERIC-NEXT: cmphsi16 a0, 2
3099 ; GENERIC-NEXT: mvcv16 a0
3100 ; GENERIC-NEXT: cmpnei16 a1, 0
3101 ; GENERIC-NEXT: mvcv16 a1
3102 ; GENERIC-NEXT: btsti16 a1, 0
3103 ; GENERIC-NEXT: bt16 .LBB104_2
3104 ; GENERIC-NEXT: # %bb.1: # %entry
3105 ; GENERIC-NEXT: movi16 a0, 1
3106 ; GENERIC-NEXT: subu16 a0, a2
3107 ; GENERIC-NEXT: .LBB104_2: # %entry
3108 ; GENERIC-NEXT: addi16 sp, sp, 4
3109 ; GENERIC-NEXT: rts16
3111 %icmp = icmp sle i64 %x, 1
3115 define i1 @ICMP_SHORT_sle(i16 %x, i16 %y) {
3116 ; CHECK-LABEL: ICMP_SHORT_sle:
3117 ; CHECK: # %bb.0: # %entry
3118 ; CHECK-NEXT: sexth16 a1, a1
3119 ; CHECK-NEXT: sexth16 a0, a0
3120 ; CHECK-NEXT: cmplt16 a0, a1
3121 ; CHECK-NEXT: mvcv16 a0
3124 ; GENERIC-LABEL: ICMP_SHORT_sle:
3125 ; GENERIC: # %bb.0: # %entry
3126 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
3127 ; GENERIC-NEXT: subi16 sp, sp, 4
3128 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
3129 ; GENERIC-NEXT: sexth16 a1, a1
3130 ; GENERIC-NEXT: sexth16 a0, a0
3131 ; GENERIC-NEXT: cmplt16 a0, a1
3132 ; GENERIC-NEXT: mvcv16 a0
3133 ; GENERIC-NEXT: addi16 sp, sp, 4
3134 ; GENERIC-NEXT: rts16
3136 %icmp = icmp sle i16 %y, %x
3140 define i1 @ICMP_SHORT_I_sle(i16 %x) {
3141 ; CHECK-LABEL: ICMP_SHORT_I_sle:
3142 ; CHECK: # %bb.0: # %entry
3143 ; CHECK-NEXT: sexth16 a0, a0
3144 ; CHECK-NEXT: cmplti16 a0, 2
3145 ; CHECK-NEXT: mvc32 a0
3148 ; GENERIC-LABEL: ICMP_SHORT_I_sle:
3149 ; GENERIC: # %bb.0: # %entry
3150 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
3151 ; GENERIC-NEXT: subi16 sp, sp, 4
3152 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
3153 ; GENERIC-NEXT: sexth16 a0, a0
3154 ; GENERIC-NEXT: cmplti16 a0, 2
3155 ; GENERIC-NEXT: mvcv16 a1
3156 ; GENERIC-NEXT: movi16 a0, 1
3157 ; GENERIC-NEXT: subu16 a0, a1
3158 ; GENERIC-NEXT: addi16 sp, sp, 4
3159 ; GENERIC-NEXT: rts16
3161 %icmp = icmp sle i16 %x, 1
3165 define i1 @ICMP_CHAR_sle(i8 %x, i8 %y) {
3166 ; CHECK-LABEL: ICMP_CHAR_sle:
3167 ; CHECK: # %bb.0: # %entry
3168 ; CHECK-NEXT: sextb16 a1, a1
3169 ; CHECK-NEXT: sextb16 a0, a0
3170 ; CHECK-NEXT: cmplt16 a0, a1
3171 ; CHECK-NEXT: mvcv16 a0
3174 ; GENERIC-LABEL: ICMP_CHAR_sle:
3175 ; GENERIC: # %bb.0: # %entry
3176 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
3177 ; GENERIC-NEXT: subi16 sp, sp, 4
3178 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
3179 ; GENERIC-NEXT: sextb16 a1, a1
3180 ; GENERIC-NEXT: sextb16 a0, a0
3181 ; GENERIC-NEXT: cmplt16 a0, a1
3182 ; GENERIC-NEXT: mvcv16 a0
3183 ; GENERIC-NEXT: addi16 sp, sp, 4
3184 ; GENERIC-NEXT: rts16
3186 %icmp = icmp sle i8 %y, %x
3190 define i1 @ICMP_CHAR_I_sle(i8 %x) {
3191 ; CHECK-LABEL: ICMP_CHAR_I_sle:
3192 ; CHECK: # %bb.0: # %entry
3193 ; CHECK-NEXT: sextb16 a0, a0
3194 ; CHECK-NEXT: cmplti16 a0, 2
3195 ; CHECK-NEXT: mvc32 a0
3198 ; GENERIC-LABEL: ICMP_CHAR_I_sle:
3199 ; GENERIC: # %bb.0: # %entry
3200 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
3201 ; GENERIC-NEXT: subi16 sp, sp, 4
3202 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
3203 ; GENERIC-NEXT: sextb16 a0, a0
3204 ; GENERIC-NEXT: cmplti16 a0, 2
3205 ; GENERIC-NEXT: mvcv16 a1
3206 ; GENERIC-NEXT: movi16 a0, 1
3207 ; GENERIC-NEXT: subu16 a0, a1
3208 ; GENERIC-NEXT: addi16 sp, sp, 4
3209 ; GENERIC-NEXT: rts16
3211 %icmp = icmp sle i8 %x, 1
3215 define i1 @ICMP_BIT_sle(i1 %x, i1 %y) {
3216 ; CHECK-LABEL: ICMP_BIT_sle:
3217 ; CHECK: # %bb.0: # %entry
3218 ; CHECK-NEXT: xori32 a0, a0, 1
3219 ; CHECK-NEXT: or16 a0, a1
3222 ; GENERIC-LABEL: ICMP_BIT_sle:
3223 ; GENERIC: # %bb.0: # %entry
3224 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
3225 ; GENERIC-NEXT: subi16 sp, sp, 4
3226 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
3227 ; GENERIC-NEXT: movi16 a2, 1
3228 ; GENERIC-NEXT: xor16 a0, a2
3229 ; GENERIC-NEXT: or16 a0, a1
3230 ; GENERIC-NEXT: addi16 sp, sp, 4
3231 ; GENERIC-NEXT: rts16
3233 %icmp = icmp sle i1 %y, %x
3237 define i1 @ICMP_BIT_I_sle(i1 %x) {
3238 ; CHECK-LABEL: ICMP_BIT_I_sle:
3239 ; CHECK: # %bb.0: # %entry
3242 ; GENERIC-LABEL: ICMP_BIT_I_sle:
3243 ; GENERIC: # %bb.0: # %entry
3244 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
3245 ; GENERIC-NEXT: subi16 sp, sp, 4
3246 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
3247 ; GENERIC-NEXT: addi16 sp, sp, 4
3248 ; GENERIC-NEXT: rts16
3250 %icmp = icmp sle i1 %x, 1