[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu May 12 11:52:52 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.112 -> 1.113
---
Log message:

Fix uint->fp casts on PPC, allowing UnitTests/2005-05-12-Int64ToFP to 
work on it.


---
Diffs of the changes:  (+3 -4)

 LegalizeDAG.cpp |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.112 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.113
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.112	Thu May 12 11:53:42 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Thu May 12 13:52:34 2005
@@ -2148,10 +2148,9 @@
     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),






More information about the llvm-commits mailing list