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 @setbc1(i32 signext %a, i32 signext %b) {
21 ; CHECK-LABEL: setbc1:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: cmpw r3, r4
24 ; CHECK-NEXT: setbc r3, lt
27 %cmp = icmp slt i32 %a, %b
28 %conv = zext i1 %cmp to i32
32 define dso_local signext i32 @setbc2(i32 signext %a, i32 signext %b) {
33 ; CHECK-LABEL: setbc2:
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: cmpw r3, r4
36 ; CHECK-NEXT: setbc r3, eq
39 %cmp = icmp eq i32 %a, %b
40 %conv = zext i1 %cmp to i32
44 define dso_local signext i32 @setbc3(i32 signext %a, i32 signext %b) {
45 ; CHECK-LABEL: setbc3:
46 ; CHECK: # %bb.0: # %entry
47 ; CHECK-NEXT: cmpw r3, r4
48 ; CHECK-NEXT: setbc r3, gt
51 %cmp = icmp sgt i32 %a, %b
52 %conv = zext i1 %cmp to i32
56 define dso_local signext i32 @setbc4(i8 signext %a, i8 signext %b) {
57 ; CHECK-LABEL: setbc4:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: cmpw r3, r4
60 ; CHECK-NEXT: setbc r3, eq
63 %cmp = icmp eq i8 %a, %b
64 %conv2 = zext i1 %cmp to i32
68 define dso_local void @setbc5(i8 signext %a, i8 signext %b) {
69 ; CHECK-LE-LABEL: setbc5:
70 ; CHECK-LE: # %bb.0: # %entry
71 ; CHECK-LE-NEXT: cmpw r3, r4
72 ; CHECK-LE-NEXT: setbc r3, eq
73 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
76 ; CHECK-BE-LABEL: setbc5:
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: setbc r3, eq
81 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
84 %cmp = icmp eq i8 %a, %b
85 %conv3 = zext i1 %cmp to i8
86 store i8 %conv3, ptr @globalVal, align 1
90 define dso_local void @setbc6(i32 signext %a, i32 signext %b) {
91 ; CHECK-LE-LABEL: setbc6:
92 ; CHECK-LE: # %bb.0: # %entry
93 ; CHECK-LE-NEXT: cmpw r3, r4
94 ; CHECK-LE-NEXT: setbc r3, eq
95 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
98 ; CHECK-BE-LABEL: setbc6:
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: setbc r3, eq
103 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
106 %cmp = icmp eq i32 %a, %b
107 %conv = zext i1 %cmp to i32
108 store i32 %conv, ptr @globalVal2, align 4
112 define dso_local signext i32 @setbc7(i64 %a, i64 %b) {
113 ; CHECK-LABEL: setbc7:
114 ; CHECK: # %bb.0: # %entry
115 ; CHECK-NEXT: cmpd r3, r4
116 ; CHECK-NEXT: setbc r3, eq
119 %cmp = icmp eq i64 %a, %b
120 %conv = zext i1 %cmp to i32
124 define signext i64 @setbc8(i64 %a, i64 %b) {
125 ; CHECK-LABEL: setbc8:
126 ; CHECK: # %bb.0: # %entry
127 ; CHECK-NEXT: cmpd r3, r4
128 ; CHECK-NEXT: setbc r3, eq
131 %cmp = icmp eq i64 %a, %b
132 %conv = zext i1 %cmp to i64
137 define dso_local void @setbc9(i64 %a, i64 %b) {
138 ; CHECK-LE-LABEL: setbc9:
139 ; CHECK-LE: # %bb.0: # %entry
140 ; CHECK-LE-NEXT: cmpd r3, r4
141 ; CHECK-LE-NEXT: setbc r3, eq
142 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
145 ; CHECK-BE-LABEL: setbc9:
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: setbc r3, eq
150 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
153 %cmp = icmp eq i64 %a, %b
154 %conv1 = zext i1 %cmp to i64
155 store i64 %conv1, ptr @globalVal3, align 8
160 define dso_local signext i32 @setbc10(i16 signext %a, i16 signext %b) {
161 ; CHECK-LABEL: setbc10:
162 ; CHECK: # %bb.0: # %entry
163 ; CHECK-NEXT: cmpw r3, r4
164 ; CHECK-NEXT: setbc r3, eq
167 %cmp = icmp eq i16 %a, %b
168 %conv2 = zext i1 %cmp to i32
173 define dso_local void @setbc11(i16 signext %a, i16 signext %b) {
174 ; CHECK-LE-LABEL: setbc11:
175 ; CHECK-LE: # %bb.0: # %entry
176 ; CHECK-LE-NEXT: cmpw r3, r4
177 ; CHECK-LE-NEXT: setbc r3, eq
178 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
181 ; CHECK-BE-LABEL: setbc11:
182 ; CHECK-BE: # %bb.0: # %entry
183 ; CHECK-BE-NEXT: cmpw r3, r4
184 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
185 ; CHECK-BE-NEXT: setbc r3, eq
186 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
189 %cmp = icmp eq i16 %a, %b
190 %conv3 = zext i1 %cmp to i16
191 store i16 %conv3, ptr @globalVal4, align 2
196 define dso_local signext i32 @setbc12(i8 zeroext %a, i8 zeroext %b) {
197 ; CHECK-LABEL: setbc12:
198 ; CHECK: # %bb.0: # %entry
199 ; CHECK-NEXT: cmpw r3, r4
200 ; CHECK-NEXT: setbc r3, eq
203 %cmp = icmp eq i8 %a, %b
204 %conv2 = zext i1 %cmp to i32
209 define dso_local void @setbc13(i8 zeroext %a, i8 zeroext %b) {
210 ; CHECK-LE-LABEL: setbc13:
211 ; CHECK-LE: # %bb.0: # %entry
212 ; CHECK-LE-NEXT: cmpw r3, r4
213 ; CHECK-LE-NEXT: setbc r3, eq
214 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
217 ; CHECK-BE-LABEL: setbc13:
218 ; CHECK-BE: # %bb.0: # %entry
219 ; CHECK-BE-NEXT: cmpw r3, r4
220 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
221 ; CHECK-BE-NEXT: setbc r3, eq
222 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
225 %cmp = icmp eq i8 %a, %b
226 %conv3 = zext i1 %cmp to i8
227 store i8 %conv3, ptr @globalVal, align 1
232 define dso_local signext i32 @setbc14(i32 zeroext %a, i32 zeroext %b) {
233 ; CHECK-LABEL: setbc14:
234 ; CHECK: # %bb.0: # %entry
235 ; CHECK-NEXT: cmpw r3, r4
236 ; CHECK-NEXT: setbc r3, eq
239 %cmp = icmp eq i32 %a, %b
240 %conv = zext i1 %cmp to i32
245 define dso_local void @setbc15(i32 zeroext %a, i32 zeroext %b) {
246 ; CHECK-LE-LABEL: setbc15:
247 ; CHECK-LE: # %bb.0: # %entry
248 ; CHECK-LE-NEXT: cmpw r3, r4
249 ; CHECK-LE-NEXT: setbc r3, eq
250 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
253 ; CHECK-BE-LABEL: setbc15:
254 ; CHECK-BE: # %bb.0: # %entry
255 ; CHECK-BE-NEXT: cmpw r3, r4
256 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
257 ; CHECK-BE-NEXT: setbc r3, eq
258 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
261 %cmp = icmp eq i32 %a, %b
262 %conv = zext i1 %cmp to i32
263 store i32 %conv, ptr @globalVal2, align 4
268 define dso_local signext i32 @setbc16(i16 zeroext %a, i16 zeroext %b) {
269 ; CHECK-LABEL: setbc16:
270 ; CHECK: # %bb.0: # %entry
271 ; CHECK-NEXT: cmpw r3, r4
272 ; CHECK-NEXT: setbc r3, eq
275 %cmp = icmp eq i16 %a, %b
276 %conv2 = zext i1 %cmp to i32
281 define dso_local void @setbc17(i16 zeroext %a, i16 zeroext %b) {
282 ; CHECK-LE-LABEL: setbc17:
283 ; CHECK-LE: # %bb.0: # %entry
284 ; CHECK-LE-NEXT: cmpw r3, r4
285 ; CHECK-LE-NEXT: setbc r3, eq
286 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
289 ; CHECK-BE-LABEL: setbc17:
290 ; CHECK-BE: # %bb.0: # %entry
291 ; CHECK-BE-NEXT: cmpw r3, r4
292 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
293 ; CHECK-BE-NEXT: setbc r3, eq
294 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
297 %cmp = icmp eq i16 %a, %b
298 %conv3 = zext i1 %cmp to i16
299 store i16 %conv3, ptr @globalVal4, align 2
304 define dso_local signext i32 @setbc18(i8 signext %a, i8 signext %b) {
305 ; CHECK-LABEL: setbc18:
306 ; CHECK: # %bb.0: # %entry
307 ; CHECK-NEXT: cmpw r3, r4
308 ; CHECK-NEXT: setbc r3, gt
311 %cmp = icmp sgt i8 %a, %b
312 %conv2 = zext i1 %cmp to i32
317 define dso_local void @setbc19(i8 signext %a, i8 signext %b) {
318 ; CHECK-LE-LABEL: setbc19:
319 ; CHECK-LE: # %bb.0: # %entry
320 ; CHECK-LE-NEXT: cmpw r3, r4
321 ; CHECK-LE-NEXT: setbc r3, gt
322 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
325 ; CHECK-BE-LABEL: setbc19:
326 ; CHECK-BE: # %bb.0: # %entry
327 ; CHECK-BE-NEXT: cmpw r3, r4
328 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
329 ; CHECK-BE-NEXT: setbc r3, gt
330 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
333 %cmp = icmp sgt i8 %a, %b
334 %conv3 = zext i1 %cmp to i8
335 store i8 %conv3, ptr @globalVal, align 1
340 define dso_local void @setbc20(i32 signext %a, i32 signext %b) {
341 ; CHECK-LE-LABEL: setbc20:
342 ; CHECK-LE: # %bb.0: # %entry
343 ; CHECK-LE-NEXT: cmpw r3, r4
344 ; CHECK-LE-NEXT: setbc r3, gt
345 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
348 ; CHECK-BE-LABEL: setbc20:
349 ; CHECK-BE: # %bb.0: # %entry
350 ; CHECK-BE-NEXT: cmpw r3, r4
351 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
352 ; CHECK-BE-NEXT: setbc r3, gt
353 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
356 %cmp = icmp sgt i32 %a, %b
357 %conv = zext i1 %cmp to i32
358 store i32 %conv, ptr @globalVal2, align 4
363 define dso_local signext i32 @setbc21(i64 %a, i64 %b) {
364 ; CHECK-LABEL: setbc21:
365 ; CHECK: # %bb.0: # %entry
366 ; CHECK-NEXT: cmpd r3, r4
367 ; CHECK-NEXT: setbc r3, gt
370 %cmp = icmp sgt i64 %a, %b
371 %conv = zext i1 %cmp to i32
376 define dso_local void @setbc22(i64 %a, i64 %b) {
377 ; CHECK-LE-LABEL: setbc22:
378 ; CHECK-LE: # %bb.0: # %entry
379 ; CHECK-LE-NEXT: cmpd r3, r4
380 ; CHECK-LE-NEXT: setbc r3, gt
381 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
384 ; CHECK-BE-LABEL: setbc22:
385 ; CHECK-BE: # %bb.0: # %entry
386 ; CHECK-BE-NEXT: cmpd r3, r4
387 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
388 ; CHECK-BE-NEXT: setbc r3, gt
389 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
392 %cmp = icmp sgt i64 %a, %b
393 %conv1 = zext i1 %cmp to i64
394 store i64 %conv1, ptr @globalVal3, align 8
399 define dso_local signext i32 @setbc23(i16 signext %a, i16 signext %b) {
400 ; CHECK-LABEL: setbc23:
401 ; CHECK: # %bb.0: # %entry
402 ; CHECK-NEXT: cmpw r3, r4
403 ; CHECK-NEXT: setbc r3, gt
406 %cmp = icmp sgt i16 %a, %b
407 %conv2 = zext i1 %cmp to i32
412 define dso_local void @setbc24(i16 signext %a, i16 signext %b) {
413 ; CHECK-LE-LABEL: setbc24:
414 ; CHECK-LE: # %bb.0: # %entry
415 ; CHECK-LE-NEXT: cmpw r3, r4
416 ; CHECK-LE-NEXT: setbc r3, gt
417 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
420 ; CHECK-BE-LABEL: setbc24:
421 ; CHECK-BE: # %bb.0: # %entry
422 ; CHECK-BE-NEXT: cmpw r3, r4
423 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
424 ; CHECK-BE-NEXT: setbc r3, gt
425 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
428 %cmp = icmp sgt i16 %a, %b
429 %conv3 = zext i1 %cmp to i16
430 store i16 %conv3, ptr @globalVal4, align 2
435 define dso_local signext i32 @setbc25(i8 signext %a, i8 signext %b) {
436 ; CHECK-LABEL: setbc25:
437 ; CHECK: # %bb.0: # %entry
438 ; CHECK-NEXT: cmpw r3, r4
439 ; CHECK-NEXT: setbc r3, lt
442 %cmp = icmp slt i8 %a, %b
443 %conv2 = zext i1 %cmp to i32
448 define dso_local void @setbc26(i8 signext %a, i8 signext %b) {
449 ; CHECK-LE-LABEL: setbc26:
450 ; CHECK-LE: # %bb.0: # %entry
451 ; CHECK-LE-NEXT: cmpw r3, r4
452 ; CHECK-LE-NEXT: setbc r3, lt
453 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
456 ; CHECK-BE-LABEL: setbc26:
457 ; CHECK-BE: # %bb.0: # %entry
458 ; CHECK-BE-NEXT: cmpw r3, r4
459 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
460 ; CHECK-BE-NEXT: setbc r3, lt
461 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
464 %cmp = icmp slt i8 %a, %b
465 %conv3 = zext i1 %cmp to i8
466 store i8 %conv3, ptr @globalVal, align 1
471 define dso_local void @setbc27(i32 signext %a, i32 signext %b) {
472 ; CHECK-LE-LABEL: setbc27:
473 ; CHECK-LE: # %bb.0: # %entry
474 ; CHECK-LE-NEXT: cmpw r3, r4
475 ; CHECK-LE-NEXT: setbc r3, lt
476 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
479 ; CHECK-BE-LABEL: setbc27:
480 ; CHECK-BE: # %bb.0: # %entry
481 ; CHECK-BE-NEXT: cmpw r3, r4
482 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
483 ; CHECK-BE-NEXT: setbc r3, lt
484 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
487 %cmp = icmp slt i32 %a, %b
488 %conv = zext i1 %cmp to i32
489 store i32 %conv, ptr @globalVal2, align 4
494 define dso_local signext i32 @setbc28(i64 %a, i64 %b) {
495 ; CHECK-LABEL: setbc28:
496 ; CHECK: # %bb.0: # %entry
497 ; CHECK-NEXT: cmpd r3, r4
498 ; CHECK-NEXT: setbc r3, lt
501 %cmp = icmp slt i64 %a, %b
502 %conv = zext i1 %cmp to i32
507 define signext i64 @setbc29(i64 %a, i64 %b) {
508 ; CHECK-LABEL: setbc29:
509 ; CHECK: # %bb.0: # %entry
510 ; CHECK-NEXT: cmpd r3, r4
511 ; CHECK-NEXT: setbc r3, lt
514 %cmp = icmp slt i64 %a, %b
515 %conv = zext i1 %cmp to i64
520 define dso_local void @setbc30(i64 %a, i64 %b) {
521 ; CHECK-LE-LABEL: setbc30:
522 ; CHECK-LE: # %bb.0: # %entry
523 ; CHECK-LE-NEXT: cmpd r3, r4
524 ; CHECK-LE-NEXT: setbc r3, lt
525 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
528 ; CHECK-BE-LABEL: setbc30:
529 ; CHECK-BE: # %bb.0: # %entry
530 ; CHECK-BE-NEXT: cmpd r3, r4
531 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
532 ; CHECK-BE-NEXT: setbc r3, lt
533 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
536 %cmp = icmp slt i64 %a, %b
537 %conv1 = zext i1 %cmp to i64
538 store i64 %conv1, ptr @globalVal3, align 8
543 define dso_local signext i32 @setbc31(i16 signext %a, i16 signext %b) {
544 ; CHECK-LABEL: setbc31:
545 ; CHECK: # %bb.0: # %entry
546 ; CHECK-NEXT: cmpw r3, r4
547 ; CHECK-NEXT: setbc r3, lt
550 %cmp = icmp slt i16 %a, %b
551 %conv2 = zext i1 %cmp to i32
556 define dso_local void @setbc32(i16 signext %a, i16 signext %b) {
557 ; CHECK-LE-LABEL: setbc32:
558 ; CHECK-LE: # %bb.0: # %entry
559 ; CHECK-LE-NEXT: cmpw r3, r4
560 ; CHECK-LE-NEXT: setbc r3, lt
561 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
564 ; CHECK-BE-LABEL: setbc32:
565 ; CHECK-BE: # %bb.0: # %entry
566 ; CHECK-BE-NEXT: cmpw r3, r4
567 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
568 ; CHECK-BE-NEXT: setbc r3, lt
569 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
572 %cmp = icmp slt i16 %a, %b
573 %conv3 = zext i1 %cmp to i16
574 store i16 %conv3, ptr @globalVal4, align 2
579 define i64 @setbc33(i8 signext %a, i8 signext %b) {
580 ; CHECK-LABEL: setbc33:
581 ; CHECK: # %bb.0: # %entry
582 ; CHECK-NEXT: cmpw r3, r4
583 ; CHECK-NEXT: setbc r3, eq
586 %cmp = icmp eq i8 %a, %b
587 %conv3 = zext i1 %cmp to i64
592 define dso_local void @setbc34(i8 signext %a, i8 signext %b) {
593 ; CHECK-LE-LABEL: setbc34:
594 ; CHECK-LE: # %bb.0: # %entry
595 ; CHECK-LE-NEXT: cmpw r3, r4
596 ; CHECK-LE-NEXT: setbc r3, eq
597 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
600 ; CHECK-BE-LABEL: setbc34:
601 ; CHECK-BE: # %bb.0: # %entry
602 ; CHECK-BE-NEXT: cmpw r3, r4
603 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
604 ; CHECK-BE-NEXT: setbc r3, eq
605 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
608 %cmp = icmp eq i8 %a, %b
609 %conv3 = zext i1 %cmp to i8
610 store i8 %conv3, ptr @globalVal, align 1
615 define i64 @setbc35(i32 signext %a, i32 signext %b) {
616 ; CHECK-LABEL: setbc35:
617 ; CHECK: # %bb.0: # %entry
618 ; CHECK-NEXT: cmpw r3, r4
619 ; CHECK-NEXT: setbc r3, eq
622 %cmp = icmp eq i32 %a, %b
623 %conv1 = zext i1 %cmp to i64
628 define dso_local void @setbc36(i32 signext %a, i32 signext %b) {
629 ; CHECK-LE-LABEL: setbc36:
630 ; CHECK-LE: # %bb.0: # %entry
631 ; CHECK-LE-NEXT: cmpw r3, r4
632 ; CHECK-LE-NEXT: setbc r3, eq
633 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
636 ; CHECK-BE-LABEL: setbc36:
637 ; CHECK-BE: # %bb.0: # %entry
638 ; CHECK-BE-NEXT: cmpw r3, r4
639 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
640 ; CHECK-BE-NEXT: setbc r3, eq
641 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
644 %cmp = icmp eq i32 %a, %b
645 %conv = zext i1 %cmp to i32
646 store i32 %conv, ptr @globalVal2, align 4
651 define dso_local void @setbc37(i64 %a, i64 %b) {
652 ; CHECK-LE-LABEL: setbc37:
653 ; CHECK-LE: # %bb.0: # %entry
654 ; CHECK-LE-NEXT: cmpd r3, r4
655 ; CHECK-LE-NEXT: setbc r3, eq
656 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
659 ; CHECK-BE-LABEL: setbc37:
660 ; CHECK-BE: # %bb.0: # %entry
661 ; CHECK-BE-NEXT: cmpd r3, r4
662 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
663 ; CHECK-BE-NEXT: setbc r3, eq
664 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
667 %cmp = icmp eq i64 %a, %b
668 %conv1 = zext i1 %cmp to i64
669 store i64 %conv1, ptr @globalVal3, align 8
674 define i64 @setbc38(i16 signext %a, i16 signext %b) {
675 ; CHECK-LABEL: setbc38:
676 ; CHECK: # %bb.0: # %entry
677 ; CHECK-NEXT: cmpw r3, r4
678 ; CHECK-NEXT: setbc r3, eq
681 %cmp = icmp eq i16 %a, %b
682 %conv3 = zext i1 %cmp to i64
687 define dso_local void @setbc39(i16 signext %a, i16 signext %b) {
688 ; CHECK-LE-LABEL: setbc39:
689 ; CHECK-LE: # %bb.0: # %entry
690 ; CHECK-LE-NEXT: cmpw r3, r4
691 ; CHECK-LE-NEXT: setbc r3, eq
692 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
695 ; CHECK-BE-LABEL: setbc39:
696 ; CHECK-BE: # %bb.0: # %entry
697 ; CHECK-BE-NEXT: cmpw r3, r4
698 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
699 ; CHECK-BE-NEXT: setbc r3, eq
700 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
703 %cmp = icmp eq i16 %a, %b
704 %conv3 = zext i1 %cmp to i16
705 store i16 %conv3, ptr @globalVal4, align 2
710 define i64 @setbc40(i8 zeroext %a, i8 zeroext %b) {
711 ; CHECK-LABEL: setbc40:
712 ; CHECK: # %bb.0: # %entry
713 ; CHECK-NEXT: cmpw r3, r4
714 ; CHECK-NEXT: setbc r3, eq
717 %cmp = icmp eq i8 %a, %b
718 %conv3 = zext i1 %cmp to i64
723 define dso_local void @setbc41(i8 zeroext %a, i8 zeroext %b) {
724 ; CHECK-LE-LABEL: setbc41:
725 ; CHECK-LE: # %bb.0: # %entry
726 ; CHECK-LE-NEXT: cmpw r3, r4
727 ; CHECK-LE-NEXT: setbc r3, eq
728 ; CHECK-LE-NEXT: pstb r3, globalVal@PCREL(0), 1
731 ; CHECK-BE-LABEL: setbc41:
732 ; CHECK-BE: # %bb.0: # %entry
733 ; CHECK-BE-NEXT: cmpw r3, r4
734 ; CHECK-BE-NEXT: addis r4, r2, globalVal@toc@ha
735 ; CHECK-BE-NEXT: setbc r3, eq
736 ; CHECK-BE-NEXT: stb r3, globalVal@toc@l(r4)
739 %cmp = icmp eq i8 %a, %b
740 %conv3 = zext i1 %cmp to i8
741 store i8 %conv3, ptr @globalVal, align 1
746 define i64 @setbc42(i32 zeroext %a, i32 zeroext %b) {
747 ; CHECK-LABEL: setbc42:
748 ; CHECK: # %bb.0: # %entry
749 ; CHECK-NEXT: cmpw r3, r4
750 ; CHECK-NEXT: setbc r3, eq
753 %cmp = icmp eq i32 %a, %b
754 %conv1 = zext i1 %cmp to i64
759 define dso_local void @setbc43(i32 zeroext %a, i32 zeroext %b) {
760 ; CHECK-LE-LABEL: setbc43:
761 ; CHECK-LE: # %bb.0: # %entry
762 ; CHECK-LE-NEXT: cmpw r3, r4
763 ; CHECK-LE-NEXT: setbc r3, eq
764 ; CHECK-LE-NEXT: pstw r3, globalVal2@PCREL(0), 1
767 ; CHECK-BE-LABEL: setbc43:
768 ; CHECK-BE: # %bb.0: # %entry
769 ; CHECK-BE-NEXT: cmpw r3, r4
770 ; CHECK-BE-NEXT: addis r4, r2, globalVal2@toc@ha
771 ; CHECK-BE-NEXT: setbc r3, eq
772 ; CHECK-BE-NEXT: stw r3, globalVal2@toc@l(r4)
775 %cmp = icmp eq i32 %a, %b
776 %conv = zext i1 %cmp to i32
777 store i32 %conv, ptr @globalVal2, align 4
782 define i64 @setbc44(i64 %a, i64 %b) {
783 ; CHECK-LABEL: setbc44:
784 ; CHECK: # %bb.0: # %entry
785 ; CHECK-NEXT: cmpd r3, r4
786 ; CHECK-NEXT: setbc r3, eq
789 %cmp = icmp eq i64 %a, %b
790 %conv1 = zext i1 %cmp to i64
795 define dso_local void @setbc45(i64 %a, i64 %b) {
796 ; CHECK-LE-LABEL: setbc45:
797 ; CHECK-LE: # %bb.0: # %entry
798 ; CHECK-LE-NEXT: cmpd r3, r4
799 ; CHECK-LE-NEXT: setbc r3, eq
800 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
803 ; CHECK-BE-LABEL: setbc45:
804 ; CHECK-BE: # %bb.0: # %entry
805 ; CHECK-BE-NEXT: cmpd r3, r4
806 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
807 ; CHECK-BE-NEXT: setbc r3, eq
808 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
811 %cmp = icmp eq i64 %a, %b
812 %conv1 = zext i1 %cmp to i64
813 store i64 %conv1, ptr @globalVal3, align 8
818 define i64 @setbc46(i16 zeroext %a, i16 zeroext %b) {
819 ; CHECK-LABEL: setbc46:
820 ; CHECK: # %bb.0: # %entry
821 ; CHECK-NEXT: cmpw r3, r4
822 ; CHECK-NEXT: setbc r3, eq
825 %cmp = icmp eq i16 %a, %b
826 %conv3 = zext i1 %cmp to i64
831 define dso_local void @setbc47(i16 zeroext %a, i16 zeroext %b) {
832 ; CHECK-LE-LABEL: setbc47:
833 ; CHECK-LE: # %bb.0: # %entry
834 ; CHECK-LE-NEXT: cmpw r3, r4
835 ; CHECK-LE-NEXT: setbc r3, eq
836 ; CHECK-LE-NEXT: psth r3, globalVal4@PCREL(0), 1
839 ; CHECK-BE-LABEL: setbc47:
840 ; CHECK-BE: # %bb.0: # %entry
841 ; CHECK-BE-NEXT: cmpw r3, r4
842 ; CHECK-BE-NEXT: addis r4, r2, globalVal4@toc@ha
843 ; CHECK-BE-NEXT: setbc r3, eq
844 ; CHECK-BE-NEXT: sth r3, globalVal4@toc@l(r4)
847 %cmp = icmp eq i16 %a, %b
848 %conv3 = zext i1 %cmp to i16
849 store i16 %conv3, ptr @globalVal4, align 2
854 define i64 @setbc48(i64 %a, i64 %b) {
855 ; CHECK-LABEL: setbc48:
856 ; CHECK: # %bb.0: # %entry
857 ; CHECK-NEXT: cmpd r3, r4
858 ; CHECK-NEXT: setbc r3, gt
861 %cmp = icmp sgt i64 %a, %b
862 %conv1 = zext i1 %cmp to i64
867 define dso_local void @setbc49(i64 %a, i64 %b) {
868 ; CHECK-LE-LABEL: setbc49:
869 ; CHECK-LE: # %bb.0: # %entry
870 ; CHECK-LE-NEXT: cmpd r3, r4
871 ; CHECK-LE-NEXT: setbc r3, gt
872 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
875 ; CHECK-BE-LABEL: setbc49:
876 ; CHECK-BE: # %bb.0: # %entry
877 ; CHECK-BE-NEXT: cmpd r3, r4
878 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
879 ; CHECK-BE-NEXT: setbc r3, gt
880 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
883 %cmp = icmp sgt i64 %a, %b
884 %conv1 = zext i1 %cmp to i64
885 store i64 %conv1, ptr @globalVal3, align 8
890 define i64 @setbc50(i64 %a, i64 %b) {
891 ; CHECK-LABEL: setbc50:
892 ; CHECK: # %bb.0: # %entry
893 ; CHECK-NEXT: cmpd r3, r4
894 ; CHECK-NEXT: setbc r3, lt
897 %cmp = icmp slt i64 %a, %b
898 %conv1 = zext i1 %cmp to i64
903 define dso_local void @setnbc51(i64 %a, i64 %b) {
904 ; CHECK-LE-LABEL: setnbc51:
905 ; CHECK-LE: # %bb.0: # %entry
906 ; CHECK-LE-NEXT: cmpd r3, r4
907 ; CHECK-LE-NEXT: setbc r3, lt
908 ; CHECK-LE-NEXT: pstd r3, globalVal3@PCREL(0), 1
911 ; CHECK-BE-LABEL: setnbc51:
912 ; CHECK-BE: # %bb.0: # %entry
913 ; CHECK-BE-NEXT: cmpd r3, r4
914 ; CHECK-BE-NEXT: addis r4, r2, globalVal3@toc@ha
915 ; CHECK-BE-NEXT: setbc r3, lt
916 ; CHECK-BE-NEXT: std r3, globalVal3@toc@l(r4)
919 %cmp = icmp slt i64 %a, %b
920 %conv1 = zext i1 %cmp to i64
921 store i64 %conv1, ptr @globalVal3, align 8