[llvm-commits] [llvm] r47932 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp LegalizeTypesExpand.cpp
Dan Gohman
gohman at apple.com
Tue Mar 4 18:07:31 PST 2008
Author: djg
Date: Tue Mar 4 20:07:31 2008
New Revision: 47932
URL: http://llvm.org/viewvc/llvm-project?rev=47932&view=rev
Log:
Codegen support for i128 UINT_TO_FP. This just fixes a
bug in r47928 (Int64Ty is the correct type for the constant
pool entry here) and removes the asserts, now that the code
is capable of handling i128.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=47932&r1=47931&r2=47932&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Mar 4 20:07:31 2008
@@ -5281,9 +5281,7 @@
"This is not an expansion!");
if (!isSigned) {
- assert(SourceVT == MVT::i64 &&
- "This only works for 64-bit -> FP");
- // The 64-bit value loaded will be incorrectly if the 'sign bit' of the
+ // The integer value loaded will be incorrectly if the 'sign bit' of the
// incoming integer is set. To handle this, we dynamically test to see if
// it is set, and, if so, add a fudge factor.
SDOperand Lo, Hi;
@@ -5302,8 +5300,7 @@
SignSet, Four, Zero);
uint64_t FF = 0x5f800000ULL;
if (TLI.isLittleEndian()) FF <<= 32;
- static Constant *FudgeFactor =
- ConstantInt::get(IntegerType::get(Source.getValueSizeInBits()), FF);
+ static Constant *FudgeFactor = ConstantInt::get(Type::Int64Ty, FF);
SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy());
CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=47932&r1=47931&r2=47932&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Tue Mar 4 20:07:31 2008
@@ -1020,7 +1020,6 @@
// We know the destination is legal, but that the input needs to be expanded.
assert(getTypeAction(Source.getValueType()) == Expand &&
"This is not an expansion!");
- assert(Source.getValueType() == MVT::i64 && "Only handle expand from i64!");
// If this is unsigned, and not supported, first perform the conversion to
// signed, then adjust the result if the sign bit is set.
More information about the llvm-commits
mailing list