mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
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:
@ -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();
|
||||
|
Reference in New Issue
Block a user