1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \
3 ; RUN: -ppc-gpr-icmps=all -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-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
7 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl
9 @glob = dso_local local_unnamed_addr global i8 0, align 1
11 ; Function Attrs: norecurse nounwind readnone
12 define dso_local signext i32 @test_iltsc(i8 signext %a, i8 signext %b) {
13 ; CHECK-LABEL: test_iltsc:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: sub r3, r3, r4
16 ; CHECK-NEXT: rldicl r3, r3, 1, 63
19 %cmp = icmp slt i8 %a, %b
20 %conv2 = zext i1 %cmp to i32
24 ; Function Attrs: norecurse nounwind readnone
25 define dso_local signext i32 @test_iltsc_sext(i8 signext %a, i8 signext %b) {
26 ; CHECK-LABEL: test_iltsc_sext:
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: sub r3, r3, r4
29 ; CHECK-NEXT: sradi r3, r3, 63
32 %cmp = icmp slt i8 %a, %b
33 %sub = sext i1 %cmp to i32
37 ; Function Attrs: norecurse nounwind readnone
38 define dso_local signext i32 @test_iltsc_sext_z(i8 signext %a) {
39 ; CHECK-LABEL: test_iltsc_sext_z:
40 ; CHECK: # %bb.0: # %entry
41 ; CHECK-NEXT: srawi r3, r3, 31
44 %cmp = icmp slt i8 %a, 0
45 %sub = sext i1 %cmp to i32
49 ; Function Attrs: norecurse nounwind
50 define dso_local void @test_iltsc_store(i8 signext %a, i8 signext %b) {
51 ; CHECK-LABEL: test_iltsc_store:
52 ; CHECK: # %bb.0: # %entry
53 ; CHECK-NEXT: sub r3, r3, r4
54 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
55 ; CHECK-NEXT: rldicl r3, r3, 1, 63
56 ; CHECK-NEXT: stb r3, glob@toc@l(r4)
59 %cmp = icmp slt i8 %a, %b
60 %conv3 = zext i1 %cmp to i8
61 store i8 %conv3, ptr @glob, align 1
65 ; Function Attrs: norecurse nounwind
66 define dso_local void @test_iltsc_sext_store(i8 signext %a, i8 signext %b) {
67 ; CHECK-LABEL: test_iltsc_sext_store:
68 ; CHECK: # %bb.0: # %entry
69 ; CHECK-NEXT: sub r3, r3, r4
70 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
71 ; CHECK-NEXT: sradi r3, r3, 63
72 ; CHECK-NEXT: stb r3, glob@toc@l(r4)
75 %cmp = icmp slt i8 %a, %b
76 %conv3 = sext i1 %cmp to i8
77 store i8 %conv3, ptr @glob, align 1
81 ; Function Attrs: norecurse nounwind
82 define dso_local void @test_iltsc_sext_z_store(i8 signext %a) {
83 ; CHECK-LABEL: test_iltsc_sext_z_store:
84 ; CHECK: # %bb.0: # %entry
85 ; CHECK-NEXT: srwi r3, r3, 7
86 ; CHECK-NEXT: addis r4, r2, glob@toc@ha
87 ; CHECK-NEXT: stb r3, glob@toc@l(r4)
90 %cmp = icmp slt i8 %a, 0
91 %conv2 = sext i1 %cmp to i8
92 store i8 %conv2, ptr @glob, align 1