1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
3 ; RUN: -ppc-asm-full-reg-names -mcpu=pwr10 < %s | FileCheck %s \
4 ; RUN: --check-prefixes=CHECK,CHECK-LE
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
6 ; RUN: -ppc-asm-full-reg-names -mcpu=pwr10 < %s | FileCheck %s \
7 ; RUN: --check-prefixes=CHECK,CHECK-BE
9 ; This file does not contain many test cases involving comparisons and logical
10 ; comparisons (cmplwi, cmpldi). This is because alternative code is generated
11 ; when there is a compare (logical or not), followed by a sign or zero extend.
12 ; This codegen will be re-evaluated at a later time on whether or not it should
15 @globalVal = common dso_local local_unnamed_addr global i8 0, align 1
16 @globalVal2 = common dso_local local_unnamed_addr global i32 0, align 4
17 @globalVal3 = common dso_local local_unnamed_addr global i64 0, align 8
18 @globalVal4 = common dso_local local_unnamed_addr global i16 0, align 2
20 define dso_local signext i32 @setnbc1(i8 %a) {
21 ; CHECK-LABEL: setnbc1:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: extsb r3, r3
24 ; CHECK-NEXT: cmpwi r3, 1
25 ; CHECK-NEXT: setnbc r3, lt
28 %cmp = icmp slt i8 %a, 1
29 %conv = sext i1 %cmp to i32
33 define dso_local signext i32 @setnbc2(i32 %a) {
34 ; CHECK-LABEL: setnbc2:
35 ; CHECK: # %bb.0: # %entry
36 ; CHECK-NEXT: cmpwi r3, 1
37 ; CHECK-NEXT: setnbc r3, lt
40 %cmp = icmp slt i32 %a, 1
41 %conv = sext i1 %cmp to i32
45 define dso_local signext i32 @setnbc3(i64 %a) {
46 ; CHECK-LABEL: setnbc3:
47 ; CHECK: # %bb.0: # %entry
48 ; CHECK-NEXT: cmpdi r3, 1
49 ; CHECK-NEXT: setnbc r3, lt
52 %cmp = icmp slt i64 %a, 1
53 %conv = sext i1 %cmp to i32
57 define dso_local signext i32 @setnbc4(i16 %a) {
58 ; CHECK-LABEL: setnbc4:
59 ; CHECK: # %bb.0: # %entry
60 ; CHECK-NEXT: extsh r3, r3
61 ; CHECK-NEXT: cmpwi r3, 1
62 ; CHECK-NEXT: setnbc r3, lt
65 %cmp = icmp slt i16 %a, 1
66 %conv = sext i1 %cmp to i32
70 define signext i64 @setnbc5(i8 %a) {
71 ; CHECK-LABEL: setnbc5:
72 ; CHECK: # %bb.0: # %entry
73 ; CHECK-NEXT: extsb r3, r3
74 ; CHECK-NEXT: cmpwi r3, 1
75 ; CHECK-NEXT: setnbc r3, lt
78 %cmp = icmp slt i8 %a, 1
79 %conv = sext i1 %cmp to i64
83 define signext i64 @setnbc6(i32 %a) {
84 ; CHECK-LABEL: setnbc6:
85 ; CHECK: # %bb.0: # %entry
86 ; CHECK-NEXT: cmpwi r3, 1
87 ; CHECK-NEXT: setnbc r3, lt
90 %cmp = icmp slt i32 %a, 1
91 %conv = sext i1 %cmp to i64
95 define signext i64 @setnbc7(i64 %a) {
96 ; CHECK-LABEL: setnbc7:
97 ; CHECK: # %bb.0: # %entry
98 ; CHECK-NEXT: cmpdi r3, 1
99 ; CHECK-NEXT: setnbc r3, lt
102 %cmp = icmp slt i64 %a, 1
103 %conv = sext i1 %cmp to i64
107 define signext i64 @setnbc8(i16 %a) {
108 ; CHECK-LABEL: setnbc8:
109 ; CHECK: # %bb.0: # %entry
110 ; CHECK-NEXT: extsh r3, r3
111 ; CHECK-NEXT: cmpwi r3, 1
112 ; CHECK-NEXT: setnbc r3, lt
115 %cmp = icmp slt i16 %a, 1
116 %conv = sext i1 %cmp to i64
120 define dso_local void @setnbc9(i8 %a) {
121 ; CHECK-LE-LABEL: setnbc9:
122 ; CHECK-LE: # %bb.0: # %entry
123 ; CHECK-LE-NEXT: extsb r3, r3
124 ; CHECK-LE-NEXT: cmpwi r3, 1
125 ; CHECK-LE-NEXT: setnbc r3, lt
126 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
129 ; CHECK-BE-LABEL: setnbc9:
130 ; CHECK-BE: # %bb.0: # %entry
131 ; CHECK-BE-NEXT: extsb r3, r3
132 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
133 ; CHECK-BE-NEXT: cmpwi r3, 1
134 ; CHECK-BE-NEXT: setnbc r3, lt
135 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
138 %cmp = icmp slt i8 %a, 1
139 %conv1 = sext i1 %cmp to i8
140 store i8 %conv1, ptr @globalVal, align 1
144 define dso_local void @setnbc10(i32 %a) {
145 ; CHECK-LE-LABEL: setnbc10:
146 ; CHECK-LE: # %bb.0: # %entry
147 ; CHECK-LE-NEXT: cmpwi r3, 1
148 ; CHECK-LE-NEXT: setnbc r3, lt
149 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
152 ; CHECK-BE-LABEL: setnbc10:
153 ; CHECK-BE: # %bb.0: # %entry
154 ; CHECK-BE-NEXT: cmpwi r3, 1
155 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
156 ; CHECK-BE-NEXT: setnbc r3, lt
157 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
160 %cmp = icmp slt i32 %a, 1
161 %conv1 = sext i1 %cmp to i32
162 store i32 %conv1, ptr @globalVal2, align 4
166 define dso_local void @setnbc11(i64 %a) {
167 ; CHECK-LE-LABEL: setnbc11:
168 ; CHECK-LE: # %bb.0: # %entry
169 ; CHECK-LE-NEXT: cmpdi r3, 1
170 ; CHECK-LE-NEXT: setnbc r3, lt
171 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
174 ; CHECK-BE-LABEL: setnbc11:
175 ; CHECK-BE: # %bb.0: # %entry
176 ; CHECK-BE-NEXT: cmpdi r3, 1
177 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
178 ; CHECK-BE-NEXT: setnbc r3, lt
179 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
182 %cmp = icmp slt i64 %a, 1
183 %conv1 = sext i1 %cmp to i64
184 store i64 %conv1, ptr @globalVal3, align 8
188 define dso_local void @setnbc12(i16 %a) {
189 ; CHECK-LE-LABEL: setnbc12:
190 ; CHECK-LE: # %bb.0: # %entry
191 ; CHECK-LE-NEXT: extsh r3, r3
192 ; CHECK-LE-NEXT: cmpwi r3, 1
193 ; CHECK-LE-NEXT: setnbc r3, lt
194 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
197 ; CHECK-BE-LABEL: setnbc12:
198 ; CHECK-BE: # %bb.0: # %entry
199 ; CHECK-BE-NEXT: extsh r3, r3
200 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
201 ; CHECK-BE-NEXT: cmpwi r3, 1
202 ; CHECK-BE-NEXT: setnbc r3, lt
203 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
206 %cmp = icmp slt i16 %a, 1
207 %conv1 = sext i1 %cmp to i16
208 store i16 %conv1, ptr @globalVal4, align 2
212 define dso_local signext i32 @setnbc13(i8 %a) {
213 ; CHECK-LABEL: setnbc13:
214 ; CHECK: # %bb.0: # %entry
215 ; CHECK-NEXT: extsb r3, r3
216 ; CHECK-NEXT: cmpwi r3, 1
217 ; CHECK-NEXT: setnbc r3, gt
220 %cmp = icmp sgt i8 %a, 1
221 %conv = sext i1 %cmp to i32
225 define dso_local signext i32 @setnbc14(i32 %a) {
226 ; CHECK-LABEL: setnbc14:
227 ; CHECK: # %bb.0: # %entry
228 ; CHECK-NEXT: cmpwi r3, 1
229 ; CHECK-NEXT: setnbc r3, gt
232 %cmp = icmp sgt i32 %a, 1
233 %conv = sext i1 %cmp to i32
237 define dso_local signext i32 @setnbc15(i64 %a) {
238 ; CHECK-LABEL: setnbc15:
239 ; CHECK: # %bb.0: # %entry
240 ; CHECK-NEXT: cmpdi r3, 1
241 ; CHECK-NEXT: setnbc r3, gt
244 %cmp = icmp sgt i64 %a, 1
245 %conv = sext i1 %cmp to i32
249 define dso_local signext i32 @setnbc16(i16 %a) {
250 ; CHECK-LABEL: setnbc16:
251 ; CHECK: # %bb.0: # %entry
252 ; CHECK-NEXT: extsh r3, r3
253 ; CHECK-NEXT: cmpwi r3, 1
254 ; CHECK-NEXT: setnbc r3, gt
257 %cmp = icmp sgt i16 %a, 1
258 %conv = sext i1 %cmp to i32
262 define signext i64 @setnbc17(i8 %a) {
263 ; CHECK-LABEL: setnbc17:
264 ; CHECK: # %bb.0: # %entry
265 ; CHECK-NEXT: extsb r3, r3
266 ; CHECK-NEXT: cmpwi r3, 1
267 ; CHECK-NEXT: setnbc r3, gt
270 %cmp = icmp sgt i8 %a, 1
271 %conv = sext i1 %cmp to i64
275 define signext i64 @setnbc18(i32 %a) {
276 ; CHECK-LABEL: setnbc18:
277 ; CHECK: # %bb.0: # %entry
278 ; CHECK-NEXT: cmpwi r3, 1
279 ; CHECK-NEXT: setnbc r3, gt
282 %cmp = icmp sgt i32 %a, 1
283 %conv = sext i1 %cmp to i64
287 define signext i64 @setnbc19(i64 %a) {
288 ; CHECK-LABEL: setnbc19:
289 ; CHECK: # %bb.0: # %entry
290 ; CHECK-NEXT: cmpdi r3, 1
291 ; CHECK-NEXT: setnbc r3, gt
294 %cmp = icmp sgt i64 %a, 1
295 %conv = sext i1 %cmp to i64
299 define signext i64 @setnbc20(i16 %a) {
300 ; CHECK-LABEL: setnbc20:
301 ; CHECK: # %bb.0: # %entry
302 ; CHECK-NEXT: extsh r3, r3
303 ; CHECK-NEXT: cmpwi r3, 1
304 ; CHECK-NEXT: setnbc r3, gt
307 %cmp = icmp sgt i16 %a, 1
308 %conv = sext i1 %cmp to i64
312 define dso_local void @setnbc21(i8 %a) {
313 ; CHECK-LE-LABEL: setnbc21:
314 ; CHECK-LE: # %bb.0: # %entry
315 ; CHECK-LE-NEXT: extsb r3, r3
316 ; CHECK-LE-NEXT: cmpwi r3, 1
317 ; CHECK-LE-NEXT: setnbc r3, gt
318 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
321 ; CHECK-BE-LABEL: setnbc21:
322 ; CHECK-BE: # %bb.0: # %entry
323 ; CHECK-BE-NEXT: extsb r3, r3
324 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
325 ; CHECK-BE-NEXT: cmpwi r3, 1
326 ; CHECK-BE-NEXT: setnbc r3, gt
327 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
330 %cmp = icmp sgt i8 %a, 1
331 %conv1 = sext i1 %cmp to i8
332 store i8 %conv1, ptr @globalVal, align 1
336 define dso_local void @setnbc22(i32 %a) {
337 ; CHECK-LE-LABEL: setnbc22:
338 ; CHECK-LE: # %bb.0: # %entry
339 ; CHECK-LE-NEXT: cmpwi r3, 1
340 ; CHECK-LE-NEXT: setnbc r3, gt
341 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
344 ; CHECK-BE-LABEL: setnbc22:
345 ; CHECK-BE: # %bb.0: # %entry
346 ; CHECK-BE-NEXT: cmpwi r3, 1
347 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
348 ; CHECK-BE-NEXT: setnbc r3, gt
349 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
352 %cmp = icmp sgt i32 %a, 1
353 %conv1 = sext i1 %cmp to i32
354 store i32 %conv1, ptr @globalVal2, align 4
358 define dso_local void @setnbc23(i64 %a) {
359 ; CHECK-LE-LABEL: setnbc23:
360 ; CHECK-LE: # %bb.0: # %entry
361 ; CHECK-LE-NEXT: cmpdi r3, 1
362 ; CHECK-LE-NEXT: setnbc r3, gt
363 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
366 ; CHECK-BE-LABEL: setnbc23:
367 ; CHECK-BE: # %bb.0: # %entry
368 ; CHECK-BE-NEXT: cmpdi r3, 1
369 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
370 ; CHECK-BE-NEXT: setnbc r3, gt
371 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
374 %cmp = icmp sgt i64 %a, 1
375 %conv1 = sext i1 %cmp to i64
376 store i64 %conv1, ptr @globalVal3, align 8
380 define dso_local void @setnbc24(i16 %a) {
381 ; CHECK-LE-LABEL: setnbc24:
382 ; CHECK-LE: # %bb.0: # %entry
383 ; CHECK-LE-NEXT: extsh r3, r3
384 ; CHECK-LE-NEXT: cmpwi r3, 1
385 ; CHECK-LE-NEXT: setnbc r3, gt
386 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
389 ; CHECK-BE-LABEL: setnbc24:
390 ; CHECK-BE: # %bb.0: # %entry
391 ; CHECK-BE-NEXT: extsh r3, r3
392 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
393 ; CHECK-BE-NEXT: cmpwi r3, 1
394 ; CHECK-BE-NEXT: setnbc r3, gt
395 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
398 %cmp = icmp sgt i16 %a, 1
399 %conv1 = sext i1 %cmp to i16
400 store i16 %conv1, ptr @globalVal4, align 2
404 define dso_local signext i32 @setnbc25(i8 %a) {
405 ; CHECK-LABEL: setnbc25:
406 ; CHECK: # %bb.0: # %entry
407 ; CHECK-NEXT: clrlwi r3, r3, 24
408 ; CHECK-NEXT: cmpwi r3, 1
409 ; CHECK-NEXT: setnbc r3, eq
412 %cmp = icmp eq i8 %a, 1
413 %conv = sext i1 %cmp to i32
417 define dso_local signext i32 @setnbc26(i32 %a) {
418 ; CHECK-LABEL: setnbc26:
419 ; CHECK: # %bb.0: # %entry
420 ; CHECK-NEXT: cmpwi r3, 1
421 ; CHECK-NEXT: setnbc r3, eq
424 %cmp = icmp eq i32 %a, 1
425 %conv = sext i1 %cmp to i32
429 define dso_local signext i32 @setnbc27(i64 %a) {
430 ; CHECK-LABEL: setnbc27:
431 ; CHECK: # %bb.0: # %entry
432 ; CHECK-NEXT: cmpdi r3, 1
433 ; CHECK-NEXT: setnbc r3, eq
436 %cmp = icmp eq i64 %a, 1
437 %conv = sext i1 %cmp to i32
441 define dso_local signext i32 @setnbc28(i16 %a) {
442 ; CHECK-LABEL: setnbc28:
443 ; CHECK: # %bb.0: # %entry
444 ; CHECK-NEXT: clrlwi r3, r3, 16
445 ; CHECK-NEXT: cmpwi r3, 1
446 ; CHECK-NEXT: setnbc r3, eq
449 %cmp = icmp eq i16 %a, 1
450 %conv = sext i1 %cmp to i32
454 define signext i64 @setnbc29(i8 %a) {
455 ; CHECK-LABEL: setnbc29:
456 ; CHECK: # %bb.0: # %entry
457 ; CHECK-NEXT: clrlwi r3, r3, 24
458 ; CHECK-NEXT: cmpwi r3, 1
459 ; CHECK-NEXT: setnbc r3, eq
462 %cmp = icmp eq i8 %a, 1
463 %conv = sext i1 %cmp to i64
467 define signext i64 @setnbc30(i32 %a) {
468 ; CHECK-LABEL: setnbc30:
469 ; CHECK: # %bb.0: # %entry
470 ; CHECK-NEXT: cmpwi r3, 1
471 ; CHECK-NEXT: setnbc r3, eq
474 %cmp = icmp eq i32 %a, 1
475 %conv = sext i1 %cmp to i64
479 define signext i64 @setnbc31(i64 %a) {
480 ; CHECK-LABEL: setnbc31:
481 ; CHECK: # %bb.0: # %entry
482 ; CHECK-NEXT: cmpdi r3, 1
483 ; CHECK-NEXT: setnbc r3, eq
486 %cmp = icmp eq i64 %a, 1
487 %conv = sext i1 %cmp to i64
491 define signext i64 @setnbc32(i16 %a) {
492 ; CHECK-LABEL: setnbc32:
493 ; CHECK: # %bb.0: # %entry
494 ; CHECK-NEXT: clrlwi r3, r3, 16
495 ; CHECK-NEXT: cmpwi r3, 1
496 ; CHECK-NEXT: setnbc r3, eq
499 %cmp = icmp eq i16 %a, 1
500 %conv = sext i1 %cmp to i64
504 define dso_local void @setnbc33(i8 %a) {
505 ; CHECK-LE-LABEL: setnbc33:
506 ; CHECK-LE: # %bb.0: # %entry
507 ; CHECK-LE-NEXT: clrlwi r3, r3, 24
508 ; CHECK-LE-NEXT: cmpwi r3, 1
509 ; CHECK-LE-NEXT: setnbc r3, eq
510 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
513 ; CHECK-BE-LABEL: setnbc33:
514 ; CHECK-BE: # %bb.0: # %entry
515 ; CHECK-BE-NEXT: clrlwi r3, r3, 24
516 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
517 ; CHECK-BE-NEXT: cmpwi r3, 1
518 ; CHECK-BE-NEXT: setnbc r3, eq
519 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
522 %cmp = icmp eq i8 %a, 1
523 %conv1 = sext i1 %cmp to i8
524 store i8 %conv1, ptr @globalVal, align 1
528 define dso_local void @setnbc34(i32 %a) {
529 ; CHECK-LE-LABEL: setnbc34:
530 ; CHECK-LE: # %bb.0: # %entry
531 ; CHECK-LE-NEXT: cmpwi r3, 1
532 ; CHECK-LE-NEXT: setnbc r3, eq
533 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
536 ; CHECK-BE-LABEL: setnbc34:
537 ; CHECK-BE: # %bb.0: # %entry
538 ; CHECK-BE-NEXT: cmpwi r3, 1
539 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
540 ; CHECK-BE-NEXT: setnbc r3, eq
541 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
544 %cmp = icmp eq i32 %a, 1
545 %conv1 = sext i1 %cmp to i32
546 store i32 %conv1, ptr @globalVal2, align 4
550 define dso_local void @setnbc35(i64 %a) {
551 ; CHECK-LE-LABEL: setnbc35:
552 ; CHECK-LE: # %bb.0: # %entry
553 ; CHECK-LE-NEXT: cmpdi r3, 1
554 ; CHECK-LE-NEXT: setnbc r3, eq
555 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
558 ; CHECK-BE-LABEL: setnbc35:
559 ; CHECK-BE: # %bb.0: # %entry
560 ; CHECK-BE-NEXT: cmpdi r3, 1
561 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
562 ; CHECK-BE-NEXT: setnbc r3, eq
563 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
566 %cmp = icmp eq i64 %a, 1
567 %conv1 = sext i1 %cmp to i64
568 store i64 %conv1, ptr @globalVal3, align 8
572 define dso_local void @setnbc36(i16 %a) {
573 ; CHECK-LE-LABEL: setnbc36:
574 ; CHECK-LE: # %bb.0: # %entry
575 ; CHECK-LE-NEXT: clrlwi r3, r3, 16
576 ; CHECK-LE-NEXT: cmpwi r3, 1
577 ; CHECK-LE-NEXT: setnbc r3, eq
578 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
581 ; CHECK-BE-LABEL: setnbc36:
582 ; CHECK-BE: # %bb.0: # %entry
583 ; CHECK-BE-NEXT: clrlwi r3, r3, 16
584 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
585 ; CHECK-BE-NEXT: cmpwi r3, 1
586 ; CHECK-BE-NEXT: setnbc r3, eq
587 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
590 %cmp = icmp eq i16 %a, 1
591 %conv1 = sext i1 %cmp to i16
592 store i16 %conv1, ptr @globalVal4, align 2
596 define dso_local signext i32 @setnbc37(i64 %a) {
597 ; CHECK-LABEL: setnbc37:
598 ; CHECK: # %bb.0: # %entry
599 ; CHECK-NEXT: cmpldi r3, 1
600 ; CHECK-NEXT: setnbc r3, gt
603 %cmp = icmp ugt i64 %a, 1
604 %conv = sext i1 %cmp to i32
608 define signext i64 @setnbc38(i64 %a) {
609 ; CHECK-LABEL: setnbc38:
610 ; CHECK: # %bb.0: # %entry
611 ; CHECK-NEXT: cmpldi r3, 1
612 ; CHECK-NEXT: setnbc r3, gt
615 %cmp = icmp ugt i64 %a, 1
616 %conv = sext i1 %cmp to i64
620 define dso_local void @setnbc39(i64 %a) {
621 ; CHECK-LE-LABEL: setnbc39:
622 ; CHECK-LE: # %bb.0: # %entry
623 ; CHECK-LE-NEXT: cmpldi r3, 1
624 ; CHECK-LE-NEXT: setnbc r3, gt
625 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
628 ; CHECK-BE-LABEL: setnbc39:
629 ; CHECK-BE: # %bb.0: # %entry
630 ; CHECK-BE-NEXT: cmpldi r3, 1
631 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
632 ; CHECK-BE-NEXT: setnbc r3, gt
633 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
636 %cmp = icmp ugt i64 %a, 1
637 %conv1 = sext i1 %cmp to i64
638 store i64 %conv1, ptr @globalVal3, align 8
642 define dso_local signext i32 @setnbc40(i8 %a) {
643 ; CHECK-LABEL: setnbc40:
644 ; CHECK: # %bb.0: # %entry
645 ; CHECK-NEXT: extsb. r3, r3
646 ; CHECK-NEXT: setnbc r3, lt
649 %cmp = icmp slt i8 %a, 0
650 %conv = sext i1 %cmp to i32
654 define dso_local signext i32 @setnbc41(i32 %a) {
655 ; CHECK-LABEL: setnbc41:
656 ; CHECK: # %bb.0: # %entry
657 ; CHECK-NEXT: cmpwi r3, 0
658 ; CHECK-NEXT: setnbc r3, lt
661 %cmp = icmp slt i32 %a, 0
662 %conv = sext i1 %cmp to i32
666 define dso_local signext i32 @setnbc42(i16 %a) {
667 ; CHECK-LABEL: setnbc42:
668 ; CHECK: # %bb.0: # %entry
669 ; CHECK-NEXT: extsh. r3, r3
670 ; CHECK-NEXT: setnbc r3, lt
673 %cmp = icmp slt i16 %a, 0
674 %conv = sext i1 %cmp to i32
678 define signext i64 @setnbc43(i8 %a) {
679 ; CHECK-LABEL: setnbc43:
680 ; CHECK: # %bb.0: # %entry
681 ; CHECK-NEXT: extsb. r3, r3
682 ; CHECK-NEXT: setnbc r3, lt
685 %cmp = icmp slt i8 %a, 0
686 %conv = sext i1 %cmp to i64
690 define signext i64 @setnbc44(i32 %a) {
691 ; CHECK-LABEL: setnbc44:
692 ; CHECK: # %bb.0: # %entry
693 ; CHECK-NEXT: cmpwi r3, 0
694 ; CHECK-NEXT: setnbc r3, lt
697 %cmp = icmp slt i32 %a, 0
698 %conv = sext i1 %cmp to i64
702 define signext i64 @setnbc45(i16 %a) {
703 ; CHECK-LABEL: setnbc45:
704 ; CHECK: # %bb.0: # %entry
705 ; CHECK-NEXT: extsh. r3, r3
706 ; CHECK-NEXT: setnbc r3, lt
709 %cmp = icmp slt i16 %a, 0
710 %conv = sext i1 %cmp to i64
714 define dso_local signext i32 @setnbc46(i8 %a) {
715 ; CHECK-LABEL: setnbc46:
716 ; CHECK: # %bb.0: # %entry
717 ; CHECK-NEXT: extsb. r3, r3
718 ; CHECK-NEXT: setnbc r3, gt
721 %cmp = icmp sgt i8 %a, 0
722 %conv = sext i1 %cmp to i32
726 define dso_local signext i32 @setnbc47(i32 %a) {
727 ; CHECK-LABEL: setnbc47:
728 ; CHECK: # %bb.0: # %entry
729 ; CHECK-NEXT: cmpwi r3, 0
730 ; CHECK-NEXT: setnbc r3, gt
733 %cmp = icmp sgt i32 %a, 0
734 %conv = sext i1 %cmp to i32
738 define dso_local signext i32 @setnbc48(i64 %a) {
739 ; CHECK-LABEL: setnbc48:
740 ; CHECK: # %bb.0: # %entry
741 ; CHECK-NEXT: cmpdi r3, 0
742 ; CHECK-NEXT: setnbc r3, gt
745 %cmp = icmp sgt i64 %a, 0
746 %conv = sext i1 %cmp to i32
750 define dso_local signext i32 @setnbc49(i16 %a) {
751 ; CHECK-LABEL: setnbc49:
752 ; CHECK: # %bb.0: # %entry
753 ; CHECK-NEXT: extsh. r3, r3
754 ; CHECK-NEXT: setnbc r3, gt
757 %cmp = icmp sgt i16 %a, 0
758 %conv = sext i1 %cmp to i32
762 define signext i64 @setnbc50(i8 %a) {
763 ; CHECK-LABEL: setnbc50:
764 ; CHECK: # %bb.0: # %entry
765 ; CHECK-NEXT: extsb. r3, r3
766 ; CHECK-NEXT: setnbc r3, gt
769 %cmp = icmp sgt i8 %a, 0
770 %conv = sext i1 %cmp to i64
774 define signext i64 @setnbc51(i32 %a) {
775 ; CHECK-LABEL: setnbc51:
776 ; CHECK: # %bb.0: # %entry
777 ; CHECK-NEXT: cmpwi r3, 0
778 ; CHECK-NEXT: setnbc r3, gt
781 %cmp = icmp sgt i32 %a, 0
782 %conv = sext i1 %cmp to i64
786 define signext i64 @setnbc52(i64 %a) {
787 ; CHECK-LABEL: setnbc52:
788 ; CHECK: # %bb.0: # %entry
789 ; CHECK-NEXT: cmpdi r3, 0
790 ; CHECK-NEXT: setnbc r3, gt
793 %cmp = icmp sgt i64 %a, 0
794 %conv = sext i1 %cmp to i64
798 define signext i64 @setnbc53(i16 %a) {
799 ; CHECK-LABEL: setnbc53:
800 ; CHECK: # %bb.0: # %entry
801 ; CHECK-NEXT: extsh. r3, r3
802 ; CHECK-NEXT: setnbc r3, gt
805 %cmp = icmp sgt i16 %a, 0
806 %conv = sext i1 %cmp to i64
810 define dso_local void @setnbc54(i8 %a) {
811 ; CHECK-LE-LABEL: setnbc54:
812 ; CHECK-LE: # %bb.0: # %entry
813 ; CHECK-LE-NEXT: extsb. r3, r3
814 ; CHECK-LE-NEXT: setnbc r3, gt
815 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
818 ; CHECK-BE-LABEL: setnbc54:
819 ; CHECK-BE: # %bb.0: # %entry
820 ; CHECK-BE-NEXT: extsb. r3, r3
821 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
822 ; CHECK-BE-NEXT: setnbc r3, gt
823 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
826 %cmp = icmp sgt i8 %a, 0
827 %conv1 = sext i1 %cmp to i8
828 store i8 %conv1, ptr @globalVal, align 1
832 define dso_local void @setnbc55(i32 %a) {
833 ; CHECK-LE-LABEL: setnbc55:
834 ; CHECK-LE: # %bb.0: # %entry
835 ; CHECK-LE-NEXT: cmpwi r3, 0
836 ; CHECK-LE-NEXT: setnbc r3, gt
837 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
840 ; CHECK-BE-LABEL: setnbc55:
841 ; CHECK-BE: # %bb.0: # %entry
842 ; CHECK-BE-NEXT: cmpwi r3, 0
843 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
844 ; CHECK-BE-NEXT: setnbc r3, gt
845 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
848 %cmp = icmp sgt i32 %a, 0
849 %conv1 = sext i1 %cmp to i32
850 store i32 %conv1, ptr @globalVal2, align 4
854 define dso_local void @setnbc56(i64 %a) {
855 ; CHECK-LE-LABEL: setnbc56:
856 ; CHECK-LE: # %bb.0: # %entry
857 ; CHECK-LE-NEXT: cmpdi r3, 0
858 ; CHECK-LE-NEXT: setnbc r3, gt
859 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
862 ; CHECK-BE-LABEL: setnbc56:
863 ; CHECK-BE: # %bb.0: # %entry
864 ; CHECK-BE-NEXT: cmpdi r3, 0
865 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
866 ; CHECK-BE-NEXT: setnbc r3, gt
867 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
870 %cmp = icmp sgt i64 %a, 0
871 %conv1 = sext i1 %cmp to i64
872 store i64 %conv1, ptr @globalVal3, align 8
876 define dso_local void @setnbc57(i16 %a) {
877 ; CHECK-LE-LABEL: setnbc57:
878 ; CHECK-LE: # %bb.0: # %entry
879 ; CHECK-LE-NEXT: extsh. r3, r3
880 ; CHECK-LE-NEXT: setnbc r3, gt
881 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
884 ; CHECK-BE-LABEL: setnbc57:
885 ; CHECK-BE: # %bb.0: # %entry
886 ; CHECK-BE-NEXT: extsh. r3, r3
887 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
888 ; CHECK-BE-NEXT: setnbc r3, gt
889 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
892 %cmp = icmp sgt i16 %a, 0
893 %conv1 = sext i1 %cmp to i16
894 store i16 %conv1, ptr @globalVal4, align 2
898 define dso_local signext i32 @setnbc58(i8 %a) {
899 ; CHECK-LABEL: setnbc58:
900 ; CHECK: # %bb.0: # %entry
901 ; CHECK-NEXT: andi. r3, r3, 255
902 ; CHECK-NEXT: setnbc r3, eq
905 %cmp = icmp eq i8 %a, 0
906 %conv = sext i1 %cmp to i32
910 define dso_local signext i32 @setnbc59(i32 %a) {
911 ; CHECK-LABEL: setnbc59:
912 ; CHECK: # %bb.0: # %entry
913 ; CHECK-NEXT: cmpwi r3, 0
914 ; CHECK-NEXT: setnbc r3, eq
917 %cmp = icmp eq i32 %a, 0
918 %conv = sext i1 %cmp to i32
922 define dso_local signext i32 @setnbc60(i64 %a) {
923 ; CHECK-LABEL: setnbc60:
924 ; CHECK: # %bb.0: # %entry
925 ; CHECK-NEXT: cmpdi r3, 0
926 ; CHECK-NEXT: setnbc r3, eq
929 %cmp = icmp eq i64 %a, 0
930 %conv = sext i1 %cmp to i32
934 define dso_local signext i32 @setnbc61(i16 %a) {
935 ; CHECK-LABEL: setnbc61:
936 ; CHECK: # %bb.0: # %entry
937 ; CHECK-NEXT: andi. r3, r3, 65535
938 ; CHECK-NEXT: setnbc r3, eq
941 %cmp = icmp eq i16 %a, 0
942 %conv = sext i1 %cmp to i32
946 define signext i64 @setnbc62(i8 %a) {
947 ; CHECK-LABEL: setnbc62:
948 ; CHECK: # %bb.0: # %entry
949 ; CHECK-NEXT: andi. r3, r3, 255
950 ; CHECK-NEXT: setnbc r3, eq
953 %cmp = icmp eq i8 %a, 0
954 %conv = sext i1 %cmp to i64
958 define signext i64 @setnbc63(i32 %a) {
959 ; CHECK-LABEL: setnbc63:
960 ; CHECK: # %bb.0: # %entry
961 ; CHECK-NEXT: cmpwi r3, 0
962 ; CHECK-NEXT: setnbc r3, eq
965 %cmp = icmp eq i32 %a, 0
966 %conv = sext i1 %cmp to i64
970 define signext i64 @setnbc64(i64 %a) {
971 ; CHECK-LABEL: setnbc64:
972 ; CHECK: # %bb.0: # %entry
973 ; CHECK-NEXT: cmpdi r3, 0
974 ; CHECK-NEXT: setnbc r3, eq
977 %cmp = icmp eq i64 %a, 0
978 %conv = sext i1 %cmp to i64
982 define signext i64 @setnbc65(i16 %a) {
983 ; CHECK-LABEL: setnbc65:
984 ; CHECK: # %bb.0: # %entry
985 ; CHECK-NEXT: andi. r3, r3, 65535
986 ; CHECK-NEXT: setnbc r3, eq
989 %cmp = icmp eq i16 %a, 0
990 %conv = sext i1 %cmp to i64
994 define dso_local void @setnbc66(i8 %a) {
995 ; CHECK-LE-LABEL: setnbc66:
996 ; CHECK-LE: # %bb.0: # %entry
997 ; CHECK-LE-NEXT: andi. r3, r3, 255
998 ; CHECK-LE-NEXT: setnbc r3, eq
999 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
1000 ; CHECK-LE-NEXT: blr
1002 ; CHECK-BE-LABEL: setnbc66:
1003 ; CHECK-BE: # %bb.0: # %entry
1004 ; CHECK-BE-NEXT: andi. r3, r3, 255
1005 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
1006 ; CHECK-BE-NEXT: setnbc r3, eq
1007 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
1008 ; CHECK-BE-NEXT: blr
1010 %cmp = icmp eq i8 %a, 0
1011 %conv1 = sext i1 %cmp to i8
1012 store i8 %conv1, ptr @globalVal, align 1
1016 define dso_local void @setnbc67(i32 %a) {
1017 ; CHECK-LE-LABEL: setnbc67:
1018 ; CHECK-LE: # %bb.0: # %entry
1019 ; CHECK-LE-NEXT: cmpwi r3, 0
1020 ; CHECK-LE-NEXT: setnbc r3, eq
1021 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
1022 ; CHECK-LE-NEXT: blr
1024 ; CHECK-BE-LABEL: setnbc67:
1025 ; CHECK-BE: # %bb.0: # %entry
1026 ; CHECK-BE-NEXT: cmpwi r3, 0
1027 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
1028 ; CHECK-BE-NEXT: setnbc r3, eq
1029 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
1030 ; CHECK-BE-NEXT: blr
1032 %cmp = icmp eq i32 %a, 0
1033 %conv1 = sext i1 %cmp to i32
1034 store i32 %conv1, ptr @globalVal2, align 4
1038 define dso_local void @setnbc68(i64 %a) {
1039 ; CHECK-LE-LABEL: setnbc68:
1040 ; CHECK-LE: # %bb.0: # %entry
1041 ; CHECK-LE-NEXT: cmpdi r3, 0
1042 ; CHECK-LE-NEXT: setnbc r3, eq
1043 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
1044 ; CHECK-LE-NEXT: blr
1046 ; CHECK-BE-LABEL: setnbc68:
1047 ; CHECK-BE: # %bb.0: # %entry
1048 ; CHECK-BE-NEXT: cmpdi r3, 0
1049 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
1050 ; CHECK-BE-NEXT: setnbc r3, eq
1051 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
1052 ; CHECK-BE-NEXT: blr
1054 %cmp = icmp eq i64 %a, 0
1055 %conv1 = sext i1 %cmp to i64
1056 store i64 %conv1, ptr @globalVal3, align 8
1060 define dso_local void @setnbc69(i16 %a) {
1061 ; CHECK-LE-LABEL: setnbc69:
1062 ; CHECK-LE: # %bb.0: # %entry
1063 ; CHECK-LE-NEXT: andi. r3, r3, 65535
1064 ; CHECK-LE-NEXT: setnbc r3, eq
1065 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
1066 ; CHECK-LE-NEXT: blr
1068 ; CHECK-BE-LABEL: setnbc69:
1069 ; CHECK-BE: # %bb.0: # %entry
1070 ; CHECK-BE-NEXT: andi. r3, r3, 65535
1071 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
1072 ; CHECK-BE-NEXT: setnbc r3, eq
1073 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
1074 ; CHECK-BE-NEXT: blr
1076 %cmp = icmp eq i16 %a, 0
1077 %conv1 = sext i1 %cmp to i16
1078 store i16 %conv1, ptr @globalVal4, align 2