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 i32 0, align 4
10 ; Function Attrs: norecurse nounwind readnone
11 define signext i32 @test_iltui(i32 zeroext %a, i32 zeroext %b) {
12 ; CHECK-LABEL: test_iltui:
13 ; CHECK: sub [[REG:r[0-9]+]], r3, r4
14 ; CHECK-NEXT: rldicl r3, [[REG]], 1, 63
17 %cmp = icmp ult i32 %a, %b
18 %conv = zext i1 %cmp to i32
22 ; Function Attrs: norecurse nounwind readnone
23 define signext i32 @test_iltui_sext(i32 zeroext %a, i32 zeroext %b) {
24 ; CHECK-LABEL: test_iltui_sext:
25 ; CHECK: sub [[REG:r[0-9]+]], r3, r4
26 ; CHECK-NEXT: sradi r3, [[REG]], 63
29 %cmp = icmp ult i32 %a, %b
30 %sub = sext i1 %cmp to i32
34 ; Function Attrs: norecurse nounwind
35 define void @test_iltui_store(i32 zeroext %a, i32 zeroext %b) {
36 ; CHECK-LABEL: test_iltui_store:
37 ; CHECK: sub [[REG:r[2-9]+]], r3, r4
38 ; CHECK: rldicl {{r[0-9]+}}, [[REG]], 1, 63
40 %cmp = icmp ult i32 %a, %b
41 %conv = zext i1 %cmp to i32
42 store i32 %conv, i32* @glob, align 4
46 ; Function Attrs: norecurse nounwind
47 define void @test_iltui_sext_store(i32 zeroext %a, i32 zeroext %b) {
48 ; CHECK-LABEL: test_iltui_sext_store:
49 ; CHECK: sub [[REG:r[0-9]+]], r3, r4
50 ; CHECK: sradi {{r[0-9]+}}, [[REG]], 63
52 %cmp = icmp ult i32 %a, %b
53 %sub = sext i1 %cmp to i32
54 store i32 %sub, i32* @glob, align 4