mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Change APFloat::convertFromInteger to take the incoming
bit width instead of number of words allocated, which makes it actually work for int->APF conversions. Adjust callers. Add const to one of the APInt constructors to prevent surprising match when called with const argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -393,10 +393,11 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
|
||||
GV.FloatVal = float(GV.IntVal.roundToDouble());
|
||||
else if (CE->getType() == Type::DoubleTy)
|
||||
GV.DoubleVal = GV.IntVal.roundToDouble();
|
||||
else if (CE->getType() == Type::X86_FP80Ty) {
|
||||
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(), 2, false,
|
||||
(void)apf.convertFromInteger(GV.IntVal.getRawData(),
|
||||
GV.IntVal.getBitWidth(), false,
|
||||
APFloat::rmTowardZero);
|
||||
GV.IntVal = apf.convertToAPInt();
|
||||
}
|
||||
@@ -411,7 +412,8 @@ 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(), 2, true,
|
||||
(void)apf.convertFromInteger(GV.IntVal.getRawData(),
|
||||
GV.IntVal.getBitWidth(), true,
|
||||
APFloat::rmTowardZero);
|
||||
GV.IntVal = apf.convertToAPInt();
|
||||
}
|
||||
|
Reference in New Issue
Block a user