[libc-commits] [libc] [libc][math] Remove direct call to generic support headers to maintain platform specificity. (PR #178543)
via libc-commits
libc-commits at lists.llvm.org
Wed Jan 28 15:46:43 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Muhammad Bassiouni (bassiounix)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/178543.diff
5 Files Affected:
- (modified) libc/src/__support/math/CMakeLists.txt (+5-5)
- (modified) libc/src/__support/math/dsqrtl.h (+2-2)
- (modified) libc/src/__support/math/fsqrt.h (+2-4)
- (modified) libc/src/__support/math/fsqrtf128.h (+2-2)
- (modified) libc/src/__support/math/fsqrtl.h (+2-2)
``````````diff
diff --git a/libc/src/__support/math/CMakeLists.txt b/libc/src/__support/math/CMakeLists.txt
index c1bd566c1efcd..9ac8e820b9cf6 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -471,7 +471,7 @@ add_header_library(
HDRS
dsqrtl.h
DEPENDS
- libc.src.__support.FPUtil.generic.sqrt
+ libc.src.__support.FPUtil.sqrt
)
add_header_library(
@@ -598,7 +598,7 @@ add_header_library(
HDRS
f16sqrtl.h
DEPENDS
- libc.src.__support.FPUtil.generic.sqrt
+ libc.src.__support.FPUtil.sqrt
libc.src.__support.macros.properties.types
)
@@ -616,7 +616,7 @@ add_header_library(
HDRS
fsqrt.h
DEPENDS
- libc.src.__support.FPUtil.generic.sqrt
+ libc.src.__support.FPUtil.sqrt
)
add_header_library(
@@ -624,7 +624,7 @@ add_header_library(
HDRS
fsqrtl.h
DEPENDS
- libc.src.__support.FPUtil.generic.sqrt
+ libc.src.__support.FPUtil.sqrt
)
add_header_library(
@@ -1065,7 +1065,7 @@ add_header_library(
HDRS
fsqrtf128.h
DEPENDS
- libc.src.__support.FPUtil.generic.sqrt
+ libc.src.__support.FPUtil.sqrt
libc.src.__support.macros.properties.types
)
diff --git a/libc/src/__support/math/dsqrtl.h b/libc/src/__support/math/dsqrtl.h
index e66b6502d27c4..ddbe6a8f0dc7d 100644
--- a/libc/src/__support/math/dsqrtl.h
+++ b/libc/src/__support/math/dsqrtl.h
@@ -9,13 +9,13 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_DSQRTL_H
#define LLVM_LIBC_SRC___SUPPORT_MATH_DSQRTL_H
-#include "src/__support/FPUtil/generic/sqrt.h"
+#include "src/__support/FPUtil/sqrt.h"
namespace LIBC_NAMESPACE_DECL {
namespace math {
-LIBC_INLINE static constexpr double dsqrtl(long double x) {
+LIBC_INLINE static double dsqrtl(long double x) {
return fputil::sqrt<double>(x);
}
diff --git a/libc/src/__support/math/fsqrt.h b/libc/src/__support/math/fsqrt.h
index 8dd6afc7845f0..1d1783c15287d 100644
--- a/libc/src/__support/math/fsqrt.h
+++ b/libc/src/__support/math/fsqrt.h
@@ -9,15 +9,13 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_FSQRT_H
#define LLVM_LIBC_SRC___SUPPORT_MATH_FSQRT_H
-#include "src/__support/FPUtil/generic/sqrt.h"
+#include "src/__support/FPUtil/sqrt.h"
namespace LIBC_NAMESPACE_DECL {
namespace math {
-LIBC_INLINE static constexpr float fsqrt(double x) {
- return fputil::sqrt<float>(x);
-}
+LIBC_INLINE static float fsqrt(double x) { return fputil::sqrt<float>(x); }
} // namespace math
diff --git a/libc/src/__support/math/fsqrtf128.h b/libc/src/__support/math/fsqrtf128.h
index 8ca274eff6888..6ae3d50175d1d 100644
--- a/libc/src/__support/math/fsqrtf128.h
+++ b/libc/src/__support/math/fsqrtf128.h
@@ -13,7 +13,7 @@
#ifdef LIBC_TYPES_HAS_FLOAT128
-#include "src/__support/FPUtil/generic/sqrt.h"
+#include "src/__support/FPUtil/sqrt.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
@@ -21,7 +21,7 @@ namespace LIBC_NAMESPACE_DECL {
namespace math {
-LIBC_INLINE static constexpr float fsqrtf128(float128 x) {
+LIBC_INLINE static float fsqrtf128(float128 x) {
return fputil::sqrt<float>(x);
}
diff --git a/libc/src/__support/math/fsqrtl.h b/libc/src/__support/math/fsqrtl.h
index 3033f0a5242f3..0dc5d0abd65a6 100644
--- a/libc/src/__support/math/fsqrtl.h
+++ b/libc/src/__support/math/fsqrtl.h
@@ -9,13 +9,13 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_FSQRTL_H
#define LLVM_LIBC_SRC___SUPPORT_MATH_FSQRTL_H
-#include "src/__support/FPUtil/generic/sqrt.h"
+#include "src/__support/FPUtil/sqrt.h"
namespace LIBC_NAMESPACE_DECL {
namespace math {
-LIBC_INLINE static constexpr float fsqrtl(long double x) {
+LIBC_INLINE static float fsqrtl(long double x) {
return fputil::sqrt<float>(x);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/178543
More information about the libc-commits
mailing list