[libc-commits] [PATCH] D106395: [libc] Include nextafter's functions to Windows's entrypoints
Hedin GarcĂa via Phabricator via libc-commits
libc-commits at lists.llvm.org
Tue Jul 20 13:58:35 PDT 2021
hedingarcia created this revision.
hedingarcia added reviewers: sivachandra, aeubanks.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added a project: libc-project.
hedingarcia requested review of this revision.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106395
Files:
libc/config/windows/entrypoints.txt
libc/test/src/math/NextAfterTest.h
Index: libc/test/src/math/NextAfterTest.h
===================================================================
--- libc/test/src/math/NextAfterTest.h
+++ libc/test/src/math/NextAfterTest.h
@@ -22,12 +22,8 @@
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());
Index: libc/config/windows/entrypoints.txt
===================================================================
--- libc/config/windows/entrypoints.txt
+++ libc/config/windows/entrypoints.txt
@@ -66,6 +66,9 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106395.360263.patch
Type: text/x-patch
Size: 1109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210720/297697be/attachment-0001.bin>
More information about the libc-commits
mailing list