Incorporated the varied functions for nextafter and refactored
NextAfterTest.h to correctly define bitWidthOfType for both
Linux and Windows; by letting FloatProperties take care
of the directives' logic based on the platform being used.
This allows to successfully run nextafter's tests.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/
D106395
libc.src.math.modf
libc.src.math.modff
libc.src.math.modfl
+ libc.src.math.nextafter
+ libc.src.math.nextafterf
+ libc.src.math.nextafterl
)
set(TARGET_LLVMLIBC_ENTRYPOINTS
using MantissaWidth = __llvm_libc::fputil::MantissaWidth<T>;
using UIntType = typename FPBits::UIntType;
-#if (defined(__x86_64__) || defined(__i386__))
static constexpr int bitWidthOfType =
- __llvm_libc::cpp::IsSame<T, long double>::Value ? 80 : (sizeof(T) * 8);
-#else
- static constexpr int bitWidthOfType = sizeof(T) * 8;
-#endif
+ __llvm_libc::fputil::FloatProperties<T>::bitWidth;
const T zero = T(FPBits::zero());
const T negZero = T(FPBits::negZero());