Skip to content

Add generic sqrt root headers to libc sqrt specializations #135237

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
Apr 10, 2025

Conversation

calewis
Copy link
Contributor

@calewis calewis commented Apr 10, 2025

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.

@llvmbot llvmbot added the libc label Apr 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 10, 2025

@llvm/pr-subscribers-libc

Author: Drew Lewis (calewis)

Changes

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 --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 {
 

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to unblock downstream

@pranavk pranavk merged commit d07a216 into llvm:main Apr 10, 2025
14 of 17 checks passed
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
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.
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.

4 participants