convertFromInteger, as originally written, expected sign-extended
[oota-llvm.git] / lib / VMCore / ConstantFold.cpp
index 72077db378077fc577d3a3bac088a290dd8e82a6..8234900032cf51917f767bdff286ca2ef384b043 100644 (file)
@@ -216,7 +216,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
       uint32_t BitWidth = cast<IntegerType>(SrcTy)->getBitWidth();
       APFloat apf = APFloat(APInt(DestTy->getPrimitiveSizeInBits(),
                                   2, zero));
-      (void)apf.convertFromInteger(api.getRawData(), BitWidth, 
+      (void)apf.convertFromZeroExtendedInteger(api.getRawData(), BitWidth, 
                                    opc==Instruction::SIToFP,
                                    APFloat::rmNearestTiesToEven);
       return ConstantFP::get(DestTy, apf);