[libc-commits] [libc] Add generic sqrt root headers to libc sqrt specializations (PR #135237)

via libc-commits libc-commits at lists.llvm.org
Thu Apr 10 12:01:03 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Drew Lewis (calewis)

<details>
<summary>Changes</summary>

This header is needed to provide the declaration for the sqrt template.  You can build without these in the CMake build, but not having this include in the architecture specific headers makes them not self contained.  

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


4 Files Affected:

- (modified) libc/src/__support/FPUtil/aarch64/sqrt.h (+2) 
- (modified) libc/src/__support/FPUtil/arm/sqrt.h (+2) 
- (modified) libc/src/__support/FPUtil/riscv/sqrt.h (+2) 
- (modified) libc/src/__support/FPUtil/x86_64/sqrt.h (+2) 


``````````diff
diff --git a/libc/src/__support/FPUtil/aarch64/sqrt.h b/libc/src/__support/FPUtil/aarch64/sqrt.h
index 2bda8e895b375..4eb576bf2244c 100644
--- a/libc/src/__support/FPUtil/aarch64/sqrt.h
+++ b/libc/src/__support/FPUtil/aarch64/sqrt.h
@@ -18,6 +18,8 @@
 #error "Invalid include"
 #endif
 
+#include "src/__support/FPUtil/generic/sqrt.h"
+
 namespace LIBC_NAMESPACE_DECL {
 namespace fputil {
 
diff --git a/libc/src/__support/FPUtil/arm/sqrt.h b/libc/src/__support/FPUtil/arm/sqrt.h
index 497dbc504b79f..e6cb58c0be817 100644
--- a/libc/src/__support/FPUtil/arm/sqrt.h
+++ b/libc/src/__support/FPUtil/arm/sqrt.h
@@ -18,6 +18,8 @@
 #error "Invalid include"
 #endif
 
+#include "src/__support/FPUtil/generic/sqrt.h"
+
 namespace LIBC_NAMESPACE_DECL {
 namespace fputil {
 
diff --git a/libc/src/__support/FPUtil/riscv/sqrt.h b/libc/src/__support/FPUtil/riscv/sqrt.h
index 14a34359ee32b..8cff03a9fc73e 100644
--- a/libc/src/__support/FPUtil/riscv/sqrt.h
+++ b/libc/src/__support/FPUtil/riscv/sqrt.h
@@ -18,6 +18,8 @@
 #error "Invalid include"
 #endif
 
+#include "src/__support/FPUtil/generic/sqrt.h"
+
 namespace LIBC_NAMESPACE_DECL {
 namespace fputil {
 
diff --git a/libc/src/__support/FPUtil/x86_64/sqrt.h b/libc/src/__support/FPUtil/x86_64/sqrt.h
index eae40cc8829f1..e10447751d216 100644
--- a/libc/src/__support/FPUtil/x86_64/sqrt.h
+++ b/libc/src/__support/FPUtil/x86_64/sqrt.h
@@ -18,6 +18,8 @@
 #error "sqrtss / sqrtsd need SSE2"
 #endif
 
+#include "src/__support/FPUtil/generic/sqrt.h"
+
 namespace LIBC_NAMESPACE_DECL {
 namespace fputil {
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/135237


More information about the libc-commits mailing list