blob: 19db29a50c99a54a937c5e32a1bb5dcb92a4c75f [file] [log] [blame]
Nemanja Ivanovic35db4f92017-09-23 12:53:03 +00001; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
Nemanja Ivanovicdb7e7702017-11-30 13:39:10 +00002; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
Nemanja Ivanovic35db4f92017-09-23 12:53:03 +00003; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
4; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
Nemanja Ivanovicdb7e7702017-11-30 13:39:10 +00005; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
Nemanja Ivanovic35db4f92017-09-23 12:53:03 +00006; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
7
8@glob = common local_unnamed_addr global i8 0, align 1
9
10; Function Attrs: norecurse nounwind readnone
11define signext i32 @test_iltuc(i8 zeroext %a, i8 zeroext %b) {
12; CHECK-LABEL: test_iltuc:
13; CHECK: sub [[REG:r[0-9]+]], r3, r4
14; CHECK-NEXT: rldicl r3, [[REG]], 1, 63
15; CHECK-NEXT: blr
16entry:
17 %cmp = icmp ult i8 %a, %b
18 %conv2 = zext i1 %cmp to i32
19 ret i32 %conv2
20}
21
22; Function Attrs: norecurse nounwind readnone
23define signext i32 @test_iltuc_sext(i8 zeroext %a, i8 zeroext %b) {
24; CHECK-LABEL: test_iltuc_sext:
25; CHECK: sub [[REG:r[0-9]+]], r3, r4
26; CHECK-NEXT: sradi r3, [[REG]], 63
27; CHECK-NEXT: blr
28entry:
29 %cmp = icmp ult i8 %a, %b
30 %sub = sext i1 %cmp to i32
31 ret i32 %sub
32}
33
34; Function Attrs: norecurse nounwind
35define void @test_iltuc_store(i8 zeroext %a, i8 zeroext %b) {
36; CHECK-LABEL: test_iltuc_store:
37; CHECK: sub [[REG:r[2-9]+]], r3, r4
38; CHECK: rldicl {{r[0-9]+}}, [[REG]], 1, 63
39entry:
40 %cmp = icmp ult i8 %a, %b
41 %conv3 = zext i1 %cmp to i8
42 store i8 %conv3, i8* @glob, align 1
43 ret void
44}
45
46; Function Attrs: norecurse nounwind
47define void @test_iltuc_sext_store(i8 zeroext %a, i8 zeroext %b) {
48; CHECK-LABEL: test_iltuc_sext_store:
49; CHECK: sub [[REG:r[0-9]+]], r3, r4
50; CHECK: sradi {{r[0-9]+}}, [[REG]], 63
51entry:
52 %cmp = icmp ult i8 %a, %b
53 %conv3 = sext i1 %cmp to i8
54 store i8 %conv3, i8* @glob, align 1
55 ret void
56}