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 @setnbcr1(i32 signext %a, i32 signext %b) {
21 ; CHECK-LABEL: setnbcr1:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: cmpw r3, r4
24 ; CHECK-NEXT: setnbcr r3, lt
27 %cmp = icmp sge i32 %a, %b
28 %lnot.ext = sext i1 %cmp to i32
32 define dso_local signext i32 @setnbcr2(i32 signext %a, i32 signext %b) {
33 ; CHECK-LABEL: setnbcr2:
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: cmpw r3, r4
36 ; CHECK-NEXT: setnbcr r3, gt
39 %cmp = icmp sle i32 %a, %b
40 %lnot.ext = sext i1 %cmp to i32
44 define dso_local signext i32 @setnbcr3(i32 signext %a, i32 signext %b) {
45 ; CHECK-LABEL: setnbcr3:
46 ; CHECK: # %bb.0: # %entry
47 ; CHECK-NEXT: cmpw r3, r4
48 ; CHECK-NEXT: setnbcr r3, eq
51 %cmp = icmp ne i32 %a, %b
52 %lnot.ext = sext i1 %cmp to i32
56 define dso_local signext i32 @setnbcr4(i8 signext %a, i8 signext %b) {
57 ; CHECK-LABEL: setnbcr4:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: cmpw r3, r4
60 ; CHECK-NEXT: setnbcr r3, lt
63 %cmp = icmp sge i8 %a, %b
64 %conv = sext i1 %cmp to i32
68 define dso_local void @setnbcr5(i8 signext %a, i8 signext %b) {
69 ; CHECK-LE-LABEL: setnbcr5:
70 ; CHECK-LE: # %bb.0: # %entry
71 ; CHECK-LE-NEXT: cmpw r3, r4
72 ; CHECK-LE-NEXT: setnbcr r3, lt
73 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
76 ; CHECK-BE-LABEL: setnbcr5:
77 ; CHECK-BE: # %bb.0: # %entry
78 ; CHECK-BE-NEXT: cmpw r3, r4
79 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
80 ; CHECK-BE-NEXT: setnbcr r3, lt
81 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
84 %cmp = icmp sge i8 %a, %b
85 %conv3 = sext i1 %cmp to i8
86 store i8 %conv3, ptr @globalVal, align 1
90 define dso_local void @setnbcr6(i32 signext %a, i32 signext %b) {
91 ; CHECK-LE-LABEL: setnbcr6:
92 ; CHECK-LE: # %bb.0: # %entry
93 ; CHECK-LE-NEXT: cmpw r3, r4
94 ; CHECK-LE-NEXT: setnbcr r3, lt
95 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
98 ; CHECK-BE-LABEL: setnbcr6:
99 ; CHECK-BE: # %bb.0: # %entry
100 ; CHECK-BE-NEXT: cmpw r3, r4
101 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
102 ; CHECK-BE-NEXT: setnbcr r3, lt
103 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
106 %cmp = icmp sge i32 %a, %b
107 %sub = sext i1 %cmp to i32
108 store i32 %sub, ptr @globalVal2, align 4
112 define dso_local signext i32 @setnbcr7(i64 %a, i64 %b) {
113 ; CHECK-LABEL: setnbcr7:
114 ; CHECK: # %bb.0: # %entry
115 ; CHECK-NEXT: cmpd r3, r4
116 ; CHECK-NEXT: setnbcr r3, lt
119 %cmp = icmp sge i64 %a, %b
120 %conv = sext i1 %cmp to i32
124 define signext i64 @setnbcr8(i64 %a, i64 %b) {
125 ; CHECK-LABEL: setnbcr8:
126 ; CHECK: # %bb.0: # %entry
127 ; CHECK-NEXT: cmpd r3, r4
128 ; CHECK-NEXT: setnbcr r3, lt
131 %cmp = icmp sge i64 %a, %b
132 %conv = sext i1 %cmp to i64
136 define dso_local void @setnbcr9(i64 %a, i64 %b) {
137 ; CHECK-LE-LABEL: setnbcr9:
138 ; CHECK-LE: # %bb.0: # %entry
139 ; CHECK-LE-NEXT: cmpd r3, r4
140 ; CHECK-LE-NEXT: setnbcr r3, lt
141 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
144 ; CHECK-BE-LABEL: setnbcr9:
145 ; CHECK-BE: # %bb.0: # %entry
146 ; CHECK-BE-NEXT: cmpd r3, r4
147 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
148 ; CHECK-BE-NEXT: setnbcr r3, lt
149 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
152 %cmp = icmp sge i64 %a, %b
153 %conv1 = sext i1 %cmp to i64
154 store i64 %conv1, ptr @globalVal3, align 8
158 define dso_local signext i32 @setnbcr10(i16 signext %a, i16 signext %b) {
159 ; CHECK-LABEL: setnbcr10:
160 ; CHECK: # %bb.0: # %entry
161 ; CHECK-NEXT: cmpw r3, r4
162 ; CHECK-NEXT: setnbcr r3, lt
165 %cmp = icmp sge i16 %a, %b
166 %sub = sext i1 %cmp to i32
170 define dso_local void @setnbcr11(i16 signext %a, i16 signext %b) {
171 ; CHECK-LE-LABEL: setnbcr11:
172 ; CHECK-LE: # %bb.0: # %entry
173 ; CHECK-LE-NEXT: cmpw r3, r4
174 ; CHECK-LE-NEXT: setnbcr r3, lt
175 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
178 ; CHECK-BE-LABEL: setnbcr11:
179 ; CHECK-BE: # %bb.0: # %entry
180 ; CHECK-BE-NEXT: cmpw r3, r4
181 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
182 ; CHECK-BE-NEXT: setnbcr r3, lt
183 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
186 %cmp = icmp sge i16 %a, %b
187 %conv3 = sext i1 %cmp to i16
188 store i16 %conv3, ptr @globalVal4, align 2
192 define dso_local signext i32 @setnbcr12(i8 zeroext %a, i8 zeroext %b) {
193 ; CHECK-LABEL: setnbcr12:
194 ; CHECK: # %bb.0: # %entry
195 ; CHECK-NEXT: cmplw r3, r4
196 ; CHECK-NEXT: setnbcr r3, lt
199 %cmp = icmp uge i8 %a, %b
200 %sub = sext i1 %cmp to i32
204 define dso_local void @setnbcr13(i8 zeroext %a, i8 zeroext %b) {
205 ; CHECK-LE-LABEL: setnbcr13:
206 ; CHECK-LE: # %bb.0: # %entry
207 ; CHECK-LE-NEXT: cmplw r3, r4
208 ; CHECK-LE-NEXT: setnbcr r3, lt
209 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
212 ; CHECK-BE-LABEL: setnbcr13:
213 ; CHECK-BE: # %bb.0: # %entry
214 ; CHECK-BE-NEXT: cmplw r3, r4
215 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
216 ; CHECK-BE-NEXT: setnbcr r3, lt
217 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
220 %cmp = icmp uge i8 %a, %b
221 %conv3 = sext i1 %cmp to i8
222 store i8 %conv3, ptr @globalVal
226 define dso_local signext i32 @setnbcr14(i32 zeroext %a, i32 zeroext %b) {
227 ; CHECK-LABEL: setnbcr14:
228 ; CHECK: # %bb.0: # %entry
229 ; CHECK-NEXT: cmplw r3, r4
230 ; CHECK-NEXT: setnbcr r3, lt
233 %cmp = icmp uge i32 %a, %b
234 %sub = sext i1 %cmp to i32
238 define dso_local void @setnbcr15(i32 zeroext %a, i32 zeroext %b) {
239 ; CHECK-LE-LABEL: setnbcr15:
240 ; CHECK-LE: # %bb.0: # %entry
241 ; CHECK-LE-NEXT: cmplw r3, r4
242 ; CHECK-LE-NEXT: setnbcr r3, lt
243 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
246 ; CHECK-BE-LABEL: setnbcr15:
247 ; CHECK-BE: # %bb.0: # %entry
248 ; CHECK-BE-NEXT: cmplw r3, r4
249 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
250 ; CHECK-BE-NEXT: setnbcr r3, lt
251 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
254 %cmp = icmp uge i32 %a, %b
255 %sub = sext i1 %cmp to i32
256 store i32 %sub, ptr @globalVal2
260 define dso_local signext i32 @setnbcr16(i64 %a, i64 %b) {
261 ; CHECK-LABEL: setnbcr16:
262 ; CHECK: # %bb.0: # %entry
263 ; CHECK-NEXT: cmpld r3, r4
264 ; CHECK-NEXT: setnbcr r3, lt
267 %cmp = icmp uge i64 %a, %b
268 %sub = sext i1 %cmp to i32
272 define dso_local void @setnbcr17(i64 %a, i64 %b) {
273 ; CHECK-LE-LABEL: setnbcr17:
274 ; CHECK-LE: # %bb.0: # %entry
275 ; CHECK-LE-NEXT: cmpld r3, r4
276 ; CHECK-LE-NEXT: setnbcr r3, lt
277 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
280 ; CHECK-BE-LABEL: setnbcr17:
281 ; CHECK-BE: # %bb.0: # %entry
282 ; CHECK-BE-NEXT: cmpld r3, r4
283 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
284 ; CHECK-BE-NEXT: setnbcr r3, lt
285 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
288 %cmp = icmp uge i64 %a, %b
289 %conv1 = sext i1 %cmp to i64
290 store i64 %conv1, ptr @globalVal3
294 define dso_local signext i32 @setnbcr18(i16 zeroext %a, i16 zeroext %b) {
295 ; CHECK-LABEL: setnbcr18:
296 ; CHECK: # %bb.0: # %entry
297 ; CHECK-NEXT: cmplw r3, r4
298 ; CHECK-NEXT: setnbcr r3, lt
301 %cmp = icmp uge i16 %a, %b
302 %sub = sext i1 %cmp to i32
306 define dso_local void @setnbcr19(i16 zeroext %a, i16 zeroext %b) {
307 ; CHECK-LE-LABEL: setnbcr19:
308 ; CHECK-LE: # %bb.0: # %entry
309 ; CHECK-LE-NEXT: cmplw r3, r4
310 ; CHECK-LE-NEXT: setnbcr r3, lt
311 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
314 ; CHECK-BE-LABEL: setnbcr19:
315 ; CHECK-BE: # %bb.0: # %entry
316 ; CHECK-BE-NEXT: cmplw r3, r4
317 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
318 ; CHECK-BE-NEXT: setnbcr r3, lt
319 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
322 %cmp = icmp uge i16 %a, %b
323 %conv3 = sext i1 %cmp to i16
324 store i16 %conv3, ptr @globalVal4
328 define dso_local signext i32 @setnbcr20(i8 signext %a, i8 signext %b) {
329 ; CHECK-LABEL: setnbcr20:
330 ; CHECK: # %bb.0: # %entry
331 ; CHECK-NEXT: cmpw r3, r4
332 ; CHECK-NEXT: setnbcr r3, gt
335 %cmp = icmp sle i8 %a, %b
336 %sub = sext i1 %cmp to i32
340 define dso_local void @setnbcr21(i8 signext %a, i8 signext %b) {
341 ; CHECK-LE-LABEL: setnbcr21:
342 ; CHECK-LE: # %bb.0: # %entry
343 ; CHECK-LE-NEXT: cmpw r3, r4
344 ; CHECK-LE-NEXT: setnbcr r3, gt
345 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
348 ; CHECK-BE-LABEL: setnbcr21:
349 ; CHECK-BE: # %bb.0: # %entry
350 ; CHECK-BE-NEXT: cmpw r3, r4
351 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
352 ; CHECK-BE-NEXT: setnbcr r3, gt
353 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
356 %cmp = icmp sle i8 %a, %b
357 %conv3 = sext i1 %cmp to i8
358 store i8 %conv3, ptr @globalVal, align 1
362 define dso_local signext i32 @setnbcr22(i32 signext %a, i32 signext %b) {
363 ; CHECK-LABEL: setnbcr22:
364 ; CHECK: # %bb.0: # %entry
365 ; CHECK-NEXT: cmpw r3, r4
366 ; CHECK-NEXT: setnbcr r3, gt
369 %cmp = icmp sle i32 %a, %b
370 %sub = sext i1 %cmp to i32
374 define dso_local void @setnbcr23(i32 signext %a, i32 signext %b) {
375 ; CHECK-LE-LABEL: setnbcr23:
376 ; CHECK-LE: # %bb.0: # %entry
377 ; CHECK-LE-NEXT: cmpw r3, r4
378 ; CHECK-LE-NEXT: setnbcr r3, gt
379 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
382 ; CHECK-BE-LABEL: setnbcr23:
383 ; CHECK-BE: # %bb.0: # %entry
384 ; CHECK-BE-NEXT: cmpw r3, r4
385 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
386 ; CHECK-BE-NEXT: setnbcr r3, gt
387 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
390 %cmp = icmp sle i32 %a, %b
391 %sub = sext i1 %cmp to i32
392 store i32 %sub, ptr @globalVal2, align 4
396 define dso_local signext i32 @setnbcr24(i64 %a, i64 %b) {
397 ; CHECK-LABEL: setnbcr24:
398 ; CHECK: # %bb.0: # %entry
399 ; CHECK-NEXT: cmpd r3, r4
400 ; CHECK-NEXT: setnbcr r3, gt
403 %cmp = icmp sle i64 %a, %b
404 %sub = sext i1 %cmp to i32
408 define dso_local void @setnbcr25(i64 %a, i64 %b) {
409 ; CHECK-LE-LABEL: setnbcr25:
410 ; CHECK-LE: # %bb.0: # %entry
411 ; CHECK-LE-NEXT: cmpd r3, r4
412 ; CHECK-LE-NEXT: setnbcr r3, gt
413 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
416 ; CHECK-BE-LABEL: setnbcr25:
417 ; CHECK-BE: # %bb.0: # %entry
418 ; CHECK-BE-NEXT: cmpd r3, r4
419 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
420 ; CHECK-BE-NEXT: setnbcr r3, gt
421 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
424 %cmp = icmp sle i64 %a, %b
425 %conv1 = sext i1 %cmp to i64
426 store i64 %conv1, ptr @globalVal3, align 8
430 define dso_local signext i32 @setnbcr26(i16 signext %a, i16 signext %b) {
431 ; CHECK-LABEL: setnbcr26:
432 ; CHECK: # %bb.0: # %entry
433 ; CHECK-NEXT: cmpw r3, r4
434 ; CHECK-NEXT: setnbcr r3, gt
437 %cmp = icmp sle i16 %a, %b
438 %sub = sext i1 %cmp to i32
442 define dso_local void @setnbcr27(i16 signext %a, i16 signext %b) {
443 ; CHECK-LE-LABEL: setnbcr27:
444 ; CHECK-LE: # %bb.0: # %entry
445 ; CHECK-LE-NEXT: cmpw r3, r4
446 ; CHECK-LE-NEXT: setnbcr r3, gt
447 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
450 ; CHECK-BE-LABEL: setnbcr27:
451 ; CHECK-BE: # %bb.0: # %entry
452 ; CHECK-BE-NEXT: cmpw r3, r4
453 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
454 ; CHECK-BE-NEXT: setnbcr r3, gt
455 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
458 %cmp = icmp sle i16 %a, %b
459 %conv3 = sext i1 %cmp to i16
460 store i16 %conv3, ptr @globalVal4, align 2
464 define dso_local signext i32 @setnbcr28(i8 zeroext %a, i8 zeroext %b) {
465 ; CHECK-LABEL: setnbcr28:
466 ; CHECK: # %bb.0: # %entry
467 ; CHECK-NEXT: cmplw r3, r4
468 ; CHECK-NEXT: setnbcr r3, gt
471 %cmp = icmp ule i8 %a, %b
472 %sub = sext i1 %cmp to i32
476 define dso_local void @setnbcr29(i8 zeroext %a, i8 zeroext %b) {
477 ; CHECK-LE-LABEL: setnbcr29:
478 ; CHECK-LE: # %bb.0: # %entry
479 ; CHECK-LE-NEXT: cmplw r3, r4
480 ; CHECK-LE-NEXT: setnbcr r3, gt
481 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
484 ; CHECK-BE-LABEL: setnbcr29:
485 ; CHECK-BE: # %bb.0: # %entry
486 ; CHECK-BE-NEXT: cmplw r3, r4
487 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
488 ; CHECK-BE-NEXT: setnbcr r3, gt
489 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
492 %cmp = icmp ule i8 %a, %b
493 %conv3 = sext i1 %cmp to i8
494 store i8 %conv3, ptr @globalVal
498 define dso_local signext i32 @setnbcr30(i32 zeroext %a, i32 zeroext %b) {
499 ; CHECK-LABEL: setnbcr30:
500 ; CHECK: # %bb.0: # %entry
501 ; CHECK-NEXT: cmplw r3, r4
502 ; CHECK-NEXT: setnbcr r3, gt
505 %cmp = icmp ule i32 %a, %b
506 %sub = sext i1 %cmp to i32
510 define dso_local void @setnbcr31(i32 zeroext %a, i32 zeroext %b) {
511 ; CHECK-LE-LABEL: setnbcr31:
512 ; CHECK-LE: # %bb.0: # %entry
513 ; CHECK-LE-NEXT: cmplw r3, r4
514 ; CHECK-LE-NEXT: setnbcr r3, gt
515 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
518 ; CHECK-BE-LABEL: setnbcr31:
519 ; CHECK-BE: # %bb.0: # %entry
520 ; CHECK-BE-NEXT: cmplw r3, r4
521 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
522 ; CHECK-BE-NEXT: setnbcr r3, gt
523 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
526 %cmp = icmp ule i32 %a, %b
527 %sub = sext i1 %cmp to i32
528 store i32 %sub, ptr @globalVal2
532 define dso_local signext i32 @setnbcr32(i64 %a, i64 %b) {
533 ; CHECK-LABEL: setnbcr32:
534 ; CHECK: # %bb.0: # %entry
535 ; CHECK-NEXT: cmpld r3, r4
536 ; CHECK-NEXT: setnbcr r3, gt
539 %cmp = icmp ule i64 %a, %b
540 %sub = sext i1 %cmp to i32
544 define dso_local void @setnbcr33(i64 %a, i64 %b) {
545 ; CHECK-LE-LABEL: setnbcr33:
546 ; CHECK-LE: # %bb.0: # %entry
547 ; CHECK-LE-NEXT: cmpld r3, r4
548 ; CHECK-LE-NEXT: setnbcr r3, gt
549 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
552 ; CHECK-BE-LABEL: setnbcr33:
553 ; CHECK-BE: # %bb.0: # %entry
554 ; CHECK-BE-NEXT: cmpld r3, r4
555 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
556 ; CHECK-BE-NEXT: setnbcr r3, gt
557 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
560 %cmp = icmp ule i64 %a, %b
561 %conv1 = sext i1 %cmp to i64
562 store i64 %conv1, ptr @globalVal3
566 define dso_local signext i32 @setnbcr34(i16 zeroext %a, i16 zeroext %b) {
567 ; CHECK-LABEL: setnbcr34:
568 ; CHECK: # %bb.0: # %entry
569 ; CHECK-NEXT: cmplw r3, r4
570 ; CHECK-NEXT: setnbcr r3, gt
573 %cmp = icmp ule i16 %a, %b
574 %sub = sext i1 %cmp to i32
578 define dso_local void @setnbcr35(i16 zeroext %a, i16 zeroext %b) {
579 ; CHECK-LE-LABEL: setnbcr35:
580 ; CHECK-LE: # %bb.0: # %entry
581 ; CHECK-LE-NEXT: cmplw r3, r4
582 ; CHECK-LE-NEXT: setnbcr r3, gt
583 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
586 ; CHECK-BE-LABEL: setnbcr35:
587 ; CHECK-BE: # %bb.0: # %entry
588 ; CHECK-BE-NEXT: cmplw r3, r4
589 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
590 ; CHECK-BE-NEXT: setnbcr r3, gt
591 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
594 %cmp = icmp ule i16 %a, %b
595 %conv3 = sext i1 %cmp to i16
596 store i16 %conv3, ptr @globalVal4
600 define dso_local signext i32 @setnbcr36(i8 signext %a, i8 signext %b) {
601 ; CHECK-LABEL: setnbcr36:
602 ; CHECK: # %bb.0: # %entry
603 ; CHECK-NEXT: cmpw r3, r4
604 ; CHECK-NEXT: setnbcr r3, eq
607 %cmp = icmp ne i8 %a, %b
608 %sub = sext i1 %cmp to i32
612 define dso_local void @setnbcr37(i8 signext %a, i8 signext %b) {
613 ; CHECK-LE-LABEL: setnbcr37:
614 ; CHECK-LE: # %bb.0: # %entry
615 ; CHECK-LE-NEXT: cmpw r3, r4
616 ; CHECK-LE-NEXT: setnbcr r3, eq
617 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
620 ; CHECK-BE-LABEL: setnbcr37:
621 ; CHECK-BE: # %bb.0: # %entry
622 ; CHECK-BE-NEXT: cmpw r3, r4
623 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
624 ; CHECK-BE-NEXT: setnbcr r3, eq
625 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
628 %cmp = icmp ne i8 %a, %b
629 %conv3 = sext i1 %cmp to i8
630 store i8 %conv3, ptr @globalVal, align 1
634 define dso_local void @setnbcr38(i32 signext %a, i32 signext %b) {
635 ; CHECK-LE-LABEL: setnbcr38:
636 ; CHECK-LE: # %bb.0: # %entry
637 ; CHECK-LE-NEXT: cmpw r3, r4
638 ; CHECK-LE-NEXT: setnbcr r3, eq
639 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
642 ; CHECK-BE-LABEL: setnbcr38:
643 ; CHECK-BE: # %bb.0: # %entry
644 ; CHECK-BE-NEXT: cmpw r3, r4
645 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
646 ; CHECK-BE-NEXT: setnbcr r3, eq
647 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
650 %cmp = icmp ne i32 %a, %b
651 %sub = sext i1 %cmp to i32
652 store i32 %sub, ptr @globalVal2, align 4
656 define dso_local signext i32 @setnbcr39(i64 %a, i64 %b) {
657 ; CHECK-LABEL: setnbcr39:
658 ; CHECK: # %bb.0: # %entry
659 ; CHECK-NEXT: cmpd r3, r4
660 ; CHECK-NEXT: setnbcr r3, eq
663 %cmp = icmp ne i64 %a, %b
664 %sub = sext i1 %cmp to i32
668 define dso_local void @setnbcr40(i64 %a, i64 %b) {
669 ; CHECK-LE-LABEL: setnbcr40:
670 ; CHECK-LE: # %bb.0: # %entry
671 ; CHECK-LE-NEXT: cmpd r3, r4
672 ; CHECK-LE-NEXT: setnbcr r3, eq
673 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
676 ; CHECK-BE-LABEL: setnbcr40:
677 ; CHECK-BE: # %bb.0: # %entry
678 ; CHECK-BE-NEXT: cmpd r3, r4
679 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
680 ; CHECK-BE-NEXT: setnbcr r3, eq
681 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
684 %cmp = icmp ne i64 %a, %b
685 %conv1 = sext i1 %cmp to i64
686 store i64 %conv1, ptr @globalVal3, align 8
690 define dso_local signext i32 @setnbcr41(i16 signext %a, i16 signext %b) {
691 ; CHECK-LABEL: setnbcr41:
692 ; CHECK: # %bb.0: # %entry
693 ; CHECK-NEXT: cmpw r3, r4
694 ; CHECK-NEXT: setnbcr r3, eq
697 %cmp = icmp ne i16 %a, %b
698 %sub = sext i1 %cmp to i32
702 define dso_local void @setnbcr42(i16 signext %a, i16 signext %b) {
703 ; CHECK-LE-LABEL: setnbcr42:
704 ; CHECK-LE: # %bb.0: # %entry
705 ; CHECK-LE-NEXT: cmpw r3, r4
706 ; CHECK-LE-NEXT: setnbcr r3, eq
707 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
710 ; CHECK-BE-LABEL: setnbcr42:
711 ; CHECK-BE: # %bb.0: # %entry
712 ; CHECK-BE-NEXT: cmpw r3, r4
713 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
714 ; CHECK-BE-NEXT: setnbcr r3, eq
715 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
718 %cmp = icmp ne i16 %a, %b
719 %conv3 = sext i1 %cmp to i16
720 store i16 %conv3, ptr @globalVal4, align 2
724 define dso_local signext i32 @setnbcr43(i8 zeroext %a, i8 zeroext %b) {
725 ; CHECK-LABEL: setnbcr43:
726 ; CHECK: # %bb.0: # %entry
727 ; CHECK-NEXT: cmpw r3, r4
728 ; CHECK-NEXT: setnbcr r3, eq
731 %cmp = icmp ne i8 %a, %b
732 %sub = sext i1 %cmp to i32
736 define dso_local void @sernbcr44(i8 zeroext %a, i8 zeroext %b) {
737 ; CHECK-LE-LABEL: sernbcr44:
738 ; CHECK-LE: # %bb.0: # %entry
739 ; CHECK-LE-NEXT: cmpw r3, r4
740 ; CHECK-LE-NEXT: setnbcr r3, eq
741 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
744 ; CHECK-BE-LABEL: sernbcr44:
745 ; CHECK-BE: # %bb.0: # %entry
746 ; CHECK-BE-NEXT: cmpw r3, r4
747 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
748 ; CHECK-BE-NEXT: setnbcr r3, eq
749 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
752 %cmp = icmp ne i8 %a, %b
753 %conv3 = sext i1 %cmp to i8
754 store i8 %conv3, ptr @globalVal, align 1
758 define dso_local signext i32 @setnbcr45(i32 zeroext %a, i32 zeroext %b) {
759 ; CHECK-LABEL: setnbcr45:
760 ; CHECK: # %bb.0: # %entry
761 ; CHECK-NEXT: cmpw r3, r4
762 ; CHECK-NEXT: setnbcr r3, eq
765 %cmp = icmp ne i32 %a, %b
766 %sub = sext i1 %cmp to i32
770 define dso_local void @setnbcr46(i32 zeroext %a, i32 zeroext %b) {
771 ; CHECK-LE-LABEL: setnbcr46:
772 ; CHECK-LE: # %bb.0: # %entry
773 ; CHECK-LE-NEXT: cmpw r3, r4
774 ; CHECK-LE-NEXT: setnbcr r3, eq
775 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
778 ; CHECK-BE-LABEL: setnbcr46:
779 ; CHECK-BE: # %bb.0: # %entry
780 ; CHECK-BE-NEXT: cmpw r3, r4
781 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
782 ; CHECK-BE-NEXT: setnbcr r3, eq
783 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
786 %cmp = icmp ne i32 %a, %b
787 %conv = sext i1 %cmp to i32
788 store i32 %conv, ptr @globalVal2, align 4
792 define dso_local signext i32 @setnbcr47(i16 zeroext %a, i16 zeroext %b) {
793 ; CHECK-LABEL: setnbcr47:
794 ; CHECK: # %bb.0: # %entry
795 ; CHECK-NEXT: cmpw r3, r4
796 ; CHECK-NEXT: setnbcr r3, eq
799 %cmp = icmp ne i16 %a, %b
800 %sub = sext i1 %cmp to i32
804 define dso_local void @setnbcr48(i16 zeroext %a, i16 zeroext %b) {
805 ; CHECK-LE-LABEL: setnbcr48:
806 ; CHECK-LE: # %bb.0: # %entry
807 ; CHECK-LE-NEXT: cmpw r3, r4
808 ; CHECK-LE-NEXT: setnbcr r3, eq
809 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
812 ; CHECK-BE-LABEL: setnbcr48:
813 ; CHECK-BE: # %bb.0: # %entry
814 ; CHECK-BE-NEXT: cmpw r3, r4
815 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
816 ; CHECK-BE-NEXT: setnbcr r3, eq
817 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
820 %cmp = icmp ne i16 %a, %b
821 %conv3 = sext i1 %cmp to i16
822 store i16 %conv3, ptr @globalVal4, align 2
826 define i64 @setnbcr49(i8 signext %a, i8 signext %b) {
827 ; CHECK-LABEL: setnbcr49:
828 ; CHECK: # %bb.0: # %entry
829 ; CHECK-NEXT: cmpw r3, r4
830 ; CHECK-NEXT: setnbcr r3, lt
833 %cmp = icmp sge i8 %a, %b
834 %conv3 = sext i1 %cmp to i64
838 define dso_local void @setnbcr50(i8 signext %a, i8 signext %b) {
839 ; CHECK-LE-LABEL: setnbcr50:
840 ; CHECK-LE: # %bb.0: # %entry
841 ; CHECK-LE-NEXT: cmpw r3, r4
842 ; CHECK-LE-NEXT: setnbcr r3, lt
843 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
846 ; CHECK-BE-LABEL: setnbcr50:
847 ; CHECK-BE: # %bb.0: # %entry
848 ; CHECK-BE-NEXT: cmpw r3, r4
849 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
850 ; CHECK-BE-NEXT: setnbcr r3, lt
851 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
854 %cmp = icmp sge i8 %a, %b
855 %conv3 = sext i1 %cmp to i8
856 store i8 %conv3, ptr @globalVal, align 1
860 define i64 @setnbcr51(i32 signext %a, i32 signext %b) {
861 ; CHECK-LABEL: setnbcr51:
862 ; CHECK: # %bb.0: # %entry
863 ; CHECK-NEXT: cmpw r3, r4
864 ; CHECK-NEXT: setnbcr r3, lt
867 %cmp = icmp sge i32 %a, %b
868 %conv1 = sext i1 %cmp to i64
872 define dso_local void @setnbcr52(i32 signext %a, i32 signext %b) {
873 ; CHECK-LE-LABEL: setnbcr52:
874 ; CHECK-LE: # %bb.0: # %entry
875 ; CHECK-LE-NEXT: cmpw r3, r4
876 ; CHECK-LE-NEXT: setnbcr r3, lt
877 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
880 ; CHECK-BE-LABEL: setnbcr52:
881 ; CHECK-BE: # %bb.0: # %entry
882 ; CHECK-BE-NEXT: cmpw r3, r4
883 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
884 ; CHECK-BE-NEXT: setnbcr r3, lt
885 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
888 %cmp = icmp sge i32 %a, %b
889 %sub = sext i1 %cmp to i32
890 store i32 %sub, ptr @globalVal2, align 4
894 define i64 @setnbcr53(i64 %a, i64 %b) {
895 ; CHECK-LABEL: setnbcr53:
896 ; CHECK: # %bb.0: # %entry
897 ; CHECK-NEXT: cmpd r3, r4
898 ; CHECK-NEXT: setnbcr r3, lt
901 %cmp = icmp sge i64 %a, %b
902 %conv1 = sext i1 %cmp to i64
906 define dso_local void @setnbcr54(i64 %a, i64 %b) {
907 ; CHECK-LE-LABEL: setnbcr54:
908 ; CHECK-LE: # %bb.0: # %entry
909 ; CHECK-LE-NEXT: cmpd r3, r4
910 ; CHECK-LE-NEXT: setnbcr r3, lt
911 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
914 ; CHECK-BE-LABEL: setnbcr54:
915 ; CHECK-BE: # %bb.0: # %entry
916 ; CHECK-BE-NEXT: cmpd r3, r4
917 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
918 ; CHECK-BE-NEXT: setnbcr r3, lt
919 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
922 %cmp = icmp sge i64 %a, %b
923 %conv1 = sext i1 %cmp to i64
924 store i64 %conv1, ptr @globalVal3, align 8
928 define i64 @setnbcr55(i16 signext %a, i16 signext %b) {
929 ; CHECK-LABEL: setnbcr55:
930 ; CHECK: # %bb.0: # %entry
931 ; CHECK-NEXT: cmpw r3, r4
932 ; CHECK-NEXT: setnbcr r3, lt
935 %cmp = icmp sge i16 %a, %b
936 %conv3 = sext i1 %cmp to i64
940 define dso_local void @setnbcr56(i16 signext %a, i16 signext %b) {
941 ; CHECK-LE-LABEL: setnbcr56:
942 ; CHECK-LE: # %bb.0: # %entry
943 ; CHECK-LE-NEXT: cmpw r3, r4
944 ; CHECK-LE-NEXT: setnbcr r3, lt
945 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
948 ; CHECK-BE-LABEL: setnbcr56:
949 ; CHECK-BE: # %bb.0: # %entry
950 ; CHECK-BE-NEXT: cmpw r3, r4
951 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
952 ; CHECK-BE-NEXT: setnbcr r3, lt
953 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
956 %cmp = icmp sge i16 %a, %b
957 %conv3 = sext i1 %cmp to i16
958 store i16 %conv3, ptr @globalVal4, align 2
962 define i64 @setnbcr57(i8 zeroext %a, i8 zeroext %b) {
963 ; CHECK-LABEL: setnbcr57:
964 ; CHECK: # %bb.0: # %entry
965 ; CHECK-NEXT: cmplw r3, r4
966 ; CHECK-NEXT: setnbcr r3, lt
969 %cmp = icmp uge i8 %a, %b
970 %conv3 = sext i1 %cmp to i64
974 define dso_local void @setnbcr58(i8 zeroext %a, i8 zeroext %b) {
975 ; CHECK-LE-LABEL: setnbcr58:
976 ; CHECK-LE: # %bb.0: # %entry
977 ; CHECK-LE-NEXT: cmplw r3, r4
978 ; CHECK-LE-NEXT: setnbcr r3, lt
979 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
982 ; CHECK-BE-LABEL: setnbcr58:
983 ; CHECK-BE: # %bb.0: # %entry
984 ; CHECK-BE-NEXT: cmplw r3, r4
985 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
986 ; CHECK-BE-NEXT: setnbcr r3, lt
987 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
990 %cmp = icmp uge i8 %a, %b
991 %conv3 = sext i1 %cmp to i8
992 store i8 %conv3, ptr @globalVal
996 define i64 @setnbcr59(i32 zeroext %a, i32 zeroext %b) {
997 ; CHECK-LABEL: setnbcr59:
998 ; CHECK: # %bb.0: # %entry
999 ; CHECK-NEXT: cmplw r3, r4
1000 ; CHECK-NEXT: setnbcr r3, lt
1003 %cmp = icmp uge i32 %a, %b
1004 %conv1 = sext i1 %cmp to i64
1008 define dso_local void @setnbcr60(i32 zeroext %a, i32 zeroext %b) {
1009 ; CHECK-LE-LABEL: setnbcr60:
1010 ; CHECK-LE: # %bb.0: # %entry
1011 ; CHECK-LE-NEXT: cmplw r3, r4
1012 ; CHECK-LE-NEXT: setnbcr r3, lt
1013 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
1014 ; CHECK-LE-NEXT: blr
1016 ; CHECK-BE-LABEL: setnbcr60:
1017 ; CHECK-BE: # %bb.0: # %entry
1018 ; CHECK-BE-NEXT: cmplw r3, r4
1019 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
1020 ; CHECK-BE-NEXT: setnbcr r3, lt
1021 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
1022 ; CHECK-BE-NEXT: blr
1024 %cmp = icmp uge i32 %a, %b
1025 %sub = sext i1 %cmp to i32
1026 store i32 %sub, ptr @globalVal2
1030 define i64 @setnbcr61(i64 %a, i64 %b) {
1031 ; CHECK-LABEL: setnbcr61:
1032 ; CHECK: # %bb.0: # %entry
1033 ; CHECK-NEXT: cmpld r3, r4
1034 ; CHECK-NEXT: setnbcr r3, lt
1037 %cmp = icmp uge i64 %a, %b
1038 %conv1 = sext i1 %cmp to i64
1042 define dso_local void @setnbcr62(i64 %a, i64 %b) {
1043 ; CHECK-LE-LABEL: setnbcr62:
1044 ; CHECK-LE: # %bb.0: # %entry
1045 ; CHECK-LE-NEXT: cmpld r3, r4
1046 ; CHECK-LE-NEXT: setnbcr r3, lt
1047 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
1048 ; CHECK-LE-NEXT: blr
1050 ; CHECK-BE-LABEL: setnbcr62:
1051 ; CHECK-BE: # %bb.0: # %entry
1052 ; CHECK-BE-NEXT: cmpld r3, r4
1053 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
1054 ; CHECK-BE-NEXT: setnbcr r3, lt
1055 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
1056 ; CHECK-BE-NEXT: blr
1058 %cmp = icmp uge i64 %a, %b
1059 %conv1 = sext i1 %cmp to i64
1060 store i64 %conv1, ptr @globalVal3
1064 define i64 @setnbcr63(i16 zeroext %a, i16 zeroext %b) {
1065 ; CHECK-LABEL: setnbcr63:
1066 ; CHECK: # %bb.0: # %entry
1067 ; CHECK-NEXT: cmplw r3, r4
1068 ; CHECK-NEXT: setnbcr r3, lt
1071 %cmp = icmp uge i16 %a, %b
1072 %conv3 = sext i1 %cmp to i64
1076 define dso_local void @setnbcr64(i16 zeroext %a, i16 zeroext %b) {
1077 ; CHECK-LE-LABEL: setnbcr64:
1078 ; CHECK-LE: # %bb.0: # %entry
1079 ; CHECK-LE-NEXT: cmplw r3, r4
1080 ; CHECK-LE-NEXT: setnbcr r3, lt
1081 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
1082 ; CHECK-LE-NEXT: blr
1084 ; CHECK-BE-LABEL: setnbcr64:
1085 ; CHECK-BE: # %bb.0: # %entry
1086 ; CHECK-BE-NEXT: cmplw r3, r4
1087 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
1088 ; CHECK-BE-NEXT: setnbcr r3, lt
1089 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
1090 ; CHECK-BE-NEXT: blr
1092 %cmp = icmp uge i16 %a, %b
1093 %conv3 = sext i1 %cmp to i16
1094 store i16 %conv3, ptr @globalVal4
1098 define i64 @setnbcr65(i8 signext %a, i8 signext %b) {
1099 ; CHECK-LABEL: setnbcr65:
1100 ; CHECK: # %bb.0: # %entry
1101 ; CHECK-NEXT: cmpw r3, r4
1102 ; CHECK-NEXT: setnbcr r3, gt
1105 %cmp = icmp sle i8 %a, %b
1106 %conv3 = sext i1 %cmp to i64
1110 define dso_local void @setnbcr66(i8 signext %a, i8 signext %b) {
1111 ; CHECK-LE-LABEL: setnbcr66:
1112 ; CHECK-LE: # %bb.0: # %entry
1113 ; CHECK-LE-NEXT: cmpw r3, r4
1114 ; CHECK-LE-NEXT: setnbcr r3, gt
1115 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
1116 ; CHECK-LE-NEXT: blr
1118 ; CHECK-BE-LABEL: setnbcr66:
1119 ; CHECK-BE: # %bb.0: # %entry
1120 ; CHECK-BE-NEXT: cmpw r3, r4
1121 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
1122 ; CHECK-BE-NEXT: setnbcr r3, gt
1123 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
1124 ; CHECK-BE-NEXT: blr
1126 %cmp = icmp sle i8 %a, %b
1127 %conv3 = sext i1 %cmp to i8
1128 store i8 %conv3, ptr @globalVal, align 1
1132 define i64 @setnbcr67(i32 signext %a, i32 signext %b) {
1133 ; CHECK-LABEL: setnbcr67:
1134 ; CHECK: # %bb.0: # %entry
1135 ; CHECK-NEXT: cmpw r3, r4
1136 ; CHECK-NEXT: setnbcr r3, gt
1139 %cmp = icmp sle i32 %a, %b
1140 %conv1 = sext i1 %cmp to i64
1144 define dso_local void @setnbcr68(i32 signext %a, i32 signext %b) {
1145 ; CHECK-LE-LABEL: setnbcr68:
1146 ; CHECK-LE: # %bb.0: # %entry
1147 ; CHECK-LE-NEXT: cmpw r3, r4
1148 ; CHECK-LE-NEXT: setnbcr r3, gt
1149 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
1150 ; CHECK-LE-NEXT: blr
1152 ; CHECK-BE-LABEL: setnbcr68:
1153 ; CHECK-BE: # %bb.0: # %entry
1154 ; CHECK-BE-NEXT: cmpw r3, r4
1155 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
1156 ; CHECK-BE-NEXT: setnbcr r3, gt
1157 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
1158 ; CHECK-BE-NEXT: blr
1160 %cmp = icmp sle i32 %a, %b
1161 %sub = sext i1 %cmp to i32
1162 store i32 %sub, ptr @globalVal2, align 4
1166 define i64 @setnbcr69(i64 %a, i64 %b) {
1167 ; CHECK-LABEL: setnbcr69:
1168 ; CHECK: # %bb.0: # %entry
1169 ; CHECK-NEXT: cmpd r3, r4
1170 ; CHECK-NEXT: setnbcr r3, gt
1173 %cmp = icmp sle i64 %a, %b
1174 %conv1 = sext i1 %cmp to i64
1178 define dso_local void @setnbcr70(i64 %a, i64 %b) {
1179 ; CHECK-LE-LABEL: setnbcr70:
1180 ; CHECK-LE: # %bb.0: # %entry
1181 ; CHECK-LE-NEXT: cmpd r3, r4
1182 ; CHECK-LE-NEXT: setnbcr r3, gt
1183 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
1184 ; CHECK-LE-NEXT: blr
1186 ; CHECK-BE-LABEL: setnbcr70:
1187 ; CHECK-BE: # %bb.0: # %entry
1188 ; CHECK-BE-NEXT: cmpd r3, r4
1189 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
1190 ; CHECK-BE-NEXT: setnbcr r3, gt
1191 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
1192 ; CHECK-BE-NEXT: blr
1194 %cmp = icmp sle i64 %a, %b
1195 %conv1 = sext i1 %cmp to i64
1196 store i64 %conv1, ptr @globalVal3, align 8
1200 define i64 @setnbcr71(i16 signext %a, i16 signext %b) {
1201 ; CHECK-LABEL: setnbcr71:
1202 ; CHECK: # %bb.0: # %entry
1203 ; CHECK-NEXT: cmpw r3, r4
1204 ; CHECK-NEXT: setnbcr r3, gt
1207 %cmp = icmp sle i16 %a, %b
1208 %conv3 = sext i1 %cmp to i64
1212 define dso_local void @setnbcr72(i16 signext %a, i16 signext %b) {
1213 ; CHECK-LE-LABEL: setnbcr72:
1214 ; CHECK-LE: # %bb.0: # %entry
1215 ; CHECK-LE-NEXT: cmpw r3, r4
1216 ; CHECK-LE-NEXT: setnbcr r3, gt
1217 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
1218 ; CHECK-LE-NEXT: blr
1220 ; CHECK-BE-LABEL: setnbcr72:
1221 ; CHECK-BE: # %bb.0: # %entry
1222 ; CHECK-BE-NEXT: cmpw r3, r4
1223 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
1224 ; CHECK-BE-NEXT: setnbcr r3, gt
1225 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
1226 ; CHECK-BE-NEXT: blr
1228 %cmp = icmp sle i16 %a, %b
1229 %conv3 = sext i1 %cmp to i16
1230 store i16 %conv3, ptr @globalVal4, align 2
1234 define i64 @setnbcr73(i8 zeroext %a, i8 zeroext %b) {
1235 ; CHECK-LABEL: setnbcr73:
1236 ; CHECK: # %bb.0: # %entry
1237 ; CHECK-NEXT: cmplw r3, r4
1238 ; CHECK-NEXT: setnbcr r3, gt
1241 %cmp = icmp ule i8 %a, %b
1242 %conv3 = sext i1 %cmp to i64
1246 define dso_local void @setnbcr74(i8 zeroext %a, i8 zeroext %b) {
1247 ; CHECK-LE-LABEL: setnbcr74:
1248 ; CHECK-LE: # %bb.0: # %entry
1249 ; CHECK-LE-NEXT: cmplw r3, r4
1250 ; CHECK-LE-NEXT: setnbcr r3, gt
1251 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
1252 ; CHECK-LE-NEXT: blr
1254 ; CHECK-BE-LABEL: setnbcr74:
1255 ; CHECK-BE: # %bb.0: # %entry
1256 ; CHECK-BE-NEXT: cmplw r3, r4
1257 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
1258 ; CHECK-BE-NEXT: setnbcr r3, gt
1259 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
1260 ; CHECK-BE-NEXT: blr
1262 %cmp = icmp ule i8 %a, %b
1263 %conv3 = sext i1 %cmp to i8
1264 store i8 %conv3, ptr @globalVal
1268 define i64 @setnbcr75(i32 zeroext %a, i32 zeroext %b) {
1269 ; CHECK-LABEL: setnbcr75:
1270 ; CHECK: # %bb.0: # %entry
1271 ; CHECK-NEXT: cmplw r3, r4
1272 ; CHECK-NEXT: setnbcr r3, gt
1275 %cmp = icmp ule i32 %a, %b
1276 %conv1 = sext i1 %cmp to i64
1280 define dso_local void @setnbcr76(i32 zeroext %a, i32 zeroext %b) {
1281 ; CHECK-LE-LABEL: setnbcr76:
1282 ; CHECK-LE: # %bb.0: # %entry
1283 ; CHECK-LE-NEXT: cmplw r3, r4
1284 ; CHECK-LE-NEXT: setnbcr r3, gt
1285 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
1286 ; CHECK-LE-NEXT: blr
1288 ; CHECK-BE-LABEL: setnbcr76:
1289 ; CHECK-BE: # %bb.0: # %entry
1290 ; CHECK-BE-NEXT: cmplw r3, r4
1291 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
1292 ; CHECK-BE-NEXT: setnbcr r3, gt
1293 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
1294 ; CHECK-BE-NEXT: blr
1296 %cmp = icmp ule i32 %a, %b
1297 %sub = sext i1 %cmp to i32
1298 store i32 %sub, ptr @globalVal2
1302 define i64 @setnbcr77(i64 %a, i64 %b) {
1303 ; CHECK-LABEL: setnbcr77:
1304 ; CHECK: # %bb.0: # %entry
1305 ; CHECK-NEXT: cmpld r3, r4
1306 ; CHECK-NEXT: setnbcr r3, gt
1309 %cmp = icmp ule i64 %a, %b
1310 %conv1 = sext i1 %cmp to i64
1314 define dso_local void @setnbcr78(i64 %a, i64 %b) {
1315 ; CHECK-LE-LABEL: setnbcr78:
1316 ; CHECK-LE: # %bb.0: # %entry
1317 ; CHECK-LE-NEXT: cmpld r3, r4
1318 ; CHECK-LE-NEXT: setnbcr r3, gt
1319 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
1320 ; CHECK-LE-NEXT: blr
1322 ; CHECK-BE-LABEL: setnbcr78:
1323 ; CHECK-BE: # %bb.0: # %entry
1324 ; CHECK-BE-NEXT: cmpld r3, r4
1325 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
1326 ; CHECK-BE-NEXT: setnbcr r3, gt
1327 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
1328 ; CHECK-BE-NEXT: blr
1330 %cmp = icmp ule i64 %a, %b
1331 %conv1 = sext i1 %cmp to i64
1332 store i64 %conv1, ptr @globalVal3
1336 define i64 @setnbcr79(i16 zeroext %a, i16 zeroext %b) {
1337 ; CHECK-LABEL: setnbcr79:
1338 ; CHECK: # %bb.0: # %entry
1339 ; CHECK-NEXT: cmplw r3, r4
1340 ; CHECK-NEXT: setnbcr r3, gt
1343 %cmp = icmp ule i16 %a, %b
1344 %conv3 = sext i1 %cmp to i64
1348 define dso_local void @setnbcr80(i16 zeroext %a, i16 zeroext %b) {
1349 ; CHECK-LE-LABEL: setnbcr80:
1350 ; CHECK-LE: # %bb.0: # %entry
1351 ; CHECK-LE-NEXT: cmplw r3, r4
1352 ; CHECK-LE-NEXT: setnbcr r3, gt
1353 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
1354 ; CHECK-LE-NEXT: blr
1356 ; CHECK-BE-LABEL: setnbcr80:
1357 ; CHECK-BE: # %bb.0: # %entry
1358 ; CHECK-BE-NEXT: cmplw r3, r4
1359 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
1360 ; CHECK-BE-NEXT: setnbcr r3, gt
1361 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
1362 ; CHECK-BE-NEXT: blr
1364 %cmp = icmp ule i16 %a, %b
1365 %conv3 = sext i1 %cmp to i16
1366 store i16 %conv3, ptr @globalVal4
1370 define i64 @setnbcr81(i64 %a, i64 %b) {
1371 ; CHECK-LABEL: setnbcr81:
1372 ; CHECK: # %bb.0: # %entry
1373 ; CHECK-NEXT: cmpd r3, r4
1374 ; CHECK-NEXT: setnbcr r3, eq
1377 %cmp = icmp ne i64 %a, %b
1378 %conv1 = sext i1 %cmp to i64
1382 define i64 @setnbcr82(i64 %a, i64 %b) {
1383 ; CHECK-LABEL: setnbcr82:
1384 ; CHECK: # %bb.0: # %entry
1385 ; CHECK-NEXT: cmpd r3, r4
1386 ; CHECK-NEXT: setnbcr r3, eq
1389 %cmp = icmp ne i64 %a, %b
1390 %conv1 = sext i1 %cmp to i64
1394 define dso_local void @setnbcr83(i64 %a, i64 %b) {
1395 ; CHECK-LE-LABEL: setnbcr83:
1396 ; CHECK-LE: # %bb.0: # %entry
1397 ; CHECK-LE-NEXT: cmpd r3, r4
1398 ; CHECK-LE-NEXT: setnbcr r3, eq
1399 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
1400 ; CHECK-LE-NEXT: blr
1402 ; CHECK-BE-LABEL: setnbcr83:
1403 ; CHECK-BE: # %bb.0: # %entry
1404 ; CHECK-BE-NEXT: cmpd r3, r4
1405 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
1406 ; CHECK-BE-NEXT: setnbcr r3, eq
1407 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
1408 ; CHECK-BE-NEXT: blr
1410 %cmp = icmp ne i64 %a, %b
1411 %conv1 = sext i1 %cmp to i64
1412 store i64 %conv1, ptr @globalVal3, align 8