Bug 1660405 - Transform mozilla::IsNegative to use std implementation. r=glandium

Since we cannot move away from mozilla::IsNegative to std::signbit because the
first one doesn't accept a NaN we should transform our function to use std implementation.

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

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

@ -162,12 +162,7 @@ struct FloatingPoint final : private detail::FloatingPointTrait<T> {
template <typename T>
static MOZ_ALWAYS_INLINE bool IsNegative(T aValue) {
MOZ_ASSERT(!std::isnan(aValue), "NaN does not have a sign");
/* The sign bit is set if the double is negative. */
typedef FloatingPoint<T> Traits;
typedef typename Traits::Bits Bits;
Bits bits = BitwiseCast<Bits>(aValue);
return (bits & Traits::kSignBit) != 0;
return std::signbit(aValue);
}
/** Determines whether a float/double represents -0. */