[libc-commits] [libc] efa2115 - [libc] Include nextafter's functions to Windows's entrypoints
Hedin GarcĂa via libc-commits
libc-commits at lists.llvm.org
Wed Jul 21 06:28:32 PDT 2021
Author: Hedin Garca
Date: 2021-07-21T13:28:01Z
New Revision: efa2115266895419352535ea2a259f93002a1d23
URL: https://github.com/llvm/llvm-project/commit/efa2115266895419352535ea2a259f93002a1d23
DIFF: https://github.com/llvm/llvm-project/commit/efa2115266895419352535ea2a259f93002a1d23.diff
LOG: [libc] Include nextafter's functions to Windows's entrypoints
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
Added:
Modified:
libc/config/windows/entrypoints.txt
libc/test/src/math/NextAfterTest.h
Removed:
################################################################################
diff --git a/libc/config/windows/entrypoints.txt b/libc/config/windows/entrypoints.txt
index e0706b0a82ae2..9ef14fe77edc0 100644
--- a/libc/config/windows/entrypoints.txt
+++ b/libc/config/windows/entrypoints.txt
@@ -66,6 +66,9 @@ set(TARGET_LIBM_ENTRYPOINTS
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
diff --git a/libc/test/src/math/NextAfterTest.h b/libc/test/src/math/NextAfterTest.h
index 4fa135d9cb259..aea03154c90ae 100644
--- a/libc/test/src/math/NextAfterTest.h
+++ b/libc/test/src/math/NextAfterTest.h
@@ -22,12 +22,8 @@ class NextAfterTestTemplate : public __llvm_libc::testing::Test {
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());
More information about the libc-commits
mailing list