mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 15:48:38 +00:00
The testing to ensure a vector of zeros of type floating point isn't misclassified as negative zero can be simplified, as pointed out by Duncan Sands.
llvm-svn: 177386
This commit is contained in:
parent
2a3f174788
commit
5652836d44
@ -53,12 +53,9 @@ bool Constant::isNegativeZeroValue() const {
|
||||
if (SplatCFP && SplatCFP->isZero() && SplatCFP->isNegative())
|
||||
return true;
|
||||
|
||||
// However, vectors of zeroes which are floating point represent +0.0's.
|
||||
if (const ConstantAggregateZero *CAZ = dyn_cast<ConstantAggregateZero>(this))
|
||||
if (const VectorType *VT = dyn_cast<VectorType>(CAZ->getType()))
|
||||
if (VT->getElementType()->isFloatingPointTy())
|
||||
// As it's a CAZ, we know it's the zero bit-pattern (ie, +0.0) in each element.
|
||||
return false;
|
||||
// We've already handled true FP case; any other FP vectors can't represent -0.0.
|
||||
if (getType()->isFPOrFPVectorTy())
|
||||
return false;
|
||||
|
||||
// Otherwise, just use +0.0.
|
||||
return isNullValue();
|
||||
|
Loading…
Reference in New Issue
Block a user