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 i64 @test_llltuc(i8 zeroext %a, i8 zeroext %b) {
15 ; CHECK-LABEL: test_llltuc:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: sub r3, r3, r4
18 ; CHECK-NEXT: rldicl r3, r3, 1, 63
21 %cmp = icmp ult i8 %a, %b
22 %conv3 = zext i1 %cmp to i64
26 ; Function Attrs: norecurse nounwind readnone
27 define i64 @test_llltuc_sext(i8 zeroext %a, i8 zeroext %b) {
28 ; CHECK-LABEL: test_llltuc_sext:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: sub r3, r3, r4
31 ; CHECK-NEXT: sradi r3, r3, 63
34 %cmp = icmp ult i8 %a, %b
35 %conv3 = sext i1 %cmp to i64
39 ; Function Attrs: norecurse nounwind
40 define void @test_llltuc_store(i8 zeroext %a, i8 zeroext %b) {
41 ; BE-LABEL: test_llltuc_store:
42 ; BE: # %bb.0: # %entry
43 ; BE-NEXT: addis r5, r2, .LC0@toc@ha
44 ; BE-NEXT: sub r3, r3, r4
45 ; BE-NEXT: ld r5, .LC0@toc@l(r5)
46 ; BE-NEXT: rldicl r3, r3, 1, 63
47 ; BE-NEXT: stb r3, 0(r5)
50 ; LE-LABEL: test_llltuc_store:
51 ; LE: # %bb.0: # %entry
52 ; LE-NEXT: sub r3, r3, r4
53 ; LE-NEXT: addis r5, r2, glob@toc@ha
54 ; LE-NEXT: rldicl r3, r3, 1, 63
55 ; LE-NEXT: stb r3, glob@toc@l(r5)
58 %cmp = icmp ult i8 %a, %b
59 %conv3 = zext i1 %cmp to i8
60 store i8 %conv3, i8* @glob, align 1
64 ; Function Attrs: norecurse nounwind
65 define void @test_llltuc_sext_store(i8 zeroext %a, i8 zeroext %b) {
66 ; BE-LABEL: test_llltuc_sext_store:
67 ; BE: # %bb.0: # %entry
68 ; BE-NEXT: addis r5, r2, .LC0@toc@ha
69 ; BE-NEXT: sub r3, r3, r4
70 ; BE-NEXT: ld r5, .LC0@toc@l(r5)
71 ; BE-NEXT: sradi r3, r3, 63
72 ; BE-NEXT: stb r3, 0(r5)
75 ; LE-LABEL: test_llltuc_sext_store:
76 ; LE: # %bb.0: # %entry
77 ; LE-NEXT: sub r3, r3, r4
78 ; LE-NEXT: addis r5, r2, glob@toc@ha
79 ; LE-NEXT: sradi r3, r3, 63
80 ; LE-NEXT: stb r3, glob@toc@l(r5)
83 %cmp = icmp ult i8 %a, %b
84 %conv3 = sext i1 %cmp to i8
85 store i8 %conv3, i8* @glob, align 1