convertFromInteger, as originally written, expected sign-extended

input.  APInt unfortunately zero-extends signed integers, so Dale
modified the function to expect zero-extended input.  Make this
assumption explicit in the function name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42732 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Neil Booth
2007-10-07 11:45:55 +00:00
parent 33d4c92e78
commit ccf596a53e
6 changed files with 14 additions and 12 deletions

View File

@ -396,7 +396,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
else if (CE->getType() == Type::X86_FP80Ty) {
const uint64_t zero[] = {0, 0};
APFloat apf = APFloat(APInt(80, 2, zero));
(void)apf.convertFromInteger(GV.IntVal.getRawData(),
(void)apf.convertFromZeroExtendedInteger(GV.IntVal.getRawData(),
GV.IntVal.getBitWidth(), false,
APFloat::rmNearestTiesToEven);
GV.IntVal = apf.convertToAPInt();
@ -412,7 +412,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
else if (CE->getType() == Type::X86_FP80Ty) {
const uint64_t zero[] = { 0, 0};
APFloat apf = APFloat(APInt(80, 2, zero));
(void)apf.convertFromInteger(GV.IntVal.getRawData(),
(void)apf.convertFromZeroExtendedInteger(GV.IntVal.getRawData(),
GV.IntVal.getBitWidth(), true,
APFloat::rmNearestTiesToEven);
GV.IntVal = apf.convertToAPInt();