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
7 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
9 @glob = common local_unnamed_addr global i32 0, align 4
11 ; Function Attrs: norecurse nounwind readnone
12 define signext i32 @test_iltsi(i32 signext %a, i32 signext %b) {
13 ; CHECK-LABEL: test_iltsi:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: sub [[REG:r[0-9]+]], r3, r4
16 ; CHECK-NEXT: rldicl r3, [[REG]], 1, 63
19 %cmp = icmp slt i32 %a, %b
20 %conv = zext i1 %cmp to i32
24 ; Function Attrs: norecurse nounwind readnone
25 define signext i32 @test_iltsi_sext(i32 signext %a, i32 signext %b) {
26 ; CHECK-LABEL: test_iltsi_sext:
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: sub [[REG:r[0-9]+]], r3, r4
29 ; CHECK-NEXT: sradi r3, [[REG]], 63
32 %cmp = icmp slt i32 %a, %b
33 %sub = sext i1 %cmp to i32
37 ; Function Attrs: norecurse nounwind readnone
38 define signext i32 @test_iltsi_sext_z(i32 signext %a) {
39 ; CHECK-LABEL: test_iltsi_sext_z:
40 ; CHECK: # %bb.0: # %entry
41 ; CHECK-NEXT: srawi r3, r3, 31
44 %cmp = icmp slt i32 %a, 0
45 %sub = sext i1 %cmp to i32
49 ; Function Attrs: norecurse nounwind
50 define void @test_iltsi_store(i32 signext %a, i32 signext %b) {
51 ; CHECK-LABEL: test_iltsi_store:
52 ; CHECK: # %bb.0: # %entry
53 ; CHECK: sub [[REG:r[0-9]+]], r3, r4
54 ; CHECK: rldicl {{r[0-9]+}}, [[REG]], 1, 63
56 %cmp = icmp slt i32 %a, %b
57 %conv = zext i1 %cmp to i32
58 store i32 %conv, i32* @glob, align 4
62 ; Function Attrs: norecurse nounwind
63 define void @test_iltsi_sext_store(i32 signext %a, i32 signext %b) {
64 ; CHECK-LABEL: test_iltsi_sext_store:
65 ; CHECK: # %bb.0: # %entry
66 ; CHECK: sub [[REG:r[0-9]+]], r3, r4
67 ; CHECK: sradi {{r[0-9]+}}, [[REG]], 63
69 %cmp = icmp slt i32 %a, %b
70 %sub = sext i1 %cmp to i32
71 store i32 %sub, i32* @glob, align 4
75 ; Function Attrs: norecurse nounwind
76 define void @test_iltsi_sext_z_store(i32 signext %a) {
77 ; CHECK-LABEL: test_iltsi_sext_z_store:
78 ; CHECK: srawi {{r[0-9]+}}, r3, 31
81 %cmp = icmp slt i32 %a, 0
82 %sub = sext i1 %cmp to i32
83 store i32 %sub, i32* @glob, align 4