diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-12 18:52:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-12 18:52:34 +0000 |
commit | 383203b0036b8fdeef8119975fdbbd528b760adb (patch) | |
tree | 09410ff18e133a950a7c8843e0916c238946e862 /lib/CodeGen | |
parent | dae2e9383b31cb3ff64b3a5c1b6fcd298ce7dff9 (diff) |
Fix uint->fp casts on PPC, allowing UnitTests/2005-05-12-Int64ToFP to
work on it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 2921ef4ff1..d62f507fb4 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2148,10 +2148,9 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) { SDOperand Zero = getIntPtrConstant(0), Four = getIntPtrConstant(4); SDOperand CstOffset = DAG.getNode(ISD::SELECT, Zero.getValueType(), SignSet, Four, Zero); - // FIXME: This is almost certainly broken for big-endian systems. Should - // this just put the fudge factor in the low bits of the uint64 constant or? - static Constant *FudgeFactor = - ConstantUInt::get(Type::ULongTy, 0x5f800000ULL << 32); + uint64_t FF = 0x5f800000ULL; + if (TLI.isLittleEndian()) FF <<= 32; + static Constant *FudgeFactor = ConstantUInt::get(Type::ULongTy, FF); MachineConstantPool *CP = DAG.getMachineFunction().getConstantPool(); SDOperand CPIdx = DAG.getConstantPool(CP->getConstantPoolIndex(FudgeFactor), |