blob: a8244e757b15d2b5b9a5e5fea48c1a8841ee8d02 [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 i64 @test_llltuc(i8 zeroext %a, i8 zeroext %b) {
12; CHECK-LABEL: test_llltuc:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000013; CHECK: # %bb.0: # %entry
Nemanja Ivanovic35db4f92017-09-23 12:53:03 +000014; CHECK-NEXT: sub [[REG:r[0-9]+]], r3, r4
15; CHECK-NEXT: rldicl r3, [[REG]], 1, 63
16; CHECK-NEXT: blr
17entry:
18 %cmp = icmp ult i8 %a, %b
19 %conv3 = zext i1 %cmp to i64
20 ret i64 %conv3
21}
22
23; Function Attrs: norecurse nounwind readnone
24define i64 @test_llltuc_sext(i8 zeroext %a, i8 zeroext %b) {
25; CHECK-LABEL: test_llltuc_sext:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000026; CHECK: # %bb.0: # %entry
Nemanja Ivanovic35db4f92017-09-23 12:53:03 +000027; CHECK-NEXT: sub [[REG:r[0-9]+]], r3, r4
28; CHECK-NEXT: sradi r3, [[REG]], 63
29; CHECK-NEXT: blr
30entry:
31 %cmp = icmp ult i8 %a, %b
32 %conv3 = sext i1 %cmp to i64
33 ret i64 %conv3
34}
35
36; Function Attrs: norecurse nounwind
37define void @test_llltuc_store(i8 zeroext %a, i8 zeroext %b) {
38; CHECK-LABEL: test_llltuc_store:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000039; CHECK: # %bb.0: # %entry
Nemanja Ivanovic35db4f92017-09-23 12:53:03 +000040; CHECK: sub [[REG:r[2-9]+]], r3, r4
41; CHECK: rldicl {{r[0-9]+}}, [[REG]], 1, 63
42entry:
43 %cmp = icmp ult i8 %a, %b
44 %conv3 = zext i1 %cmp to i8
45 store i8 %conv3, i8* @glob, align 1
46 ret void
47}
48
49; Function Attrs: norecurse nounwind
50define void @test_llltuc_sext_store(i8 zeroext %a, i8 zeroext %b) {
51; CHECK-LABEL: test_llltuc_sext_store:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000052; CHECK: # %bb.0: # %entry
Nemanja Ivanovic35db4f92017-09-23 12:53:03 +000053; CHECK: sub [[REG:r[0-9]+]], r3, r4
54; CHECK: sradi {{r[0-9]+}}, [[REG]], 63
55entry:
56 %cmp = icmp ult i8 %a, %b
57 %conv3 = sext i1 %cmp to i8
58 store i8 %conv3, i8* @glob, align 1
59 ret void
60}