Revert r60042. IndVarSimplify should check if APFloat is PPCDoubleDouble first before trying to convert it to an integer.

llvm-svn: 60072
This commit is contained in:
Evan Cheng 2008-11-26 01:11:57 +00:00
parent 22d4b885fd
commit 496b042e20
2 changed files with 3 additions and 7 deletions

View File

@ -117,11 +117,6 @@ namespace {
&& "Compile-time arithmetic does not support these semantics");
}
static inline bool
isArithmeticOk(const llvm::fltSemantics &semantics) {
return semantics.arithmeticOK;
}
/* Return the value of a decimal exponent of the form
[+-]ddddddd.
@ -1792,8 +1787,7 @@ APFloat::convertToSignExtendedInteger(integerPart *parts, unsigned int width,
const integerPart *src;
unsigned int dstPartsCount, truncatedBits;
if (!isArithmeticOk(*semantics))
return opInvalidOp;
assertArithmeticOK(*semantics);
*isExact = false;

View File

@ -742,6 +742,8 @@ static bool useSIToFPInst(ConstantFP &InitV, ConstantFP &ExitV,
static bool convertToInt(const APFloat &APF, uint64_t *intVal) {
bool isExact = false;
if (&APF.getSemantics() == &APFloat::PPCDoubleDouble)
return false;
if (APF.convertToInteger(intVal, 32, APF.isNegative(),
APFloat::rmTowardZero, &isExact)
!= APFloat::opOK)