Skip to content

[libc][NFC] Remove DEFAULT_DOUBLE_SPLIT macro. #126822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions libc/src/__support/FPUtil/double_double.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
namespace LIBC_NAMESPACE_DECL {
namespace fputil {

#define DEFAULT_DOUBLE_SPLIT 27

template <typename T> struct DefaultSplit;
template <> struct DefaultSplit<float> {
static constexpr size_t VALUE = 12;
};
template <> struct DefaultSplit<double> {
static constexpr size_t VALUE = DEFAULT_DOUBLE_SPLIT;
static constexpr size_t VALUE = 27;
};

using DoubleDouble = NumberPair<double>;
Expand Down
2 changes: 1 addition & 1 deletion libc/src/math/generic/range_reduction_double_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace LIBC_NAMESPACE_DECL {

#ifdef LIBC_TARGET_CPU_HAS_FMA
static constexpr unsigned SPLIT = DEFAULT_DOUBLE_SPLIT;
static constexpr unsigned SPLIT = fputil::DefaultSplit<double>::VALUE;
#else
// When there is no-FMA instructions, in order to have exact product of 2 double
// precision with directional roundings, we need to lower the precision of the
Expand Down