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_igeus(i16 zeroext %a, i16 zeroext %b) {
13 ; CHECK-LABEL: test_igeus:
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 i16 %a, %b
21 %conv2 = zext i1 %cmp to i32
25 ; Function Attrs: norecurse nounwind readnone
26 define dso_local signext i32 @test_igeus_sext(i16 zeroext %a, i16 zeroext %b) {
27 ; CHECK-LABEL: test_igeus_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 i16 %a, %b
35 %sub = sext i1 %cmp to i32
39 ; Function Attrs: norecurse nounwind readnone
40 define dso_local signext i32 @test_igeus_z(i16 zeroext %a) {
41 ; CHECK-LABEL: test_igeus_z:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: li r3, 1
46 %cmp = icmp uge i16 %a, 0
47 %conv2 = zext i1 %cmp to i32
51 ; Function Attrs: norecurse nounwind readnone
52 define dso_local signext i32 @test_igeus_sext_z(i16 zeroext %a) {
53 ; CHECK-LABEL: test_igeus_sext_z:
54 ; CHECK: # %bb.0: # %entry
55 ; CHECK-NEXT: li r3, 1
58 %cmp = icmp uge i16 %a, 0
59 %conv2 = zext i1 %cmp to i32
63 ; Function Attrs: norecurse nounwind
64 define dso_local void @test_igeus_store(i16 zeroext %a, i16 zeroext %b) {
65 ; CHECK-LABEL: test_igeus_store:
66 ; CHECK: # %bb.0: # %entry
67 ; CHECK-NEXT: sub r3, r3, r4
68 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
69 ; CHECK-NEXT: not r3, r3
70 ; CHECK-NEXT: rldicl r3, r3, 1, 63
71 ; CHECK-NEXT: sth r3, glob@toc@l(r4)
74 %cmp = icmp uge i16 %a, %b
75 %conv3 = zext i1 %cmp to i16
76 store i16 %conv3, ptr @glob
80 ; Function Attrs: norecurse nounwind
81 define dso_local void @test_igeus_sext_store(i16 zeroext %a, i16 zeroext %b) {
82 ; CHECK-LABEL: test_igeus_sext_store:
83 ; CHECK: # %bb.0: # %entry
84 ; CHECK-NEXT: sub r3, r3, r4
85 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
86 ; CHECK-NEXT: rldicl r3, r3, 1, 63
87 ; CHECK-NEXT: addi r3, r3, -1
88 ; CHECK-NEXT: sth r3, glob@toc@l(r4)
91 %cmp = icmp uge i16 %a, %b
92 %conv3 = sext i1 %cmp to i16
93 store i16 %conv3, ptr @glob
97 ; Function Attrs: norecurse nounwind
98 define dso_local void @test_igeus_z_store(i16 zeroext %a) {
99 ; CHECK-LABEL: test_igeus_z_store:
100 ; CHECK: # %bb.0: # %entry
101 ; CHECK-NEXT: addis r3, r2, glob@toc@ha
102 ; CHECK-NEXT: li r4, 1
103 ; CHECK-NEXT: sth r4, glob@toc@l(r3)
106 %cmp = icmp uge i16 %a, 0
107 %conv3 = zext i1 %cmp to i16
108 store i16 %conv3, ptr @glob
112 ; Function Attrs: norecurse nounwind
113 define dso_local void @test_igeus_sext_z_store(i16 zeroext %a) {
114 ; CHECK-LABEL: test_igeus_sext_z_store:
115 ; CHECK: # %bb.0: # %entry
116 ; CHECK-NEXT: addis r3, r2, glob@toc@ha
117 ; CHECK-NEXT: li r4, -1
118 ; CHECK-NEXT: sth r4, glob@toc@l(r3)
121 %cmp = icmp uge i16 %a, 0
122 %conv3 = sext i1 %cmp to i16
123 store i16 %conv3, ptr @glob