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

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

merged 1 commit into from
Feb 11, 2025

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Feb 11, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 11, 2025

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/126822.diff

2 Files Affected:

  • (modified) libc/src/__support/FPUtil/double_double.h (+1-3)
  • (modified) libc/src/math/generic/range_reduction_double_common.h (+1-1)
diff --git a/libc/src/__support/FPUtil/double_double.h b/libc/src/__support/FPUtil/double_double.h
index 8c318cfbed363..b24ffd4aa456f 100644
--- a/libc/src/__support/FPUtil/double_double.h
+++ b/libc/src/__support/FPUtil/double_double.h
@@ -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>;
diff --git a/libc/src/math/generic/range_reduction_double_common.h b/libc/src/math/generic/range_reduction_double_common.h
index 06aeb49495ad2..711a12219c847 100644
--- a/libc/src/math/generic/range_reduction_double_common.h
+++ b/libc/src/math/generic/range_reduction_double_common.h
@@ -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

@lntue lntue merged commit 17721b7 into llvm:main Feb 11, 2025
12 of 14 checks passed
@lntue lntue deleted the split branch February 11, 2025 23:29
flovent pushed a commit to flovent/llvm-project that referenced this pull request Feb 13, 2025
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants