summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-12 18:52:34 +0000
committerChris Lattner <sabre@nondot.org>2005-05-12 18:52:34 +0000
commit26f0317f46fd36de43397dbed1af722da818c2ea (patch)
treec47a258a86b05894df2d485a6c80f3c253bcfcad /llvm/lib/CodeGen/SelectionDAG
parentc932bef114a2aa93b8dc865e18bb928a45edeff3 (diff)
downloadbcm5719-llvm-26f0317f46fd36de43397dbed1af722da818c2ea.tar.gz
bcm5719-llvm-26f0317f46fd36de43397dbed1af722da818c2ea.zip
Fix uint->fp casts on PPC, allowing UnitTests/2005-05-12-Int64ToFP to
work on it. llvm-svn: 21894
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 2921ef4ff1a..d62f507fb42 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/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),
OpenPOWER on IntegriCloud