"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;
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);
// 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.