summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-07-08 06:01:49 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-07-08 06:01:49 +0000
commitbe1f7a931efed26bfa761c33202828ccef2a2adb (patch)
tree2c724115369dac44c391d318a000ee1ff30aa53c /llvm/lib
parent89a4e25007de36b0f00ad7226b261e7ad6bfad37 (diff)
downloadbcm5719-llvm-be1f7a931efed26bfa761c33202828ccef2a2adb.tar.gz
bcm5719-llvm-be1f7a931efed26bfa761c33202828ccef2a2adb.zip
r107852 is only safe with -enable-unsafe-fp-math to account for +0.0 == -0.0.
llvm-svn: 107856
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index e3db5832980..8ca69cd6122 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -2295,11 +2295,13 @@ SDValue
ARMTargetLowering::getVFPCmp(SDValue &LHS, SDValue &RHS, ISD::CondCode CC,
SDValue &ARMCC, SelectionDAG &DAG,
DebugLoc dl) const {
- if ((CC == ISD::SETEQ || CC == ISD::SETOEQ ||
+ if (UnsafeFPMath &&
+ (CC == ISD::SETEQ || CC == ISD::SETOEQ ||
CC == ISD::SETNE || CC == ISD::SETUNE) &&
canBitcastToInt(LHS.getNode()) && canBitcastToInt(RHS.getNode())) {
- // If there are no othter uses of the CMP operands, and the condition
- // code is EQ oe NE, we can optimize it to an integer comparison.
+ // If unsafe fp math optimization is enabled and there are no othter uses of
+ // the CMP operands, and the condition code is EQ oe NE, we can optimize it
+ // to an integer comparison.
if (CC == ISD::SETOEQ)
CC = ISD::SETEQ;
else if (CC == ISD::SETUNE)
OpenPOWER on IntegriCloud