summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-11-13 18:49:59 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-11-13 18:49:59 +0000
commita8173b934fdfdc7a3ca543a0734b7c8fa1969366 (patch)
tree8702e5e4fb29b7cde7e3d6d4fabbb86eb771765b /lib/Target/Mips/MipsISelDAGToDAG.cpp
parent01205a80f5c789234029813f8c09488891c0b23e (diff)
downloadllvm-a8173b934fdfdc7a3ca543a0734b7c8fa1969366.tar.gz
llvm-a8173b934fdfdc7a3ca543a0734b7c8fa1969366.tar.bz2
llvm-a8173b934fdfdc7a3ca543a0734b7c8fa1969366.tar.xz
Support fp64 immediate zero, this fixes only part of PR5445
because the testcase is triggering one more bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsISelDAGToDAG.cpp')
-rw-r--r--lib/Target/Mips/MipsISelDAGToDAG.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp
index a7216582fb..42e70bb720 100644
--- a/lib/Target/Mips/MipsISelDAGToDAG.cpp
+++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp
@@ -314,6 +314,16 @@ SDNode* MipsDAGToDAGISel::Select(SDValue N) {
case ISD::GLOBAL_OFFSET_TABLE:
return getGlobalBaseReg();
+ case ISD::ConstantFP: {
+ ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
+ if (N.getValueType() == MVT::f64 && CN->isExactlyValue(+0.0)) {
+ SDValue Zero = CurDAG->getRegister(Mips::ZERO, MVT::i32);
+ ReplaceUses(N, Zero);
+ return Zero.getNode();
+ }
+ break;
+ }
+
/// Handle direct and indirect calls when using PIC. On PIC, when
/// GOT is smaller than about 64k (small code) the GA target is
/// loaded with only one instruction. Otherwise GA's target must