mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +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:
@ -527,9 +527,10 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
|
||||
Code = bitc::CST_CODE_FLOAT;
|
||||
const Type *Ty = CFP->getType();
|
||||
if (Ty == Type::FloatTy) {
|
||||
Record.push_back(FloatToBits((float)CFP->getValue()));
|
||||
Record.push_back(DoubleToBits((double)CFP->getValueAPF().
|
||||
convertToFloat()));
|
||||
} else if (Ty == Type::DoubleTy) {
|
||||
Record.push_back(DoubleToBits((double)CFP->getValue()));
|
||||
Record.push_back(DoubleToBits(CFP->getValueAPF().convertToDouble()));
|
||||
// FIXME: make long double constants work.
|
||||
} else if (Ty == Type::X86_FP80Ty ||
|
||||
Ty == Type::FP128Ty || Ty == Type::PPC_FP128Ty) {
|
||||
|
Reference in New Issue
Block a user