mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57329 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -832,12 +832,13 @@ void CWriter::printConstantVector(ConstantVector *CP, bool Static) {
|
||||
// only deal in IEEE FP).
|
||||
//
|
||||
static bool isFPCSafeToPrint(const ConstantFP *CFP) {
|
||||
bool ignored;
|
||||
// Do long doubles in hex for now.
|
||||
if (CFP->getType()!=Type::FloatTy && CFP->getType()!=Type::DoubleTy)
|
||||
return false;
|
||||
APFloat APF = APFloat(CFP->getValueAPF()); // copy
|
||||
if (CFP->getType()==Type::FloatTy)
|
||||
APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven);
|
||||
APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored);
|
||||
#if HAVE_PRINTF_A && ENABLE_CBE_PRINTF_A
|
||||
char Buffer[100];
|
||||
sprintf(Buffer, "%a", APF.convertToDouble());
|
||||
|
Reference in New Issue
Block a user