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_llltsll(i64 %a, i64 %b) {
13 ; CHECK-LABEL: test_llltsll:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: sradi r5, r3, 63
16 ; CHECK-NEXT: rldicl r6, r4, 1, 63
17 ; CHECK-NEXT: subc r3, r3, r4
18 ; CHECK-NEXT: adde r3, r6, r5
19 ; CHECK-NEXT: xori r3, r3, 1
22 %cmp = icmp slt i64 %a, %b
23 %conv1 = zext i1 %cmp to i64
27 ; Function Attrs: norecurse nounwind readnone
28 define i64 @test_llltsll_sext(i64 %a, i64 %b) {
29 ; CHECK-LABEL: test_llltsll_sext:
30 ; CHECK: # %bb.0: # %entry
31 ; CHECK-NEXT: sradi r5, r3, 63
32 ; CHECK-NEXT: rldicl r6, r4, 1, 63
33 ; CHECK-NEXT: subc r3, r3, r4
34 ; CHECK-NEXT: adde r3, r6, r5
35 ; CHECK-NEXT: xori r3, r3, 1
36 ; CHECK-NEXT: neg r3, r3
39 %cmp = icmp slt i64 %a, %b
40 %conv1 = sext i1 %cmp to i64
44 ; Function Attrs: norecurse nounwind readnone
45 define i64 @test_llltsll_sext_z(i64 %a) {
46 ; CHECK-LABEL: test_llltsll_sext_z:
47 ; CHECK: # %bb.0: # %entry
48 ; CHECK-NEXT: sradi r3, r3, 63
51 %cmp = icmp slt i64 %a, 0
52 %sub = sext i1 %cmp to i64
56 ; Function Attrs: norecurse nounwind
57 define dso_local void @test_llltsll_store(i64 %a, i64 %b) {
58 ; CHECK-LABEL: test_llltsll_store:
59 ; CHECK: # %bb.0: # %entry
60 ; CHECK-NEXT: sradi r5, r3, 63
61 ; CHECK-NEXT: rldicl r6, r4, 1, 63
62 ; CHECK-NEXT: subc r3, r3, r4
63 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
64 ; CHECK-NEXT: adde r3, r6, r5
65 ; CHECK-NEXT: xori r3, r3, 1
66 ; CHECK-NEXT: std r3, glob@toc@l(r4)
69 %cmp = icmp slt i64 %a, %b
70 %conv1 = zext i1 %cmp to i64
71 store i64 %conv1, ptr @glob, align 8
75 ; Function Attrs: norecurse nounwind
76 define dso_local void @test_llltsll_sext_store(i64 %a, i64 %b) {
77 ; CHECK-LABEL: test_llltsll_sext_store:
78 ; CHECK: # %bb.0: # %entry
79 ; CHECK-NEXT: sradi r5, r3, 63
80 ; CHECK-NEXT: rldicl r6, r4, 1, 63
81 ; CHECK-NEXT: subc r3, r3, r4
82 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
83 ; CHECK-NEXT: adde r3, r6, r5
84 ; CHECK-NEXT: xori r3, r3, 1
85 ; CHECK-NEXT: neg r3, r3
86 ; CHECK-NEXT: std r3, glob@toc@l(r4)
89 %cmp = icmp slt i64 %a, %b
90 %conv1 = sext i1 %cmp to i64
91 store i64 %conv1, ptr @glob, align 8
95 ; Function Attrs: norecurse nounwind
96 define dso_local void @test_llltsll_sext_z_store(i64 %a) {
97 ; CHECK-LABEL: test_llltsll_sext_z_store:
98 ; CHECK: # %bb.0: # %entry
99 ; CHECK-NEXT: sradi r3, r3, 63
100 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
101 ; CHECK-NEXT: std r3, glob@toc@l(r4)
104 %cmp = icmp slt i64 %a, 0
105 %sub = sext i1 %cmp to i64
106 store i64 %sub, ptr @glob, align 8