Bug 1660405 - remove unused mozilla::IsInfinite. r=sergesanspaille

Differential Revision: https://phabricator.services.mozilla.com/D173049
This commit is contained in:
Andi-Bogdan Postelnicu 2023-03-22 11:35:35 +00:00
Родитель 847a0f9d04
Коммит c4666f21f3
2 изменённых файлов: 6 добавлений и 23 удалений

Просмотреть файл

@ -155,16 +155,6 @@ struct FloatingPoint final : private detail::FloatingPointTrait<T> {
"all bits accounted for");
};
/** Determines whether a float/double is +Infinity or -Infinity. */
template <typename T>
static MOZ_ALWAYS_INLINE bool IsInfinite(T aValue) {
/* Infinities have all exponent bits set to 1 and an all-0 significand. */
typedef FloatingPoint<T> Traits;
typedef typename Traits::Bits Bits;
Bits bits = BitwiseCast<Bits>(aValue);
return (bits & ~Traits::kSignBit) == Traits::kExponentBits;
}
/** Determines whether a float/double is not NaN or infinite. */
template <typename T>
static MOZ_ALWAYS_INLINE bool IsFinite(T aValue) {

Просмотреть файл

@ -15,7 +15,6 @@ using mozilla::FuzzyEqualsAdditive;
using mozilla::FuzzyEqualsMultiplicative;
using mozilla::IsFinite;
using mozilla::IsFloat32Representable;
using mozilla::IsInfinite;
using mozilla::IsNegative;
using mozilla::IsNegativeZero;
using mozilla::IsPositiveZero;
@ -316,12 +315,9 @@ static void TestDoublesPredicates() {
A(!std::isnan(PositiveInfinity<double>()));
A(!std::isnan(NegativeInfinity<double>()));
A(IsInfinite(PositiveInfinity<double>()));
A(IsInfinite(NegativeInfinity<double>()));
A(!IsInfinite(UnspecifiedNaN<double>()));
A(!IsInfinite(0.0));
A(!IsInfinite(-0.0));
A(!IsInfinite(1.0));
A(std::isinf(PositiveInfinity<double>()));
A(std::isinf(NegativeInfinity<double>()));
A(!std::isinf(UnspecifiedNaN<double>()));
A(!IsFinite(PositiveInfinity<double>()));
A(!IsFinite(NegativeInfinity<double>()));
@ -415,12 +411,9 @@ static void TestFloatsPredicates() {
A(!std::isnan(PositiveInfinity<float>()));
A(!std::isnan(NegativeInfinity<float>()));
A(IsInfinite(PositiveInfinity<float>()));
A(IsInfinite(NegativeInfinity<float>()));
A(!IsInfinite(UnspecifiedNaN<float>()));
A(!IsInfinite(0.0f));
A(!IsInfinite(-0.0f));
A(!IsInfinite(1.0f));
A(std::isinf(PositiveInfinity<float>()));
A(std::isinf(NegativeInfinity<float>()));
A(!std::isinf(UnspecifiedNaN<float>()));
A(!IsFinite(PositiveInfinity<float>()));
A(!IsFinite(NegativeInfinity<float>()));