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