[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
Jim Laskey
jlaskey at apple.com
Mon Aug 15 10:14:30 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PPC32ISelPattern.cpp updated: 1.139 -> 1.140
---
Log message:
Changed code gen for int to f32 to use rounding. This makes FP results
consistent with gcc.
---
Diffs of the changes: (+2 -2)
PPC32ISelPattern.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.139 llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.140
--- llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.139 Sun Aug 14 13:38:32 2005
+++ llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp Mon Aug 15 12:14:19 2005
@@ -2312,7 +2312,7 @@
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 @@
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;
}
More information about the llvm-commits
mailing list