signbitf is implemented here with get_sign util.
Unit tests added. Different from existing functions, signbit output type is bool, so MPFRUtils expose the MPFR signbit function for unit test comparison instead of using (EXPECT/ASSERT)_MPFR_MATCH.
Paths
| Differential D139064
Onboard signbitf to llvmlibc math functions. Needs ReviewPublic Authored by renyichen on Nov 30 2022, 4:55 PM.
Details
Summary signbitf is implemented here with get_sign util. Unit tests added. Different from existing functions, signbit output type is bool, so MPFRUtils expose the MPFR signbit function for unit test comparison instead of using (EXPECT/ASSERT)_MPFR_MATCH.
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 30 2022, 4:55 PM Comment Actions Exhaustive/Performance tests might not be applicable for signbit. If desired, we may patch it here. sivachandra added inline comments.
Comment Actions fputil vs builtin functions.
Revision Contents
Diff 479124 libc/config/linux/aarch64/entrypoints.txt
libc/config/linux/x86_64/entrypoints.txt
libc/spec/stdc.td
libc/src/__support/FPUtil/ManipulationFunctions.h
libc/src/math/CMakeLists.txt
libc/src/math/generic/CMakeLists.txt
libc/src/math/generic/signbitf.cpp
libc/src/math/signbitf.h
libc/test/src/math/CMakeLists.txt
libc/test/src/math/SignBitTest.h
libc/test/src/math/signbitf_test.cpp
libc/utils/MPFRWrapper/MPFRUtils.h
libc/utils/MPFRWrapper/MPFRUtils.cpp
|
Is signbitf really specified by the C standard? For that matter, any standard at all? I think standards only specify a generic signbit macro which can be implemented as: