aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-11 18:32:33 +0000
committerDale Johannesen <dalej@apple.com>2007-09-11 18:32:33 +0000
commit3f6eb7419de437436265831fce92f62498556e08 (patch)
treecb752d4a86ec5c5dd783cfc421e30d0cf7600e87 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent6320260e060ce4fc5d199d757b15a0f43be66029 (diff)
Add APInt interfaces to APFloat (allows directly
access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 01ec5c968a..85a76f436b 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -109,13 +109,12 @@ bool ISD::isBuildVectorAllOnes(const SDNode *N) {
} else if (isa<ConstantFPSDNode>(NotZero)) {
MVT::ValueType VT = NotZero.getValueType();
if (VT== MVT::f64) {
- if (DoubleToBits(cast<ConstantFPSDNode>(NotZero)->
- getValueAPF().convertToDouble()) !=
- (uint64_t)-1)
+ if (*((cast<ConstantFPSDNode>(NotZero)->getValueAPF().
+ convertToAPInt().getRawData())) != (uint64_t)-1)
return false;
} else {
- if (FloatToBits(cast<ConstantFPSDNode>(NotZero)->
- getValueAPF().convertToFloat()) !=
+ if ((uint32_t)*cast<ConstantFPSDNode>(NotZero)->
+ getValueAPF().convertToAPInt().getRawData() !=
(uint32_t)-1)
return false;
}
@@ -1698,9 +1697,9 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
}
case ISD::BIT_CONVERT:
if (VT == MVT::i32 && C->getValueType(0) == MVT::f32)
- return getConstant(FloatToBits(V.convertToFloat()), VT);
+ return getConstant((uint32_t)*V.convertToAPInt().getRawData(), VT);
else if (VT == MVT::i64 && C->getValueType(0) == MVT::f64)
- return getConstant(DoubleToBits(V.convertToDouble()), VT);
+ return getConstant(*V.convertToAPInt().getRawData(), VT);
break;
}
}