1 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
2 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
3 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
5 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
6 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
8 @glob = common local_unnamed_addr global i16 0, align 2
10 ; Function Attrs: norecurse nounwind readnone
11 define signext i32 @test_igeus(i16 zeroext %a, i16 zeroext %b) {
13 %cmp = icmp uge i16 %a, %b
14 %conv2 = zext i1 %cmp to i32
16 ; CHECK-LABEL: test_igeus:
17 ; CHECK: sub [[REG1:r[0-9]+]], r3, r4
18 ; CHECK-NEXT: not [[REG2:r[0-9]+]], [[REG1]]
19 ; CHECK-NEXT: rldicl r3, [[REG2]], 1, 63
23 ; Function Attrs: norecurse nounwind readnone
24 define signext i32 @test_igeus_sext(i16 zeroext %a, i16 zeroext %b) {
26 %cmp = icmp uge i16 %a, %b
27 %sub = sext i1 %cmp to i32
29 ; CHECK-LABEL: @test_igeus_sext
30 ; CHECK: sub [[REG1:r[0-9]+]], r3, r4
31 ; CHECK-NEXT: rldicl [[REG2:r[0-9]+]], [[REG1]], 1, 63
32 ; CHECK-NEXT: addi [[REG3:r[0-9]+]], [[REG2]], -1
36 ; Function Attrs: norecurse nounwind readnone
37 define signext i32 @test_igeus_z(i16 zeroext %a) {
39 %cmp = icmp uge i16 %a, 0
40 %conv2 = zext i1 %cmp to i32
42 ; CHECK-LABEL: @test_igeus_z
47 ; Function Attrs: norecurse nounwind readnone
48 define signext i32 @test_igeus_sext_z(i16 zeroext %a) {
50 %cmp = icmp uge i16 %a, 0
51 %conv2 = zext i1 %cmp to i32
53 ; CHECK-LABEL: @test_igeus_sext_z
58 ; Function Attrs: norecurse nounwind
59 define void @test_igeus_store(i16 zeroext %a, i16 zeroext %b) {
61 %cmp = icmp uge i16 %a, %b
62 %conv3 = zext i1 %cmp to i16
63 store i16 %conv3, i16* @glob
65 ; CHECK_LABEL: test_igeus_store:
66 ; CHECK: sub [[REG1:r[0-9]+]], r3, r4
67 ; CHECK: not [[REG2:r[0-9]+]], [[REG1]]
68 ; CHECK-NEXT: rldicl r3, [[REG2]], 1, 63
72 ; Function Attrs: norecurse nounwind
73 define void @test_igeus_sext_store(i16 zeroext %a, i16 zeroext %b) {
75 %cmp = icmp uge i16 %a, %b
76 %conv3 = sext i1 %cmp to i16
77 store i16 %conv3, i16* @glob
79 ; CHECK-LABEL: @test_igeus_sext_store
80 ; CHECK: sub [[REG1:r[0-9]+]], r3, r4
81 ; CHECK: rldicl [[REG2:r[0-9]+]], [[REG1]], 1, 63
82 ; CHECK: addi [[REG3:r[0-9]+]], [[REG2]], -1
87 ; Function Attrs: norecurse nounwind
88 define void @test_igeus_z_store(i16 zeroext %a) {
90 %cmp = icmp uge i16 %a, 0
91 %conv3 = zext i1 %cmp to i16
92 store i16 %conv3, i16* @glob
94 ; CHECK-LABEL: @test_igeus_z_store
95 ; CHECK: li [[REG1:r[0-9]+]], 1
100 ; Function Attrs: norecurse nounwind
101 define void @test_igeus_sext_z_store(i16 zeroext %a) {
103 %cmp = icmp uge i16 %a, 0
104 %conv3 = sext i1 %cmp to i16
105 store i16 %conv3, i16* @glob
107 ; CHECK-LABEL: @test_igeus_sext_z_store
108 ; CHECK: li [[REG1:r[0-9]+]], -1
109 ; CHECK: sth [[REG1]]