1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
3 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
4 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl \
5 ; RUN: --check-prefixes=CHECK,BE
6 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
7 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
8 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl \
9 ; RUN: --check-prefixes=CHECK,LE
11 @glob = local_unnamed_addr global i32 0, align 4
13 ; Function Attrs: norecurse nounwind readnone
14 define signext i32 @test_iltui(i32 zeroext %a, i32 zeroext %b) {
15 ; CHECK-LABEL: test_iltui:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: sub r3, r3, r4
18 ; CHECK-NEXT: rldicl r3, r3, 1, 63
21 %cmp = icmp ult i32 %a, %b
22 %conv = zext i1 %cmp to i32
26 ; Function Attrs: norecurse nounwind readnone
27 define signext i32 @test_iltui_sext(i32 zeroext %a, i32 zeroext %b) {
28 ; CHECK-LABEL: test_iltui_sext:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: sub r3, r3, r4
31 ; CHECK-NEXT: sradi r3, r3, 63
34 %cmp = icmp ult i32 %a, %b
35 %sub = sext i1 %cmp to i32
39 ; Function Attrs: norecurse nounwind
40 define void @test_iltui_store(i32 zeroext %a, i32 zeroext %b) {
41 ; BE-LABEL: test_iltui_store:
42 ; BE: # %bb.0: # %entry
43 ; BE-NEXT: addis r5, r2, .LC0@toc@ha
44 ; BE-NEXT: sub r3, r3, r4
45 ; BE-NEXT: ld r5, .LC0@toc@l(r5)
46 ; BE-NEXT: rldicl r3, r3, 1, 63
47 ; BE-NEXT: stw r3, 0(r5)
50 ; LE-LABEL: test_iltui_store:
51 ; LE: # %bb.0: # %entry
52 ; LE-NEXT: sub r3, r3, r4
53 ; LE-NEXT: addis r5, r2, glob@toc@ha
54 ; LE-NEXT: rldicl r3, r3, 1, 63
55 ; LE-NEXT: stw r3, glob@toc@l(r5)
58 %cmp = icmp ult i32 %a, %b
59 %conv = zext i1 %cmp to i32
60 store i32 %conv, i32* @glob, align 4
64 ; Function Attrs: norecurse nounwind
65 define void @test_iltui_sext_store(i32 zeroext %a, i32 zeroext %b) {
66 ; BE-LABEL: test_iltui_sext_store:
67 ; BE: # %bb.0: # %entry
68 ; BE-NEXT: addis r5, r2, .LC0@toc@ha
69 ; BE-NEXT: sub r3, r3, r4
70 ; BE-NEXT: ld r5, .LC0@toc@l(r5)
71 ; BE-NEXT: sradi r3, r3, 63
72 ; BE-NEXT: stw r3, 0(r5)
75 ; LE-LABEL: test_iltui_sext_store:
76 ; LE: # %bb.0: # %entry
77 ; LE-NEXT: sub r3, r3, r4
78 ; LE-NEXT: addis r5, r2, glob@toc@ha
79 ; LE-NEXT: sradi r3, r3, 63
80 ; LE-NEXT: stw r3, glob@toc@l(r5)
83 %cmp = icmp ult i32 %a, %b
84 %sub = sext i1 %cmp to i32
85 store i32 %sub, i32* @glob, align 4