1 ; RUN: llc -verify-machineinstrs -O2 -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
3 ; Function Attrs: norecurse nounwind
4 define void @test1(ptr noalias nocapture %a, ptr noalias nocapture readonly %b, ptr nocapture readnone %c, i32 signext %n) #0 {
9 %idxprom = sext i32 %n to i64
10 %arrayidx = getelementptr inbounds i32, ptr %b, i64 %idxprom
11 %0 = load i32, ptr %arrayidx, align 4, !tbaa !1
12 %conv = sitofp i32 %0 to float
13 %mul = fmul float %conv, 0x4002916880000000
14 %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %idxprom
15 store float %mul, ptr %arrayidx2, align 4, !tbaa !5
20 ; CHECK: lfiwax [[REG:[0-9]+]], {{.*}}
23 ; CHECK: xscvsxdsp {{.*}}, [[REG]]
30 ; Function Attrs: norecurse nounwind readonly
31 define float @test2(ptr nocapture readonly %b) #0 {
36 %0 = load i32, ptr %b, align 4, !tbaa !1
37 %conv = sitofp i32 %0 to float
38 %mul = fmul float %conv, 0x40030A3D80000000
43 ; CHECK: lfiwax [[REG:[0-9]+]], {{.*}}
46 ; CHECK: xscvsxdsp {{.*}}, [[REG]]
53 ; Function Attrs: norecurse nounwind
54 define void @test3(ptr noalias nocapture %a, ptr noalias nocapture readonly %b, ptr noalias nocapture %c, i32 signext %n) #0 {
59 %idxprom = sext i32 %n to i64
60 %arrayidx = getelementptr inbounds i32, ptr %b, i64 %idxprom
61 %0 = load i32, ptr %arrayidx, align 4, !tbaa !1
62 %conv = sitofp i32 %0 to float
63 %mul = fmul float %conv, 0x4002916880000000
64 %arrayidx2 = getelementptr inbounds float, ptr %a, i64 %idxprom
65 store float %mul, ptr %arrayidx2, align 4, !tbaa !5
66 %arrayidx6 = getelementptr inbounds i32, ptr %c, i64 %idxprom
67 %1 = load i32, ptr %arrayidx6, align 4, !tbaa !1
68 %add = add nsw i32 %1, %0
69 store i32 %add, ptr %arrayidx6, align 4, !tbaa !1
77 !0 = !{!"clang version 3.9.0"}
79 !2 = !{!"int", !3, i64 0}
80 !3 = !{!"omnipotent char", !4, i64 0}
81 !4 = !{!"Simple C++ TBAA"}
83 !6 = !{!"float", !3, i64 0}