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 i16 0, align 2
11 ; Function Attrs: norecurse nounwind readnone
12 define dso_local signext i32 @test_ileus(i16 zeroext %a, i16 zeroext %b) {
13 ; CHECK-LABEL: test_ileus:
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 i16 %a, %b
21 %conv2 = zext i1 %cmp to i32
25 ; Function Attrs: norecurse nounwind readnone
26 define dso_local signext i32 @test_ileus_sext(i16 zeroext %a, i16 zeroext %b) {
27 ; CHECK-LABEL: test_ileus_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 i16 %a, %b
35 %sub = sext i1 %cmp to i32
39 ; Function Attrs: norecurse nounwind readnone
40 define dso_local signext i32 @test_ileus_z(i16 zeroext %a) {
41 ; CHECK-LABEL: test_ileus_z:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: cntlzw r3, r3
44 ; CHECK-NEXT: srwi r3, r3, 5
47 %cmp = icmp ule i16 %a, 0
48 %conv1 = zext i1 %cmp to i32
52 ; Function Attrs: norecurse nounwind readnone
53 define dso_local signext i32 @test_ileus_sext_z(i16 zeroext %a) {
54 ; CHECK-LABEL: test_ileus_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 ule i16 %a, 0
62 %sub = sext i1 %cmp to i32
66 ; Function Attrs: norecurse nounwind
67 define dso_local void @test_ileus_store(i16 zeroext %a, i16 zeroext %b) {
68 ; CHECK-LABEL: test_ileus_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: sth r3, glob@toc@l(r4)
77 %cmp = icmp ule i16 %a, %b
78 %conv3 = zext i1 %cmp to i16
79 store i16 %conv3, ptr @glob
83 ; Function Attrs: norecurse nounwind
84 define dso_local void @test_ileus_sext_store(i16 zeroext %a, i16 zeroext %b) {
85 ; CHECK-LABEL: test_ileus_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: sth r3, glob@toc@l(r4)
94 %cmp = icmp ule i16 %a, %b
95 %conv3 = sext i1 %cmp to i16
96 store i16 %conv3, ptr @glob
100 ; Function Attrs: norecurse nounwind
101 define dso_local void @test_ileus_z_store(i16 zeroext %a) {
102 ; CHECK-LABEL: test_ileus_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: sth r3, glob@toc@l(r4)
110 %cmp = icmp ule i16 %a, 0
111 %conv2 = zext i1 %cmp to i16
112 store i16 %conv2, ptr @glob
116 ; Function Attrs: norecurse nounwind
117 define dso_local void @test_ileus_sext_z_store(i16 zeroext %a) {
118 ; CHECK-LABEL: test_ileus_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: sth r3, glob@toc@l(r4)
127 %cmp = icmp ule i16 %a, 0
128 %conv2 = sext i1 %cmp to i16
129 store i16 %conv2, ptr @glob