mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -626,13 +626,16 @@ bool BitcodeReader::ParseConstants() {
|
||||
if (Record.empty())
|
||||
return Error("Invalid FLOAT record");
|
||||
if (CurTy == Type::FloatTy)
|
||||
V = ConstantFP::get(CurTy, BitsToFloat(Record[0]));
|
||||
V = ConstantFP::get(CurTy, APFloat((float)BitsToDouble(Record[0])));
|
||||
else if (CurTy == Type::DoubleTy)
|
||||
V = ConstantFP::get(CurTy, BitsToDouble(Record[0]));
|
||||
// FIXME: Make long double constants work.
|
||||
else if (CurTy == Type::X86_FP80Ty ||
|
||||
CurTy == Type::FP128Ty || CurTy == Type::PPC_FP128Ty)
|
||||
assert(0 && "Long double constants not handled yet.");
|
||||
V = ConstantFP::get(CurTy, APFloat(BitsToDouble(Record[0])));
|
||||
// FIXME: Make long double constants work. BitsToDouble does not make it.
|
||||
else if (CurTy == Type::X86_FP80Ty)
|
||||
V = ConstantFP::get(CurTy, APFloat(BitsToDouble(Record[0])));
|
||||
else if (CurTy == Type::FP128Ty)
|
||||
V = ConstantFP::get(CurTy, APFloat(BitsToDouble(Record[0])));
|
||||
else if (CurTy == Type::PPC_FP128Ty)
|
||||
assert(0 && "PowerPC long double constants not handled yet.");
|
||||
else
|
||||
V = UndefValue::get(CurTy);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user