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 i8 0, align 1
11 ; Function Attrs: norecurse nounwind readnone
12 define dso_local signext i32 @test_igeuc(i8 zeroext %a, i8 zeroext %b) {
13 ; CHECK-LABEL: test_igeuc:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: sub r3, r3, r4
16 ; CHECK-NEXT: not r3, r3
17 ; CHECK-NEXT: rldicl r3, r3, 1, 63
20 %cmp = icmp uge i8 %a, %b
21 %conv2 = zext i1 %cmp to i32
25 ; Function Attrs: norecurse nounwind readnone
26 define dso_local signext i32 @test_igeuc_sext(i8 zeroext %a, i8 zeroext %b) {
27 ; CHECK-LABEL: test_igeuc_sext:
28 ; CHECK: # %bb.0: # %entry
29 ; CHECK-NEXT: sub r3, r3, r4
30 ; CHECK-NEXT: rldicl r3, r3, 1, 63
31 ; CHECK-NEXT: addi r3, r3, -1
34 %cmp = icmp uge i8 %a, %b
35 %sub = sext i1 %cmp to i32
40 ; Function Attrs: norecurse nounwind readnone
41 define dso_local signext i32 @test_igeuc_z(i8 zeroext %a) {
42 ; CHECK-LABEL: test_igeuc_z:
43 ; CHECK: # %bb.0: # %entry
44 ; CHECK-NEXT: li r3, 1
47 %cmp = icmp uge i8 %a, 0
48 %conv2 = zext i1 %cmp to i32
52 ; Function Attrs: norecurse nounwind readnone
53 define dso_local signext i32 @test_igeuc_sext_z(i8 zeroext %a) {
54 ; CHECK-LABEL: test_igeuc_sext_z:
55 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: li r3, -1
59 %cmp = icmp uge i8 %a, 0
60 %conv2 = sext i1 %cmp to i32
64 ; Function Attrs: norecurse nounwind
65 define dso_local void @test_igeuc_store(i8 zeroext %a, i8 zeroext %b) {
66 ; CHECK-LABEL: test_igeuc_store:
67 ; CHECK: # %bb.0: # %entry
68 ; CHECK-NEXT: sub r3, r3, r4
69 ; CHECK-NEXT: addis r5, r2, glob@toc@ha
70 ; CHECK-NEXT: not r3, r3
71 ; CHECK-NEXT: rldicl r3, r3, 1, 63
72 ; CHECK-NEXT: stb r3, glob@toc@l(r5)
75 %cmp = icmp uge i8 %a, %b
76 %conv3 = zext i1 %cmp to i8
77 store i8 %conv3, i8* @glob
79 ; CHECK_LABEL: test_igeuc_store:
82 ; Function Attrs: norecurse nounwind
83 define dso_local void @test_igeuc_sext_store(i8 zeroext %a, i8 zeroext %b) {
84 ; CHECK-LABEL: test_igeuc_sext_store:
85 ; CHECK: # %bb.0: # %entry
86 ; CHECK-NEXT: sub r3, r3, r4
87 ; CHECK-NEXT: addis r5, r2, glob@toc@ha
88 ; CHECK-NEXT: rldicl r3, r3, 1, 63
89 ; CHECK-NEXT: addi r3, r3, -1
90 ; CHECK-NEXT: stb r3, glob@toc@l(r5)
93 %cmp = icmp uge i8 %a, %b
94 %conv3 = sext i1 %cmp to i8
95 store i8 %conv3, i8* @glob
97 ; CHECK-TBD-LABEL: @test_igeuc_sext_store
98 ; CHECK-TBD: subf [[REG1:r[0-9]+]], r3, r4
99 ; CHECK-TBD: rldicl [[REG2:r[0-9]+]], [[REG1]], 1, 63
100 ; CHECK-TBD: addi [[REG3:r[0-9]+]], [[REG2]], -1
101 ; CHECK-TBD: stb [[REG3]]
105 ; Function Attrs : norecurse nounwind
106 define dso_local void @test_igeuc_z_store(i8 zeroext %a) {
107 ; CHECK-LABEL: test_igeuc_z_store:
108 ; CHECK: # %bb.0: # %entry
109 ; CHECK-NEXT: addis r3, r2, glob@toc@ha
110 ; CHECK-NEXT: li r4, 1
111 ; CHECK-NEXT: stb r4, glob@toc@l(r3)
114 %cmp = icmp uge i8 %a, 0
115 %conv3 = zext i1 %cmp to i8
116 store i8 %conv3, i8* @glob
120 ; Function Attrs: norecurse nounwind
121 define dso_local void @test_igeuc_sext_z_store(i8 zeroext %a) {
122 ; CHECK-LABEL: test_igeuc_sext_z_store:
123 ; CHECK: # %bb.0: # %entry
124 ; CHECK-NEXT: addis r3, r2, glob@toc@ha
125 ; CHECK-NEXT: li r4, -1
126 ; CHECK-NEXT: stb r4, glob@toc@l(r3)
129 %cmp = icmp uge i8 %a, 0
130 %conv3 = sext i1 %cmp to i8
131 store i8 %conv3, i8* @glob