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: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
6 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
7 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
9 @glob = dso_local local_unnamed_addr global i32 0, align 4
11 ; Function Attrs: norecurse nounwind readnone
12 define dso_local signext i32 @test_ileui(i32 zeroext %a, i32 zeroext %b) {
13 ; CHECK-LABEL: test_ileui:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: sub r3, r4, r3
16 ; CHECK-NEXT: not r3, r3
17 ; CHECK-NEXT: rldicl r3, r3, 1, 63
20 %cmp = icmp ule i32 %a, %b
21 %sub = zext i1 %cmp to i32
25 ; Function Attrs: norecurse nounwind readnone
26 define dso_local signext i32 @test_ileui_sext(i32 zeroext %a, i32 zeroext %b) {
27 ; CHECK-LABEL: test_ileui_sext:
28 ; CHECK: # %bb.0: # %entry
29 ; CHECK-NEXT: sub r3, r4, r3
30 ; CHECK-NEXT: rldicl r3, r3, 1, 63
31 ; CHECK-NEXT: addi r3, r3, -1
34 %cmp = icmp ule i32 %a, %b
35 %sub = sext i1 %cmp to i32
39 ; Function Attrs: norecurse nounwind readnone
40 define dso_local signext i32 @test_ileui_z(i32 zeroext %a) {
41 ; CHECK-LABEL: test_ileui_z:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: cntlzw r3, r3
44 ; CHECK-NEXT: srwi r3, r3, 5
47 %cmp = icmp eq i32 %a, 0
48 %sub = zext i1 %cmp to i32
52 ; Function Attrs: norecurse nounwind readnone
53 define dso_local signext i32 @test_ileui_sext_z(i32 zeroext %a) {
54 ; CHECK-LABEL: test_ileui_sext_z:
55 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: cntlzw r3, r3
57 ; CHECK-NEXT: srwi r3, r3, 5
58 ; CHECK-NEXT: neg r3, r3
61 %cmp = icmp eq i32 %a, 0
62 %sub = sext i1 %cmp to i32
66 ; Function Attrs: norecurse nounwind
67 define dso_local void @test_ileui_store(i32 zeroext %a, i32 zeroext %b) {
68 ; CHECK-LABEL: test_ileui_store:
69 ; CHECK: # %bb.0: # %entry
70 ; CHECK-NEXT: sub r3, r4, r3
71 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
72 ; CHECK-NEXT: not r3, r3
73 ; CHECK-NEXT: rldicl r3, r3, 1, 63
74 ; CHECK-NEXT: stw r3, glob@toc@l(r4)
77 %cmp = icmp ule i32 %a, %b
78 %sub = zext i1 %cmp to i32
79 store i32 %sub, ptr @glob
83 ; Function Attrs: norecurse nounwind
84 define dso_local void @test_ileui_sext_store(i32 zeroext %a, i32 zeroext %b) {
85 ; CHECK-LABEL: test_ileui_sext_store:
86 ; CHECK: # %bb.0: # %entry
87 ; CHECK-NEXT: sub r3, r4, r3
88 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
89 ; CHECK-NEXT: rldicl r3, r3, 1, 63
90 ; CHECK-NEXT: addi r3, r3, -1
91 ; CHECK-NEXT: stw r3, glob@toc@l(r4)
94 %cmp = icmp ule i32 %a, %b
95 %sub = sext i1 %cmp to i32
96 store i32 %sub, ptr @glob
100 ; Function Attrs: norecurse nounwind
101 define dso_local void @test_ileui_z_store(i32 zeroext %a) {
102 ; CHECK-LABEL: test_ileui_z_store:
103 ; CHECK: # %bb.0: # %entry
104 ; CHECK-NEXT: cntlzw r3, r3
105 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
106 ; CHECK-NEXT: srwi r3, r3, 5
107 ; CHECK-NEXT: stw r3, glob@toc@l(r4)
110 %cmp = icmp eq i32 %a, 0
111 %sub = zext i1 %cmp to i32
112 store i32 %sub, ptr @glob
116 ; Function Attrs: norecurse nounwind
117 define dso_local void @test_ileui_sext_z_store(i32 zeroext %a) {
118 ; CHECK-LABEL: test_ileui_sext_z_store:
119 ; CHECK: # %bb.0: # %entry
120 ; CHECK-NEXT: cntlzw r3, r3
121 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
122 ; CHECK-NEXT: srwi r3, r3, 5
123 ; CHECK-NEXT: neg r3, r3
124 ; CHECK-NEXT: stw r3, glob@toc@l(r4)
127 %cmp = icmp eq i32 %a, 0
128 %sub = sext i1 %cmp to i32
129 store i32 %sub, ptr @glob