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: --check-prefixes=CHECK,BE
6 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \
7 ; RUN: -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \
8 ; RUN: --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl \
9 ; RUN: --check-prefixes=CHECK,LE
11 @glob = local_unnamed_addr global i8 0, align 1
13 ; Function Attrs: norecurse nounwind readnone
14 define signext i32 @test_iltsc(i8 signext %a, i8 signext %b) {
15 ; CHECK-LABEL: test_iltsc:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: sub r3, r3, r4
18 ; CHECK-NEXT: rldicl r3, r3, 1, 63
21 %cmp = icmp slt i8 %a, %b
22 %conv2 = zext i1 %cmp to i32
26 ; Function Attrs: norecurse nounwind readnone
27 define signext i32 @test_iltsc_sext(i8 signext %a, i8 signext %b) {
28 ; CHECK-LABEL: test_iltsc_sext:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: sub r3, r3, r4
31 ; CHECK-NEXT: sradi r3, r3, 63
34 %cmp = icmp slt i8 %a, %b
35 %sub = sext i1 %cmp to i32
39 ; Function Attrs: norecurse nounwind readnone
40 define signext i32 @test_iltsc_sext_z(i8 signext %a) {
41 ; CHECK-LABEL: test_iltsc_sext_z:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: srawi r3, r3, 31
46 %cmp = icmp slt i8 %a, 0
47 %sub = sext i1 %cmp to i32
51 ; Function Attrs: norecurse nounwind
52 define void @test_iltsc_store(i8 signext %a, i8 signext %b) {
53 ; BE-LABEL: test_iltsc_store:
54 ; BE: # %bb.0: # %entry
55 ; BE-NEXT: addis r5, r2, .LC0@toc@ha
56 ; BE-NEXT: sub r3, r3, r4
57 ; BE-NEXT: ld r5, .LC0@toc@l(r5)
58 ; BE-NEXT: rldicl r3, r3, 1, 63
59 ; BE-NEXT: stb r3, 0(r5)
62 ; LE-LABEL: test_iltsc_store:
63 ; LE: # %bb.0: # %entry
64 ; LE-NEXT: sub r3, r3, r4
65 ; LE-NEXT: addis r5, r2, glob@toc@ha
66 ; LE-NEXT: rldicl r3, r3, 1, 63
67 ; LE-NEXT: stb r3, glob@toc@l(r5)
70 %cmp = icmp slt i8 %a, %b
71 %conv3 = zext i1 %cmp to i8
72 store i8 %conv3, i8* @glob, align 1
76 ; Function Attrs: norecurse nounwind
77 define void @test_iltsc_sext_store(i8 signext %a, i8 signext %b) {
78 ; BE-LABEL: test_iltsc_sext_store:
79 ; BE: # %bb.0: # %entry
80 ; BE-NEXT: addis r5, r2, .LC0@toc@ha
81 ; BE-NEXT: sub r3, r3, r4
82 ; BE-NEXT: ld r5, .LC0@toc@l(r5)
83 ; BE-NEXT: sradi r3, r3, 63
84 ; BE-NEXT: stb r3, 0(r5)
87 ; LE-LABEL: test_iltsc_sext_store:
88 ; LE: # %bb.0: # %entry
89 ; LE-NEXT: sub r3, r3, r4
90 ; LE-NEXT: addis r5, r2, glob@toc@ha
91 ; LE-NEXT: sradi r3, r3, 63
92 ; LE-NEXT: stb r3, glob@toc@l(r5)
95 %cmp = icmp slt i8 %a, %b
96 %conv3 = sext i1 %cmp to i8
97 store i8 %conv3, i8* @glob, align 1
101 ; Function Attrs: norecurse nounwind
102 define void @test_iltsc_sext_z_store(i8 signext %a) {
103 ; BE-LABEL: test_iltsc_sext_z_store:
104 ; BE: # %bb.0: # %entry
105 ; BE-NEXT: addis r4, r2, .LC0@toc@ha
106 ; BE-NEXT: srwi r3, r3, 7
107 ; BE-NEXT: ld r4, .LC0@toc@l(r4)
108 ; BE-NEXT: stb r3, 0(r4)
111 ; LE-LABEL: test_iltsc_sext_z_store:
112 ; LE: # %bb.0: # %entry
113 ; LE-NEXT: addis r4, r2, glob@toc@ha
114 ; LE-NEXT: srwi r3, r3, 7
115 ; LE-NEXT: stb r3, glob@toc@l(r4)
118 %cmp = icmp slt i8 %a, 0
119 %conv2 = sext i1 %cmp to i8
120 store i8 %conv2, i8* @glob, align 1