aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp3
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 34fca4d623..340125e761 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3215,7 +3215,8 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
const uint64_t zero[] = {0, 0};
APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero));
uint64_t x = 1ULL << ShiftAmt;
- (void)apf.convertFromInteger(&x, 1, false, APFloat::rmTowardZero);
+ (void)apf.convertFromInteger(&x, MVT::getSizeInBits(NVT), false,
+ APFloat::rmTowardZero);
Tmp2 = DAG.getConstantFP(apf, VT);
Tmp3 = DAG.getSetCC(TLI.getSetCCResultTy(),
Node->getOperand(0), Tmp2, ISD::SETLT);
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 92c0f2445b..042868d7bb 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1595,8 +1595,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
case ISD::SINT_TO_FP: {
const uint64_t zero[] = {0, 0};
APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero));
- (void)apf.convertFromInteger(&Val, 1, Opcode==ISD::SINT_TO_FP,
- APFloat::rmTowardZero);
+ (void)apf.convertFromInteger(&Val,
+ MVT::getSizeInBits(Operand.getValueType()),
+ Opcode==ISD::SINT_TO_FP,
+ APFloat::rmTowardZero);
return getConstantFP(apf, VT);
}
case ISD::BIT_CONVERT: