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(i32 signext %a, i32 signext %b) {
21 ; CHECK-LABEL: setnbc1:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: cmpw r3, r4
24 ; CHECK-NEXT: setnbc r3, lt
27 %cmp = icmp slt i32 %a, %b
28 %conv = sext i1 %cmp to i32
32 define dso_local signext i32 @setnbc2(i32 signext %a, i32 signext %b) {
33 ; CHECK-LABEL: setnbc2:
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: cmpw r3, r4
36 ; CHECK-NEXT: setnbc r3, eq
39 %cmp = icmp eq i32 %a, %b
40 %conv = sext i1 %cmp to i32
44 define dso_local signext i32 @setnbc3(i32 signext %a, i32 signext %b) {
45 ; CHECK-LABEL: setnbc3:
46 ; CHECK: # %bb.0: # %entry
47 ; CHECK-NEXT: cmpw r3, r4
48 ; CHECK-NEXT: setnbc r3, gt
51 %cmp = icmp sgt i32 %a, %b
52 %conv = sext i1 %cmp to i32
56 define dso_local signext i32 @setnbc4(i8 signext %a, i8 signext %b) {
57 ; CHECK-LABEL: setnbc4:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: cmpw r3, r4
60 ; CHECK-NEXT: setnbc r3, eq
63 %cmp = icmp eq i8 %a, %b
64 %conv = sext i1 %cmp to i32
68 ; function attrs: norecurse nounwind
69 define dso_local void @setnbc5(i8 signext %a, i8 signext %b) {
70 ; CHECK-LE-LABEL: setnbc5:
71 ; CHECK-LE: # %bb.0: # %entry
72 ; CHECK-LE-NEXT: cmpw r3, r4
73 ; CHECK-LE-NEXT: setnbc r3, eq
74 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
77 ; CHECK-BE-LABEL: setnbc5:
78 ; CHECK-BE: # %bb.0: # %entry
79 ; CHECK-BE-NEXT: cmpw r3, r4
80 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
81 ; CHECK-BE-NEXT: setnbc r3, eq
82 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
85 %cmp = icmp eq i8 %a, %b
86 %conv3 = sext i1 %cmp to i8
87 store i8 %conv3, ptr @globalVal, align 1
91 define dso_local void @setnbc6(i32 signext %a, i32 signext %b) {
92 ; CHECK-LE-LABEL: setnbc6:
93 ; CHECK-LE: # %bb.0: # %entry
94 ; CHECK-LE-NEXT: cmpw r3, r4
95 ; CHECK-LE-NEXT: setnbc r3, eq
96 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
99 ; CHECK-BE-LABEL: setnbc6:
100 ; CHECK-BE: # %bb.0: # %entry
101 ; CHECK-BE-NEXT: cmpw r3, r4
102 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
103 ; CHECK-BE-NEXT: setnbc r3, eq
104 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
107 %cmp = icmp eq i32 %a, %b
108 %conv = sext i1 %cmp to i32
109 store i32 %conv, ptr @globalVal2, align 4
113 define dso_local signext i32 @setnbc7(i64 %a, i64 %b) {
114 ; CHECK-LABEL: setnbc7:
115 ; CHECK: # %bb.0: # %entry
116 ; CHECK-NEXT: cmpd r3, r4
117 ; CHECK-NEXT: setnbc r3, eq
120 %cmp = icmp eq i64 %a, %b
121 %conv = sext i1 %cmp to i32
125 define signext i64 @setnbc8(i64 %a, i64 %b) {
126 ; CHECK-LABEL: setnbc8:
127 ; CHECK: # %bb.0: # %entry
128 ; CHECK-NEXT: cmpd r3, r4
129 ; CHECK-NEXT: setnbc r3, eq
132 %cmp = icmp eq i64 %a, %b
133 %conv = sext i1 %cmp to i64
137 define dso_local void @setnbc9(i64 %a, i64 %b) {
138 ; CHECK-LE-LABEL: setnbc9:
139 ; CHECK-LE: # %bb.0: # %entry
140 ; CHECK-LE-NEXT: cmpd r3, r4
141 ; CHECK-LE-NEXT: setnbc r3, eq
142 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
145 ; CHECK-BE-LABEL: setnbc9:
146 ; CHECK-BE: # %bb.0: # %entry
147 ; CHECK-BE-NEXT: cmpd r3, r4
148 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
149 ; CHECK-BE-NEXT: setnbc r3, eq
150 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
153 %cmp = icmp eq i64 %a, %b
154 %conv1 = sext i1 %cmp to i64
155 store i64 %conv1, ptr @globalVal3, align 8
159 define dso_local signext i32 @setnbc10(i16 signext %a, i16 signext %b) {
160 ; CHECK-LABEL: setnbc10:
161 ; CHECK: # %bb.0: # %entry
162 ; CHECK-NEXT: cmpw r3, r4
163 ; CHECK-NEXT: setnbc r3, eq
166 %cmp = icmp eq i16 %a, %b
167 %conv = sext i1 %cmp to i32
171 define dso_local void @setnbc11(i16 signext %a, i16 signext %b) {
172 ; CHECK-LE-LABEL: setnbc11:
173 ; CHECK-LE: # %bb.0: # %entry
174 ; CHECK-LE-NEXT: cmpw r3, r4
175 ; CHECK-LE-NEXT: setnbc r3, eq
176 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
179 ; CHECK-BE-LABEL: setnbc11:
180 ; CHECK-BE: # %bb.0: # %entry
181 ; CHECK-BE-NEXT: cmpw r3, r4
182 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
183 ; CHECK-BE-NEXT: setnbc r3, eq
184 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
187 %cmp = icmp eq i16 %a, %b
188 %conv3 = sext i1 %cmp to i16
189 store i16 %conv3, ptr @globalVal4, align 2
193 define dso_local signext i32 @setnbc12(i8 zeroext %a, i8 zeroext %b) {
194 ; CHECK-LABEL: setnbc12:
195 ; CHECK: # %bb.0: # %entry
196 ; CHECK-NEXT: cmpw r3, r4
197 ; CHECK-NEXT: setnbc r3, eq
200 %cmp = icmp eq i8 %a, %b
201 %conv = sext i1 %cmp to i32
205 define dso_local void @setnbc13(i8 zeroext %a, i8 zeroext %b) {
206 ; CHECK-LE-LABEL: setnbc13:
207 ; CHECK-LE: # %bb.0: # %entry
208 ; CHECK-LE-NEXT: cmpw r3, r4
209 ; CHECK-LE-NEXT: setnbc r3, eq
210 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
213 ; CHECK-BE-LABEL: setnbc13:
214 ; CHECK-BE: # %bb.0: # %entry
215 ; CHECK-BE-NEXT: cmpw r3, r4
216 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
217 ; CHECK-BE-NEXT: setnbc r3, eq
218 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
221 %cmp = icmp eq i8 %a, %b
222 %conv3 = sext i1 %cmp to i8
223 store i8 %conv3, ptr @globalVal, align 1
227 define dso_local signext i32 @setnbc14(i32 zeroext %a, i32 zeroext %b) {
228 ; CHECK-LABEL: setnbc14:
229 ; CHECK: # %bb.0: # %entry
230 ; CHECK-NEXT: cmpw r3, r4
231 ; CHECK-NEXT: setnbc r3, eq
234 %cmp = icmp eq i32 %a, %b
235 %conv = sext i1 %cmp to i32
239 define dso_local void @setnbc15(i32 zeroext %a, i32 zeroext %b) {
240 ; CHECK-LE-LABEL: setnbc15:
241 ; CHECK-LE: # %bb.0: # %entry
242 ; CHECK-LE-NEXT: cmpw r3, r4
243 ; CHECK-LE-NEXT: setnbc r3, eq
244 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
247 ; CHECK-BE-LABEL: setnbc15:
248 ; CHECK-BE: # %bb.0: # %entry
249 ; CHECK-BE-NEXT: cmpw r3, r4
250 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
251 ; CHECK-BE-NEXT: setnbc r3, eq
252 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
255 %cmp = icmp eq i32 %a, %b
256 %conv = sext i1 %cmp to i32
257 store i32 %conv, ptr @globalVal2, align 4
261 define dso_local signext i32 @setnbc16(i16 zeroext %a, i16 zeroext %b) {
262 ; CHECK-LABEL: setnbc16:
263 ; CHECK: # %bb.0: # %entry
264 ; CHECK-NEXT: cmpw r3, r4
265 ; CHECK-NEXT: setnbc r3, eq
268 %cmp = icmp eq i16 %a, %b
269 %conv = sext i1 %cmp to i32
273 define dso_local void @setnbc17(i16 zeroext %a, i16 zeroext %b) {
274 ; CHECK-LE-LABEL: setnbc17:
275 ; CHECK-LE: # %bb.0: # %entry
276 ; CHECK-LE-NEXT: cmpw r3, r4
277 ; CHECK-LE-NEXT: setnbc r3, eq
278 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
281 ; CHECK-BE-LABEL: setnbc17:
282 ; CHECK-BE: # %bb.0: # %entry
283 ; CHECK-BE-NEXT: cmpw r3, r4
284 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
285 ; CHECK-BE-NEXT: setnbc r3, eq
286 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
289 %cmp = icmp eq i16 %a, %b
290 %conv3 = sext i1 %cmp to i16
291 store i16 %conv3, ptr @globalVal4, align 2
295 define dso_local signext i32 @setnbc18(i8 signext %a, i8 signext %b) {
296 ; CHECK-LABEL: setnbc18:
297 ; CHECK: # %bb.0: # %entry
298 ; CHECK-NEXT: cmpw r3, r4
299 ; CHECK-NEXT: setnbc r3, gt
302 %cmp = icmp sgt i8 %a, %b
303 %sub = sext i1 %cmp to i32
307 define dso_local void @setnbc19(i8 signext %a, i8 signext %b) {
308 ; CHECK-LE-LABEL: setnbc19:
309 ; CHECK-LE: # %bb.0: # %entry
310 ; CHECK-LE-NEXT: cmpw r3, r4
311 ; CHECK-LE-NEXT: setnbc r3, gt
312 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
315 ; CHECK-BE-LABEL: setnbc19:
316 ; CHECK-BE: # %bb.0: # %entry
317 ; CHECK-BE-NEXT: cmpw r3, r4
318 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
319 ; CHECK-BE-NEXT: setnbc r3, gt
320 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
323 %cmp = icmp sgt i8 %a, %b
324 %conv3 = sext i1 %cmp to i8
325 store i8 %conv3, ptr @globalVal, align 1
329 define dso_local void @setnbc20(i32 signext %a, i32 signext %b) {
330 ; CHECK-LE-LABEL: setnbc20:
331 ; CHECK-LE: # %bb.0: # %entry
332 ; CHECK-LE-NEXT: cmpw r3, r4
333 ; CHECK-LE-NEXT: setnbc r3, gt
334 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
337 ; CHECK-BE-LABEL: setnbc20:
338 ; CHECK-BE: # %bb.0: # %entry
339 ; CHECK-BE-NEXT: cmpw r3, r4
340 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
341 ; CHECK-BE-NEXT: setnbc r3, gt
342 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
345 %cmp = icmp sgt i32 %a, %b
346 %sub = sext i1 %cmp to i32
347 store i32 %sub, ptr @globalVal2, align 4
351 define dso_local signext i32 @setnbc21(i64 %a, i64 %b) {
352 ; CHECK-LABEL: setnbc21:
353 ; CHECK: # %bb.0: # %entry
354 ; CHECK-NEXT: cmpd r3, r4
355 ; CHECK-NEXT: setnbc r3, gt
358 %cmp = icmp sgt i64 %a, %b
359 %sub = sext i1 %cmp to i32
363 define dso_local void @setnbc22(i64 %a, i64 %b) {
364 ; CHECK-LE-LABEL: setnbc22:
365 ; CHECK-LE: # %bb.0: # %entry
366 ; CHECK-LE-NEXT: cmpd r3, r4
367 ; CHECK-LE-NEXT: setnbc r3, gt
368 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
371 ; CHECK-BE-LABEL: setnbc22:
372 ; CHECK-BE: # %bb.0: # %entry
373 ; CHECK-BE-NEXT: cmpd r3, r4
374 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
375 ; CHECK-BE-NEXT: setnbc r3, gt
376 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
379 %cmp = icmp sgt i64 %a, %b
380 %conv1 = sext i1 %cmp to i64
381 store i64 %conv1, ptr @globalVal3, align 8
385 define dso_local signext i32 @setnbc23(i16 signext %a, i16 signext %b) {
386 ; CHECK-LABEL: setnbc23:
387 ; CHECK: # %bb.0: # %entry
388 ; CHECK-NEXT: cmpw r3, r4
389 ; CHECK-NEXT: setnbc r3, gt
392 %cmp = icmp sgt i16 %a, %b
393 %sub = sext i1 %cmp to i32
397 define dso_local void @setnbc24(i16 signext %a, i16 signext %b) {
398 ; CHECK-LE-LABEL: setnbc24:
399 ; CHECK-LE: # %bb.0: # %entry
400 ; CHECK-LE-NEXT: cmpw r3, r4
401 ; CHECK-LE-NEXT: setnbc r3, gt
402 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
405 ; CHECK-BE-LABEL: setnbc24:
406 ; CHECK-BE: # %bb.0: # %entry
407 ; CHECK-BE-NEXT: cmpw r3, r4
408 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
409 ; CHECK-BE-NEXT: setnbc r3, gt
410 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
413 %cmp = icmp sgt i16 %a, %b
414 %conv3 = sext i1 %cmp to i16
415 store i16 %conv3, ptr @globalVal4, align 2
419 define dso_local signext i32 @setnbc25(i8 zeroext %a, i8 zeroext %b) {
420 ; CHECK-LABEL: setnbc25:
421 ; CHECK: # %bb.0: # %entry
422 ; CHECK-NEXT: cmplw r3, r4
423 ; CHECK-NEXT: setnbc r3, gt
426 %cmp = icmp ugt i8 %a, %b
427 %sub = sext i1 %cmp to i32
431 define dso_local void @setnbc26(i8 zeroext %a, i8 zeroext %b) {
432 ; CHECK-LE-LABEL: setnbc26:
433 ; CHECK-LE: # %bb.0: # %entry
434 ; CHECK-LE-NEXT: cmplw r3, r4
435 ; CHECK-LE-NEXT: setnbc r3, gt
436 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
439 ; CHECK-BE-LABEL: setnbc26:
440 ; CHECK-BE: # %bb.0: # %entry
441 ; CHECK-BE-NEXT: cmplw r3, r4
442 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
443 ; CHECK-BE-NEXT: setnbc r3, gt
444 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
447 %cmp = icmp ugt i8 %a, %b
448 %conv3 = sext i1 %cmp to i8
449 store i8 %conv3, ptr @globalVal, align 1
453 define dso_local signext i32 @setnbc27(i32 zeroext %a, i32 zeroext %b) {
454 ; CHECK-LABEL: setnbc27:
455 ; CHECK: # %bb.0: # %entry
456 ; CHECK-NEXT: cmplw r3, r4
457 ; CHECK-NEXT: setnbc r3, gt
460 %cmp = icmp ugt i32 %a, %b
461 %sub = sext i1 %cmp to i32
465 define dso_local void @setnbc28(i32 zeroext %a, i32 zeroext %b) {
466 ; CHECK-LE-LABEL: setnbc28:
467 ; CHECK-LE: # %bb.0: # %entry
468 ; CHECK-LE-NEXT: cmplw r3, r4
469 ; CHECK-LE-NEXT: setnbc r3, gt
470 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
473 ; CHECK-BE-LABEL: setnbc28:
474 ; CHECK-BE: # %bb.0: # %entry
475 ; CHECK-BE-NEXT: cmplw r3, r4
476 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
477 ; CHECK-BE-NEXT: setnbc r3, gt
478 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
481 %cmp = icmp ugt i32 %a, %b
482 %sub = sext i1 %cmp to i32
483 store i32 %sub, ptr @globalVal2, align 4
487 define dso_local signext i32 @setnbc29(i16 zeroext %a, i16 zeroext %b) {
488 ; CHECK-LABEL: setnbc29:
489 ; CHECK: # %bb.0: # %entry
490 ; CHECK-NEXT: cmplw r3, r4
491 ; CHECK-NEXT: setnbc r3, gt
494 %cmp = icmp ugt i16 %a, %b
495 %sub = sext i1 %cmp to i32
499 define dso_local void @setnbc30(i16 zeroext %a, i16 zeroext %b) {
500 ; CHECK-LE-LABEL: setnbc30:
501 ; CHECK-LE: # %bb.0: # %entry
502 ; CHECK-LE-NEXT: cmplw r3, r4
503 ; CHECK-LE-NEXT: setnbc r3, gt
504 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
507 ; CHECK-BE-LABEL: setnbc30:
508 ; CHECK-BE: # %bb.0: # %entry
509 ; CHECK-BE-NEXT: cmplw r3, r4
510 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
511 ; CHECK-BE-NEXT: setnbc r3, gt
512 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
515 %cmp = icmp ugt i16 %a, %b
516 %conv3 = sext i1 %cmp to i16
517 store i16 %conv3, ptr @globalVal4, align 2
521 define dso_local signext i32 @setnbc31(i8 signext %a, i8 signext %b) {
522 ; CHECK-LABEL: setnbc31:
523 ; CHECK: # %bb.0: # %entry
524 ; CHECK-NEXT: cmpw r3, r4
525 ; CHECK-NEXT: setnbc r3, lt
528 %cmp = icmp slt i8 %a, %b
529 %sub = sext i1 %cmp to i32
533 define dso_local void @setnbc32(i8 signext %a, i8 signext %b) {
534 ; CHECK-LE-LABEL: setnbc32:
535 ; CHECK-LE: # %bb.0: # %entry
536 ; CHECK-LE-NEXT: cmpw r3, r4
537 ; CHECK-LE-NEXT: setnbc r3, lt
538 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
541 ; CHECK-BE-LABEL: setnbc32:
542 ; CHECK-BE: # %bb.0: # %entry
543 ; CHECK-BE-NEXT: cmpw r3, r4
544 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
545 ; CHECK-BE-NEXT: setnbc r3, lt
546 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
549 %cmp = icmp slt i8 %a, %b
550 %conv3 = sext i1 %cmp to i8
551 store i8 %conv3, ptr @globalVal, align 1
555 define dso_local void @setnbc33(i32 signext %a, i32 signext %b) {
556 ; CHECK-LE-LABEL: setnbc33:
557 ; CHECK-LE: # %bb.0: # %entry
558 ; CHECK-LE-NEXT: cmpw r3, r4
559 ; CHECK-LE-NEXT: setnbc r3, lt
560 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
563 ; CHECK-BE-LABEL: setnbc33:
564 ; CHECK-BE: # %bb.0: # %entry
565 ; CHECK-BE-NEXT: cmpw r3, r4
566 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
567 ; CHECK-BE-NEXT: setnbc r3, lt
568 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
571 %cmp = icmp slt i32 %a, %b
572 %sub = sext i1 %cmp to i32
573 store i32 %sub, ptr @globalVal2, align 4
577 define dso_local signext i32 @setnbc34(i64 %a, i64 %b) {
578 ; CHECK-LABEL: setnbc34:
579 ; CHECK: # %bb.0: # %entry
580 ; CHECK-NEXT: cmpd r3, r4
581 ; CHECK-NEXT: setnbc r3, lt
584 %cmp = icmp slt i64 %a, %b
585 %sub = sext i1 %cmp to i32
589 define signext i64 @setnbc35(i64 %a, i64 %b) {
590 ; CHECK-LABEL: setnbc35:
591 ; CHECK: # %bb.0: # %entry
592 ; CHECK-NEXT: cmpd r3, r4
593 ; CHECK-NEXT: setnbc r3, lt
596 %cmp = icmp slt i64 %a, %b
597 %sub = sext i1 %cmp to i64
601 define dso_local void @setnbc36(i64 %a, i64 %b) {
602 ; CHECK-LE-LABEL: setnbc36:
603 ; CHECK-LE: # %bb.0: # %entry
604 ; CHECK-LE-NEXT: cmpd r3, r4
605 ; CHECK-LE-NEXT: setnbc r3, lt
606 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
609 ; CHECK-BE-LABEL: setnbc36:
610 ; CHECK-BE: # %bb.0: # %entry
611 ; CHECK-BE-NEXT: cmpd r3, r4
612 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
613 ; CHECK-BE-NEXT: setnbc r3, lt
614 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
617 %cmp = icmp slt i64 %a, %b
618 %conv1 = sext i1 %cmp to i64
619 store i64 %conv1, ptr @globalVal3, align 8
623 define dso_local signext i32 @setnbc37(i16 signext %a, i16 signext %b) {
624 ; CHECK-LABEL: setnbc37:
625 ; CHECK: # %bb.0: # %entry
626 ; CHECK-NEXT: cmpw r3, r4
627 ; CHECK-NEXT: setnbc r3, lt
630 %cmp = icmp slt i16 %a, %b
631 %sub = sext i1 %cmp to i32
635 define dso_local void @setnbc38(i16 signext %a, i16 signext %b) {
636 ; CHECK-LE-LABEL: setnbc38:
637 ; CHECK-LE: # %bb.0: # %entry
638 ; CHECK-LE-NEXT: cmpw r3, r4
639 ; CHECK-LE-NEXT: setnbc r3, lt
640 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
643 ; CHECK-BE-LABEL: setnbc38:
644 ; CHECK-BE: # %bb.0: # %entry
645 ; CHECK-BE-NEXT: cmpw r3, r4
646 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
647 ; CHECK-BE-NEXT: setnbc r3, lt
648 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
651 %cmp = icmp slt i16 %a, %b
652 %conv3 = sext i1 %cmp to i16
653 store i16 %conv3, ptr @globalVal4, align 2
657 define dso_local signext i32 @setnbc39(i8 zeroext %a, i8 zeroext %b) {
658 ; CHECK-LABEL: setnbc39:
659 ; CHECK: # %bb.0: # %entry
660 ; CHECK-NEXT: cmplw r3, r4
661 ; CHECK-NEXT: setnbc r3, lt
664 %cmp = icmp ult i8 %a, %b
665 %sub = sext i1 %cmp to i32
669 define dso_local void @setnbc40(i8 zeroext %a, i8 zeroext %b) {
670 ; CHECK-LE-LABEL: setnbc40:
671 ; CHECK-LE: # %bb.0: # %entry
672 ; CHECK-LE-NEXT: cmplw r3, r4
673 ; CHECK-LE-NEXT: setnbc r3, lt
674 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
677 ; CHECK-BE-LABEL: setnbc40:
678 ; CHECK-BE: # %bb.0: # %entry
679 ; CHECK-BE-NEXT: cmplw r3, r4
680 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
681 ; CHECK-BE-NEXT: setnbc r3, lt
682 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
685 %cmp = icmp ult i8 %a, %b
686 %conv3 = sext i1 %cmp to i8
687 store i8 %conv3, ptr @globalVal, align 1
691 define dso_local signext i32 @setnbc41(i32 zeroext %a, i32 zeroext %b) {
692 ; CHECK-LABEL: setnbc41:
693 ; CHECK: # %bb.0: # %entry
694 ; CHECK-NEXT: cmplw r3, r4
695 ; CHECK-NEXT: setnbc r3, lt
698 %cmp = icmp ult i32 %a, %b
699 %sub = sext i1 %cmp to i32
703 define dso_local void @setnbc42(i32 zeroext %a, i32 zeroext %b) {
704 ; CHECK-LE-LABEL: setnbc42:
705 ; CHECK-LE: # %bb.0: # %entry
706 ; CHECK-LE-NEXT: cmplw r3, r4
707 ; CHECK-LE-NEXT: setnbc r3, lt
708 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
711 ; CHECK-BE-LABEL: setnbc42:
712 ; CHECK-BE: # %bb.0: # %entry
713 ; CHECK-BE-NEXT: cmplw r3, r4
714 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
715 ; CHECK-BE-NEXT: setnbc r3, lt
716 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
719 %cmp = icmp ult i32 %a, %b
720 %sub = sext i1 %cmp to i32
721 store i32 %sub, ptr @globalVal2, align 4
725 define dso_local signext i32 @setnbc43(i16 zeroext %a, i16 zeroext %b) {
726 ; CHECK-LABEL: setnbc43:
727 ; CHECK: # %bb.0: # %entry
728 ; CHECK-NEXT: cmplw r3, r4
729 ; CHECK-NEXT: setnbc r3, lt
732 %cmp = icmp ult i16 %a, %b
733 %sub = sext i1 %cmp to i32
737 define dso_local void @setnbc44(i16 zeroext %a, i16 zeroext %b) {
738 ; CHECK-LE-LABEL: setnbc44:
739 ; CHECK-LE: # %bb.0: # %entry
740 ; CHECK-LE-NEXT: cmplw r3, r4
741 ; CHECK-LE-NEXT: setnbc r3, lt
742 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
745 ; CHECK-BE-LABEL: setnbc44:
746 ; CHECK-BE: # %bb.0: # %entry
747 ; CHECK-BE-NEXT: cmplw r3, r4
748 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
749 ; CHECK-BE-NEXT: setnbc r3, lt
750 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
753 %cmp = icmp ult i16 %a, %b
754 %conv3 = sext i1 %cmp to i16
755 store i16 %conv3, ptr @globalVal4, align 2
759 define i64 @setnbc45(i8 signext %a, i8 signext %b) {
760 ; CHECK-LABEL: setnbc45:
761 ; CHECK: # %bb.0: # %entry
762 ; CHECK-NEXT: cmpw r3, r4
763 ; CHECK-NEXT: setnbc r3, eq
766 %cmp = icmp eq i8 %a, %b
767 %conv3 = sext i1 %cmp to i64
771 define dso_local void @setnbc46(i8 signext %a, i8 signext %b) {
772 ; CHECK-LE-LABEL: setnbc46:
773 ; CHECK-LE: # %bb.0: # %entry
774 ; CHECK-LE-NEXT: cmpw r3, r4
775 ; CHECK-LE-NEXT: setnbc r3, eq
776 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
779 ; CHECK-BE-LABEL: setnbc46:
780 ; CHECK-BE: # %bb.0: # %entry
781 ; CHECK-BE-NEXT: cmpw r3, r4
782 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
783 ; CHECK-BE-NEXT: setnbc r3, eq
784 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
787 %cmp = icmp eq i8 %a, %b
788 %conv3 = sext i1 %cmp to i8
789 store i8 %conv3, ptr @globalVal, align 1
793 define i64 @setnbc47(i32 signext %a, i32 signext %b) {
794 ; CHECK-LABEL: setnbc47:
795 ; CHECK: # %bb.0: # %entry
796 ; CHECK-NEXT: cmpw r3, r4
797 ; CHECK-NEXT: setnbc r3, eq
800 %cmp = icmp eq i32 %a, %b
801 %conv1 = sext i1 %cmp to i64
805 define dso_local void @setnbc48(i32 signext %a, i32 signext %b) {
806 ; CHECK-LE-LABEL: setnbc48:
807 ; CHECK-LE: # %bb.0: # %entry
808 ; CHECK-LE-NEXT: cmpw r3, r4
809 ; CHECK-LE-NEXT: setnbc r3, eq
810 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
813 ; CHECK-BE-LABEL: setnbc48:
814 ; CHECK-BE: # %bb.0: # %entry
815 ; CHECK-BE-NEXT: cmpw r3, r4
816 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
817 ; CHECK-BE-NEXT: setnbc r3, eq
818 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
821 %cmp = icmp eq i32 %a, %b
822 %sub = sext i1 %cmp to i32
823 store i32 %sub, ptr @globalVal2, align 4
827 define dso_local void @setnbc49(i64 %a, i64 %b) {
828 ; CHECK-LE-LABEL: setnbc49:
829 ; CHECK-LE: # %bb.0: # %entry
830 ; CHECK-LE-NEXT: cmpd r3, r4
831 ; CHECK-LE-NEXT: setnbc r3, eq
832 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
835 ; CHECK-BE-LABEL: setnbc49:
836 ; CHECK-BE: # %bb.0: # %entry
837 ; CHECK-BE-NEXT: cmpd r3, r4
838 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
839 ; CHECK-BE-NEXT: setnbc r3, eq
840 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
843 %cmp = icmp eq i64 %a, %b
844 %conv1 = sext i1 %cmp to i64
845 store i64 %conv1, ptr @globalVal3, align 8
849 define i64 @setnbc50(i16 signext %a, i16 signext %b) {
850 ; CHECK-LABEL: setnbc50:
851 ; CHECK: # %bb.0: # %entry
852 ; CHECK-NEXT: cmpw r3, r4
853 ; CHECK-NEXT: setnbc r3, eq
856 %cmp = icmp eq i16 %a, %b
857 %conv3 = sext i1 %cmp to i64
861 define dso_local void @setnbc51(i16 signext %a, i16 signext %b) {
862 ; CHECK-LE-LABEL: setnbc51:
863 ; CHECK-LE: # %bb.0: # %entry
864 ; CHECK-LE-NEXT: cmpw r3, r4
865 ; CHECK-LE-NEXT: setnbc r3, eq
866 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
869 ; CHECK-BE-LABEL: setnbc51:
870 ; CHECK-BE: # %bb.0: # %entry
871 ; CHECK-BE-NEXT: cmpw r3, r4
872 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
873 ; CHECK-BE-NEXT: setnbc r3, eq
874 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
877 %cmp = icmp eq i16 %a, %b
878 %conv3 = sext i1 %cmp to i16
879 store i16 %conv3, ptr @globalVal4, align 2
883 define i64 @setnbc52(i8 zeroext %a, i8 zeroext %b) {
884 ; CHECK-LABEL: setnbc52:
885 ; CHECK: # %bb.0: # %entry
886 ; CHECK-NEXT: cmpw r3, r4
887 ; CHECK-NEXT: setnbc r3, eq
890 %cmp = icmp eq i8 %a, %b
891 %conv3 = sext i1 %cmp to i64
895 define dso_local void @setnbc53(i8 zeroext %a, i8 zeroext %b) {
896 ; CHECK-LE-LABEL: setnbc53:
897 ; CHECK-LE: # %bb.0: # %entry
898 ; CHECK-LE-NEXT: cmpw r3, r4
899 ; CHECK-LE-NEXT: setnbc r3, eq
900 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
903 ; CHECK-BE-LABEL: setnbc53:
904 ; CHECK-BE: # %bb.0: # %entry
905 ; CHECK-BE-NEXT: cmpw r3, r4
906 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
907 ; CHECK-BE-NEXT: setnbc r3, eq
908 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
911 %cmp = icmp eq i8 %a, %b
912 %conv3 = sext i1 %cmp to i8
913 store i8 %conv3, ptr @globalVal, align 1
917 define i64 @setnbc54(i32 zeroext %a, i32 zeroext %b) {
918 ; CHECK-LABEL: setnbc54:
919 ; CHECK: # %bb.0: # %entry
920 ; CHECK-NEXT: cmpw r3, r4
921 ; CHECK-NEXT: setnbc r3, eq
924 %cmp = icmp eq i32 %a, %b
925 %conv1 = sext i1 %cmp to i64
929 define dso_local void @setnbc55(i32 zeroext %a, i32 zeroext %b) {
930 ; CHECK-LE-LABEL: setnbc55:
931 ; CHECK-LE: # %bb.0: # %entry
932 ; CHECK-LE-NEXT: cmpw r3, r4
933 ; CHECK-LE-NEXT: setnbc r3, eq
934 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
937 ; CHECK-BE-LABEL: setnbc55:
938 ; CHECK-BE: # %bb.0: # %entry
939 ; CHECK-BE-NEXT: cmpw r3, r4
940 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
941 ; CHECK-BE-NEXT: setnbc r3, eq
942 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
945 %cmp = icmp eq i32 %a, %b
946 %sub = sext i1 %cmp to i32
947 store i32 %sub, ptr @globalVal2, align 4
951 define i64 @setnbc56(i64 %a, i64 %b) {
952 ; CHECK-LABEL: setnbc56:
953 ; CHECK: # %bb.0: # %entry
954 ; CHECK-NEXT: cmpd r3, r4
955 ; CHECK-NEXT: setnbc r3, eq
958 %cmp = icmp eq i64 %a, %b
959 %conv1 = sext i1 %cmp to i64
963 define dso_local void @setnbc57(i64 %a, i64 %b) {
964 ; CHECK-LE-LABEL: setnbc57:
965 ; CHECK-LE: # %bb.0: # %entry
966 ; CHECK-LE-NEXT: cmpd r3, r4
967 ; CHECK-LE-NEXT: setnbc r3, eq
968 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
971 ; CHECK-BE-LABEL: setnbc57:
972 ; CHECK-BE: # %bb.0: # %entry
973 ; CHECK-BE-NEXT: cmpd r3, r4
974 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
975 ; CHECK-BE-NEXT: setnbc r3, eq
976 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
979 %cmp = icmp eq i64 %a, %b
980 %conv1 = sext i1 %cmp to i64
981 store i64 %conv1, ptr @globalVal3, align 8
985 define i64 @setnbc58(i16 zeroext %a, i16 zeroext %b) {
986 ; CHECK-LABEL: setnbc58:
987 ; CHECK: # %bb.0: # %entry
988 ; CHECK-NEXT: cmpw r3, r4
989 ; CHECK-NEXT: setnbc r3, eq
992 %cmp = icmp eq i16 %a, %b
993 %conv3 = sext i1 %cmp to i64
997 define dso_local void @setnbc59(i16 zeroext %a, i16 zeroext %b) {
998 ; CHECK-LE-LABEL: setnbc59:
999 ; CHECK-LE: # %bb.0: # %entry
1000 ; CHECK-LE-NEXT: cmpw r3, r4
1001 ; CHECK-LE-NEXT: setnbc r3, eq
1002 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
1003 ; CHECK-LE-NEXT: blr
1005 ; CHECK-BE-LABEL: setnbc59:
1006 ; CHECK-BE: # %bb.0: # %entry
1007 ; CHECK-BE-NEXT: cmpw r3, r4
1008 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
1009 ; CHECK-BE-NEXT: setnbc r3, eq
1010 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
1011 ; CHECK-BE-NEXT: blr
1013 %cmp = icmp eq i16 %a, %b
1014 %conv3 = sext i1 %cmp to i16
1015 store i16 %conv3, ptr @globalVal4, align 2
1019 define i64 @setnbc60(i64 %a, i64 %b) {
1020 ; CHECK-LABEL: setnbc60:
1021 ; CHECK: # %bb.0: # %entry
1022 ; CHECK-NEXT: cmpd r3, r4
1023 ; CHECK-NEXT: setnbc r3, gt
1026 %cmp = icmp sgt i64 %a, %b
1027 %conv1 = sext i1 %cmp to i64
1031 define dso_local void @setnbc61(i64 %a, i64 %b) {
1032 ; CHECK-LE-LABEL: setnbc61:
1033 ; CHECK-LE: # %bb.0: # %entry
1034 ; CHECK-LE-NEXT: cmpd r3, r4
1035 ; CHECK-LE-NEXT: setnbc r3, gt
1036 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
1037 ; CHECK-LE-NEXT: blr
1039 ; CHECK-BE-LABEL: setnbc61:
1040 ; CHECK-BE: # %bb.0: # %entry
1041 ; CHECK-BE-NEXT: cmpd r3, r4
1042 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
1043 ; CHECK-BE-NEXT: setnbc r3, gt
1044 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
1045 ; CHECK-BE-NEXT: blr
1047 %cmp = icmp sgt i64 %a, %b
1048 %conv1 = sext i1 %cmp to i64
1049 store i64 %conv1, ptr @globalVal3, align 8
1053 define i64 @setnbc62(i8 zeroext %a, i8 zeroext %b) {
1054 ; CHECK-LABEL: setnbc62:
1055 ; CHECK: # %bb.0: # %entry
1056 ; CHECK-NEXT: cmplw r3, r4
1057 ; CHECK-NEXT: setnbc r3, gt
1060 %cmp = icmp ugt i8 %a, %b
1061 %conv3 = sext i1 %cmp to i64
1065 define dso_local void @setnbc63(i8 zeroext %a, i8 zeroext %b) {
1066 ; CHECK-LE-LABEL: setnbc63:
1067 ; CHECK-LE: # %bb.0: # %entry
1068 ; CHECK-LE-NEXT: cmplw r3, r4
1069 ; CHECK-LE-NEXT: setnbc r3, gt
1070 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
1071 ; CHECK-LE-NEXT: blr
1073 ; CHECK-BE-LABEL: setnbc63:
1074 ; CHECK-BE: # %bb.0: # %entry
1075 ; CHECK-BE-NEXT: cmplw r3, r4
1076 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
1077 ; CHECK-BE-NEXT: setnbc r3, gt
1078 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
1079 ; CHECK-BE-NEXT: blr
1081 %cmp = icmp ugt i8 %a, %b
1082 %conv3 = sext i1 %cmp to i8
1083 store i8 %conv3, ptr @globalVal, align 1
1087 define i64 @setnbc64(i32 zeroext %a, i32 zeroext %b) {
1088 ; CHECK-LABEL: setnbc64:
1089 ; CHECK: # %bb.0: # %entry
1090 ; CHECK-NEXT: cmplw r3, r4
1091 ; CHECK-NEXT: setnbc r3, gt
1094 %cmp = icmp ugt i32 %a, %b
1095 %conv1 = sext i1 %cmp to i64
1099 define dso_local void @setnbc65(i32 zeroext %a, i32 zeroext %b) {
1100 ; CHECK-LE-LABEL: setnbc65:
1101 ; CHECK-LE: # %bb.0: # %entry
1102 ; CHECK-LE-NEXT: cmplw r3, r4
1103 ; CHECK-LE-NEXT: setnbc r3, gt
1104 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
1105 ; CHECK-LE-NEXT: blr
1107 ; CHECK-BE-LABEL: setnbc65:
1108 ; CHECK-BE: # %bb.0: # %entry
1109 ; CHECK-BE-NEXT: cmplw r3, r4
1110 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
1111 ; CHECK-BE-NEXT: setnbc r3, gt
1112 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
1113 ; CHECK-BE-NEXT: blr
1115 %cmp = icmp ugt i32 %a, %b
1116 %sub = sext i1 %cmp to i32
1117 store i32 %sub, ptr @globalVal2, align 4
1121 define i64 @setnbc66(i16 zeroext %a, i16 zeroext %b) {
1122 ; CHECK-LABEL: setnbc66:
1123 ; CHECK: # %bb.0: # %entry
1124 ; CHECK-NEXT: cmplw r3, r4
1125 ; CHECK-NEXT: setnbc r3, gt
1128 %cmp = icmp ugt i16 %a, %b
1129 %conv3 = sext i1 %cmp to i64
1133 define dso_local void @setnbc67(i16 zeroext %a, i16 zeroext %b) {
1134 ; CHECK-LE-LABEL: setnbc67:
1135 ; CHECK-LE: # %bb.0: # %entry
1136 ; CHECK-LE-NEXT: cmplw r3, r4
1137 ; CHECK-LE-NEXT: setnbc r3, gt
1138 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
1139 ; CHECK-LE-NEXT: blr
1141 ; CHECK-BE-LABEL: setnbc67:
1142 ; CHECK-BE: # %bb.0: # %entry
1143 ; CHECK-BE-NEXT: cmplw r3, r4
1144 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
1145 ; CHECK-BE-NEXT: setnbc r3, gt
1146 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
1147 ; CHECK-BE-NEXT: blr
1149 %cmp = icmp ugt i16 %a, %b
1150 %conv3 = sext i1 %cmp to i16
1151 store i16 %conv3, ptr @globalVal4, align 2
1155 define i64 @setnbc68(i64 %a, i64 %b) {
1156 ; CHECK-LABEL: setnbc68:
1157 ; CHECK: # %bb.0: # %entry
1158 ; CHECK-NEXT: cmpd r3, r4
1159 ; CHECK-NEXT: setnbc r3, lt
1162 %cmp = icmp slt i64 %a, %b
1163 %conv1 = sext i1 %cmp to i64
1167 define dso_local void @setnbc69(i64 %a, i64 %b) {
1168 ; CHECK-LE-LABEL: setnbc69:
1169 ; CHECK-LE: # %bb.0: # %entry
1170 ; CHECK-LE-NEXT: cmpd r3, r4
1171 ; CHECK-LE-NEXT: setnbc r3, lt
1172 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
1173 ; CHECK-LE-NEXT: blr
1175 ; CHECK-BE-LABEL: setnbc69:
1176 ; CHECK-BE: # %bb.0: # %entry
1177 ; CHECK-BE-NEXT: cmpd r3, r4
1178 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
1179 ; CHECK-BE-NEXT: setnbc r3, lt
1180 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
1181 ; CHECK-BE-NEXT: blr
1183 %cmp = icmp slt i64 %a, %b
1184 %conv1 = sext i1 %cmp to i64
1185 store i64 %conv1, ptr @globalVal3, align 8
1189 define i64 @setnbc70(i8 zeroext %a, i8 zeroext %b) {
1190 ; CHECK-LABEL: setnbc70:
1191 ; CHECK: # %bb.0: # %entry
1192 ; CHECK-NEXT: cmplw r3, r4
1193 ; CHECK-NEXT: setnbc r3, lt
1196 %cmp = icmp ult i8 %a, %b
1197 %conv3 = sext i1 %cmp to i64
1201 define dso_local void @setnbc71(i8 zeroext %a, i8 zeroext %b) {
1202 ; CHECK-LE-LABEL: setnbc71:
1203 ; CHECK-LE: # %bb.0: # %entry
1204 ; CHECK-LE-NEXT: cmplw r3, r4
1205 ; CHECK-LE-NEXT: setnbc r3, lt
1206 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
1207 ; CHECK-LE-NEXT: blr
1209 ; CHECK-BE-LABEL: setnbc71:
1210 ; CHECK-BE: # %bb.0: # %entry
1211 ; CHECK-BE-NEXT: cmplw r3, r4
1212 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
1213 ; CHECK-BE-NEXT: setnbc r3, lt
1214 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
1215 ; CHECK-BE-NEXT: blr
1217 %cmp = icmp ult i8 %a, %b
1218 %conv3 = sext i1 %cmp to i8
1219 store i8 %conv3, ptr @globalVal, align 1
1223 define i64 @setnbc72(i32 zeroext %a, i32 zeroext %b) {
1224 ; CHECK-LABEL: setnbc72:
1225 ; CHECK: # %bb.0: # %entry
1226 ; CHECK-NEXT: cmplw r3, r4
1227 ; CHECK-NEXT: setnbc r3, lt
1230 %cmp = icmp ult i32 %a, %b
1231 %conv1 = sext i1 %cmp to i64
1235 define dso_local void @setnbc73(i32 zeroext %a, i32 zeroext %b) {
1236 ; CHECK-LE-LABEL: setnbc73:
1237 ; CHECK-LE: # %bb.0: # %entry
1238 ; CHECK-LE-NEXT: cmplw r3, r4
1239 ; CHECK-LE-NEXT: setnbc r3, lt
1240 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
1241 ; CHECK-LE-NEXT: blr
1243 ; CHECK-BE-LABEL: setnbc73:
1244 ; CHECK-BE: # %bb.0: # %entry
1245 ; CHECK-BE-NEXT: cmplw r3, r4
1246 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
1247 ; CHECK-BE-NEXT: setnbc r3, lt
1248 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
1249 ; CHECK-BE-NEXT: blr
1251 %cmp = icmp ult i32 %a, %b
1252 %sub = sext i1 %cmp to i32
1253 store i32 %sub, ptr @globalVal2, align 4
1257 define i64 @setnbc74(i16 zeroext %a, i16 zeroext %b) {
1258 ; CHECK-LABEL: setnbc74:
1259 ; CHECK: # %bb.0: # %entry
1260 ; CHECK-NEXT: cmplw r3, r4
1261 ; CHECK-NEXT: setnbc r3, lt
1264 %cmp = icmp ult i16 %a, %b
1265 %conv3 = sext i1 %cmp to i64
1269 define dso_local void @setnbc75(i16 zeroext %a, i16 zeroext %b) {
1270 ; CHECK-LE-LABEL: setnbc75:
1271 ; CHECK-LE: # %bb.0: # %entry
1272 ; CHECK-LE-NEXT: cmplw r3, r4
1273 ; CHECK-LE-NEXT: setnbc r3, lt
1274 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
1275 ; CHECK-LE-NEXT: blr
1277 ; CHECK-BE-LABEL: setnbc75:
1278 ; CHECK-BE: # %bb.0: # %entry
1279 ; CHECK-BE-NEXT: cmplw r3, r4
1280 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
1281 ; CHECK-BE-NEXT: setnbc r3, lt
1282 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
1283 ; CHECK-BE-NEXT: blr
1285 %cmp = icmp ult i16 %a, %b
1286 %conv3 = sext i1 %cmp to i16
1287 store i16 %conv3, ptr @globalVal4, align 2