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 dso_local signext i32 @test_iltsll(i64 %a, i64 %b) {
13 ; CHECK-LABEL: test_iltsll:
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 %conv = zext i1 %cmp to i32
27 ; Function Attrs: norecurse nounwind readnone
28 define dso_local signext i32 @test_iltsll_sext(i64 %a, i64 %b) {
29 ; CHECK-LABEL: test_iltsll_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 %sub = sext i1 %cmp to i32
44 ; Function Attrs: norecurse nounwind readnone
45 define dso_local signext i32 @test_iltsll_sext_z(i64 %a) {
46 ; CHECK-LABEL: test_iltsll_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 i32
56 ; Function Attrs: norecurse nounwind
57 define dso_local void @test_iltsll_store(i64 %a, i64 %b) {
58 ; CHECK-LABEL: test_iltsll_store:
59 ; CHECK: # %bb.0: # %entry
60 ; CHECK-NEXT: sradi r6, r3, 63
61 ; CHECK-NEXT: addis r5, r2, glob@toc@ha
62 ; CHECK-NEXT: subc r3, r3, r4
63 ; CHECK-NEXT: rldicl r3, r4, 1, 63
64 ; CHECK-NEXT: adde r3, r3, r6
65 ; CHECK-NEXT: xori r3, r3, 1
66 ; CHECK-NEXT: std r3, glob@toc@l(r5)
68 ; CHECK-DIAG: subfc [[REG3:r[0-9]+]], r4, r3
70 %cmp = icmp slt i64 %a, %b
71 %conv1 = zext i1 %cmp to i64
72 store i64 %conv1, i64* @glob, align 8
76 ; Function Attrs: norecurse nounwind
77 define dso_local void @test_iltsll_sext_store(i64 %a, i64 %b) {
78 ; CHECK-LABEL: test_iltsll_sext_store:
79 ; CHECK: # %bb.0: # %entry
80 ; CHECK-NEXT: sradi r6, r3, 63
81 ; CHECK-NEXT: addis r5, r2, glob@toc@ha
82 ; CHECK-NEXT: subc r3, r3, r4
83 ; CHECK-NEXT: rldicl r3, r4, 1, 63
84 ; CHECK-NEXT: adde r3, r3, r6
85 ; CHECK-NEXT: xori r3, r3, 1
86 ; CHECK-NEXT: neg r3, r3
87 ; CHECK-NEXT: std r3, glob@toc@l(r5)
89 ; CHECK-DIAG: subfc [[REG3:r[0-9]+]], r4, r3
91 %cmp = icmp slt i64 %a, %b
92 %conv1 = sext i1 %cmp to i64
93 store i64 %conv1, i64* @glob, align 8
97 ; Function Attrs: norecurse nounwind
98 define dso_local void @test_iltsll_sext_z_store(i64 %a) {
99 ; CHECK-LABEL: test_iltsll_sext_z_store:
100 ; CHECK: # %bb.0: # %entry
101 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
102 ; CHECK-NEXT: sradi r3, r3, 63
103 ; CHECK-NEXT: std r3, glob@toc@l(r4)
106 %cmp = icmp slt i64 %a, 0
107 %conv2 = sext i1 %cmp to i64
108 store i64 %conv2, i64* @glob, align 8