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 i16 0, align 2
11 ; Function Attrs: norecurse nounwind readnone
12 define signext i32 @test_iltss(i16 signext %a, i16 signext %b) {
13 ; CHECK-LABEL: test_iltss:
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 i16 %a, %b
20 %conv2 = zext i1 %cmp to i32
24 ; Function Attrs: norecurse nounwind readnone
25 define signext i32 @test_iltss_sext(i16 signext %a, i16 signext %b) {
26 ; CHECK-LABEL: test_iltss_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 i16 %a, %b
33 %sub = sext i1 %cmp to i32
37 ; Function Attrs: norecurse nounwind readnone
38 define signext i32 @test_iltss_sext_z(i16 signext %a) {
39 ; CHECK-LABEL: test_iltss_sext_z:
40 ; CHECK: srawi r3, r3, 31
43 %cmp = icmp slt i16 %a, 0
44 %sub = sext i1 %cmp to i32
48 ; Function Attrs: norecurse nounwind
49 define void @test_iltss_store(i16 signext %a, i16 signext %b) {
50 ; CHECK-LABEL: test_iltss_store:
51 ; CHECK: # %bb.0: # %entry
52 ; CHECK: sub [[REG:r[0-9]+]], r3, r4
53 ; CHECK: rldicl {{r[0-9]+}}, [[REG]], 1, 63
55 %cmp = icmp slt i16 %a, %b
56 %conv3 = zext i1 %cmp to i16
57 store i16 %conv3, i16* @glob, align 2
61 ; Function Attrs: norecurse nounwind
62 define void @test_iltss_sext_store(i16 signext %a, i16 signext %b) {
63 ; CHECK-LABEL: test_iltss_sext_store:
64 ; CHECK: # %bb.0: # %entry
65 ; CHECK: sub [[REG:r[0-9]+]], r3, r4
66 ; CHECK: sradi {{r[0-9]+}}, [[REG]], 63
68 %cmp = icmp slt i16 %a, %b
69 %conv3 = sext i1 %cmp to i16
70 store i16 %conv3, i16* @glob, align 2
74 ; Function Attrs: norecurse nounwind
75 define void @test_iltss_sext_z_store(i16 signext %a) {
76 ; CHECK-LABEL: test_iltss_sext_z_store:
77 ; CHECK: srwi {{r[0-9]+}}, r3, 15
79 %cmp = icmp slt i16 %a, 0
80 %sub = sext i1 %cmp to i16
81 store i16 %sub, i16* @glob, align 2