summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2005-08-15 17:14:19 +0000
committerJim Laskey <jlaskey@mac.com>2005-08-15 17:14:19 +0000
commit42623a95390002b63ae09748c1c0b2a5f211d257 (patch)
treeb501a07f2653546f112fbf4467f75a590ad502e1 /llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
parentb65b1568ae1802128783ef523c7796b6950c5bea (diff)
downloadbcm5719-llvm-42623a95390002b63ae09748c1c0b2a5f211d257.tar.gz
bcm5719-llvm-42623a95390002b63ae09748c1c0b2a5f211d257.zip
Changed code gen for int to f32 to use rounding. This makes FP results
consistent with gcc. llvm-svn: 22791
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp b/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
index 9831111eabc..f632d0ebf04 100644
--- a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32ISelPattern.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;
}
OpenPOWER on IntegriCloud