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 i64 0, align 8
11 ; Function Attrs: norecurse nounwind readnone
12 define i64 @test_llleull(i64 %a, i64 %b) {
13 ; CHECK-LABEL: test_llleull:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: subc r4, r4, r3
16 ; CHECK-NEXT: subfe r3, r3, r3
17 ; CHECK-NEXT: addi r3, r3, 1
20 %cmp = icmp ule i64 %a, %b
21 %conv1 = zext i1 %cmp to i64
25 ; Function Attrs: norecurse nounwind readnone
26 define i64 @test_llleull_sext(i64 %a, i64 %b) {
27 ; CHECK-LABEL: test_llleull_sext:
28 ; CHECK: # %bb.0: # %entry
29 ; CHECK-NEXT: subc r4, r4, r3
30 ; CHECK-NEXT: subfe r3, r3, r3
31 ; CHECK-NEXT: not r3, r3
34 %cmp = icmp ule i64 %a, %b
35 %conv1 = sext i1 %cmp to i64
39 ; Function Attrs: norecurse nounwind readnone
40 define i64 @test_llleull_z(i64 %a) {
41 ; CHECK-LABEL: test_llleull_z:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: cntlzd r3, r3
44 ; CHECK-NEXT: rldicl r3, r3, 58, 63
47 %cmp = icmp ule i64 %a, 0
48 %conv1 = zext i1 %cmp to i64
52 ; Function Attrs: norecurse nounwind readnone
53 define i64 @test_llleull_sext_z(i64 %a) {
54 ; CHECK-LABEL: test_llleull_sext_z:
55 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: addic r3, r3, -1
57 ; CHECK-NEXT: subfe r3, r3, r3
60 %cmp = icmp ule i64 %a, 0
61 %conv1 = sext i1 %cmp to i64
65 ; Function Attrs: norecurse nounwind
66 define dso_local void @test_llleull_store(i64 %a, i64 %b) {
67 ; CHECK-LABEL: test_llleull_store:
68 ; CHECK: # %bb.0: # %entry
69 ; CHECK-NEXT: subc r4, r4, r3
70 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
71 ; CHECK-NEXT: subfe r3, r3, r3
72 ; CHECK-NEXT: addi r3, r3, 1
73 ; CHECK-NEXT: std r3, glob@toc@l(r4)
76 %cmp = icmp ule i64 %a, %b
77 %conv1 = zext i1 %cmp to i64
78 store i64 %conv1, ptr @glob
82 ; Function Attrs: norecurse nounwind
83 define dso_local void @test_llleull_sext_store(i64 %a, i64 %b) {
84 ; CHECK-LABEL: test_llleull_sext_store:
85 ; CHECK: # %bb.0: # %entry
86 ; CHECK-NEXT: subc r4, r4, r3
87 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
88 ; CHECK-NEXT: subfe r3, r3, r3
89 ; CHECK-NEXT: not r3, r3
90 ; CHECK-NEXT: std r3, glob@toc@l(r4)
93 %cmp = icmp ule i64 %a, %b
94 %conv1 = sext i1 %cmp to i64
95 store i64 %conv1, ptr @glob
99 ; Function Attrs: norecurse nounwind
100 define dso_local void @test_llleull_z_store(i64 %a) {
101 ; CHECK-LABEL: test_llleull_z_store:
102 ; CHECK: # %bb.0: # %entry
103 ; CHECK-NEXT: cntlzd r3, r3
104 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
105 ; CHECK-NEXT: rldicl r3, r3, 58, 63
106 ; CHECK-NEXT: std r3, glob@toc@l(r4)
109 %cmp = icmp ule i64 %a, 0
110 %conv1 = zext i1 %cmp to i64
111 store i64 %conv1, ptr @glob
115 ; Function Attrs: norecurse nounwind
116 define dso_local void @test_llleull_sext_z_store(i64 %a) {
117 ; CHECK-LABEL: test_llleull_sext_z_store:
118 ; CHECK: # %bb.0: # %entry
119 ; CHECK-NEXT: addic r3, r3, -1
120 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
121 ; CHECK-NEXT: subfe r3, r3, r3
122 ; CHECK-NEXT: std r3, glob@toc@l(r4)
125 %cmp = icmp ule i64 %a, 0
126 %conv1 = sext i1 %cmp to i64
127 store i64 %conv1, ptr @glob