1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -relocation-model=pic -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 -relocation-model=pic -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 8 9@glob = local_unnamed_addr global i8 0, align 1 10 11; Function Attrs: norecurse nounwind readnone 12define signext i32 @test_igtsc(i8 signext %a, i8 signext %b) { 13; CHECK-LABEL: test_igtsc: 14; CHECK: # %bb.0: # %entry 15; CHECK-NEXT: sub r3, r4, r3 16; CHECK-NEXT: rldicl r3, r3, 1, 63 17; CHECK-NEXT: blr 18entry: 19 %cmp = icmp sgt i8 %a, %b 20 %conv2 = zext i1 %cmp to i32 21 ret i32 %conv2 22} 23 24; Function Attrs: norecurse nounwind readnone 25define signext i32 @test_igtsc_sext(i8 signext %a, i8 signext %b) { 26; CHECK-LABEL: test_igtsc_sext: 27; CHECK: # %bb.0: # %entry 28; CHECK-NEXT: sub r3, r4, r3 29; CHECK-NEXT: sradi r3, r3, 63 30; CHECK-NEXT: blr 31entry: 32 %cmp = icmp sgt i8 %a, %b 33 %sub = sext i1 %cmp to i32 34 ret i32 %sub 35} 36 37; FIXME 38; Function Attrs: norecurse nounwind readnone 39define signext i32 @test_igtsc_z(i8 signext %a) { 40; CHECK-LABEL: test_igtsc_z: 41; CHECK: # %bb.0: # %entry 42; CHECK-NEXT: neg r3, r3 43; CHECK-NEXT: rldicl r3, r3, 1, 63 44; CHECK-NEXT: blr 45entry: 46 %cmp = icmp sgt i8 %a, 0 47 %conv1 = zext i1 %cmp to i32 48 ret i32 %conv1 49} 50 51; Function Attrs: norecurse nounwind readnone 52define signext i32 @test_igtsc_sext_z(i8 signext %a) { 53; CHECK-LABEL: test_igtsc_sext_z: 54; CHECK: # %bb.0: # %entry 55; CHECK-NEXT: neg r3, r3 56; CHECK-NEXT: sradi r3, r3, 63 57; CHECK-NEXT: blr 58entry: 59 %cmp = icmp sgt i8 %a, 0 60 %sub = sext i1 %cmp to i32 61 ret i32 %sub 62} 63 64; Function Attrs: norecurse nounwind 65define void @test_igtsc_store(i8 signext %a, i8 signext %b) { 66; CHECK-LABEL: test_igtsc_store: 67; CHECK: # %bb.0: # %entry 68; CHECK-NEXT: addis r5, r2, .LC0@toc@ha 69; CHECK-NEXT: sub r3, r4, r3 70; CHECK-NEXT: ld r5, .LC0@toc@l(r5) 71; CHECK-NEXT: rldicl r3, r3, 1, 63 72; CHECK-NEXT: stb r3, 0(r5) 73; CHECK-NEXT: blr 74entry: 75 %cmp = icmp sgt i8 %a, %b 76 %conv3 = zext i1 %cmp to i8 77 store i8 %conv3, i8* @glob, align 1 78 ret void 79} 80 81; Function Attrs: norecurse nounwind 82define void @test_igtsc_sext_store(i8 signext %a, i8 signext %b) { 83; CHECK-LABEL: test_igtsc_sext_store: 84; CHECK: # %bb.0: # %entry 85; CHECK-NEXT: addis r5, r2, .LC0@toc@ha 86; CHECK-NEXT: sub r3, r4, r3 87; CHECK-NEXT: ld r5, .LC0@toc@l(r5) 88; CHECK-NEXT: sradi r3, r3, 63 89; CHECK-NEXT: stb r3, 0(r5) 90; CHECK-NEXT: blr 91entry: 92 %cmp = icmp sgt i8 %a, %b 93 %conv3 = sext i1 %cmp to i8 94 store i8 %conv3, i8* @glob, align 1 95 ret void 96} 97 98; FIXME 99; Function Attrs: norecurse nounwind 100define void @test_igtsc_z_store(i8 signext %a) { 101; CHECK-LABEL: test_igtsc_z_store: 102; CHECK: # %bb.0: # %entry 103; CHECK-NEXT: addis r4, r2, .LC0@toc@ha 104; CHECK-NEXT: neg r3, r3 105; CHECK-NEXT: ld r4, .LC0@toc@l(r4) 106; CHECK-NEXT: rldicl r3, r3, 1, 63 107; CHECK-NEXT: stb r3, 0(r4) 108; CHECK-NEXT: blr 109entry: 110 %cmp = icmp sgt i8 %a, 0 111 %conv2 = zext i1 %cmp to i8 112 store i8 %conv2, i8* @glob, align 1 113 ret void 114} 115 116; Function Attrs: norecurse nounwind 117define void @test_igtsc_sext_z_store(i8 signext %a) { 118; CHECK-LABEL: test_igtsc_sext_z_store: 119; CHECK: # %bb.0: # %entry 120; CHECK-NEXT: addis r4, r2, .LC0@toc@ha 121; CHECK-NEXT: neg r3, r3 122; CHECK-NEXT: ld r4, .LC0@toc@l(r4) 123; CHECK-NEXT: sradi r3, r3, 63 124; CHECK-NEXT: stb r3, 0(r4) 125; CHECK-NEXT: blr 126entry: 127 %cmp = icmp sgt i8 %a, 0 128 %conv2 = sext i1 %cmp to i8 129 store i8 %conv2, i8* @glob, align 1 130 ret void 131} 132