diff options
author | Jim Laskey <jlaskey@mac.com> | 2005-08-15 17:14:19 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2005-08-15 17:14:19 +0000 |
commit | 30679e691db00a613e90ef01416aab2d4b371c0c (patch) | |
tree | bbe29df525b746339baad7d879457548bb19241f /lib/Target/PowerPC/PPCISelPattern.cpp | |
parent | d228427f87bb352543f63658ca57fa7bf4bb89de (diff) |
Changed code gen for int to f32 to use rounding. This makes FP results
consistent with gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCISelPattern.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCISelPattern.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCISelPattern.cpp b/lib/Target/PowerPC/PPCISelPattern.cpp index 9831111eab..f632d0ebf0 100644 --- a/lib/Target/PowerPC/PPCISelPattern.cpp +++ b/lib/Target/PowerPC/PPCISelPattern.cpp @@ -2312,7 +2312,7 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) { addFrameReference(BuildMI(BB, PPC::STW, 3).addReg(Tmp1), FrameIdx, 4); addFrameReference(BuildMI(BB, PPC::LFD, 2, Tmp2), FrameIdx); // Generate the return value with a subtract - BuildMI(BB, PPC::FSUB, 2, Result).addReg(Tmp2).addReg(ConstF); + BuildMI(BB, DestType == MVT::f64 ? PPC::FSUB : PPC::FSUBS, 2, Result).addReg(Tmp2).addReg(ConstF); } else { unsigned ConstF = getConstDouble(0x1.000008p52); unsigned TmpL = MakeIntReg(); @@ -2323,7 +2323,7 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) { addFrameReference(BuildMI(BB, PPC::STW, 3).addReg(TmpL), FrameIdx, 4); addFrameReference(BuildMI(BB, PPC::LFD, 2, Tmp2), FrameIdx); // Generate the return value with a subtract - BuildMI(BB, PPC::FSUB, 2, Result).addReg(Tmp2).addReg(ConstF); + BuildMI(BB, DestType == MVT::f64 ? PPC::FSUB : PPC::FSUBS, 2, Result).addReg(Tmp2).addReg(ConstF); } return Result; } |