[libc] Enable double math functions on the GPU - #154857
Merged
Merged
Conversation
Member
|
@llvm/pr-subscribers-libc Author: Leandro Lacerda (leandrolcampos) ChangesThis patch adds the Full diff: https://github.com/llvm/llvm-project/pull/154857.diff 2 Files Affected:
diff --git a/libc/config/gpu/nvptx/entrypoints.txt b/libc/config/gpu/nvptx/entrypoints.txt
index c9688284df16c..c47b14d3e426a 100644
--- a/libc/config/gpu/nvptx/entrypoints.txt
+++ b/libc/config/gpu/nvptx/entrypoints.txt
@@ -280,6 +280,7 @@ set(TARGET_LIBC_ENTRYPOINTS
set(TARGET_LIBM_ENTRYPOINTS
# math.h entrypoints
+ libc.src.math.acos
libc.src.math.acosf
libc.src.math.acoshf
libc.src.math.asin
diff --git a/libc/include/math.yaml b/libc/include/math.yaml
index 4e398676bf91e..60e6265eece75 100644
--- a/libc/include/math.yaml
+++ b/libc/include/math.yaml
@@ -2432,14 +2432,6 @@ functions:
return_type: double
arguments:
- type: double
- - name: sincosf
- standards:
- - gnu
- return_type: void
- arguments:
- - type: float
- - type: float *
- - type: float *
- name: sinf
standards:
- stdc
@@ -2453,6 +2445,22 @@ functions:
arguments:
- type: _Float16
guard: LIBC_TYPES_HAS_FLOAT16
+ - name: sincos
+ standards:
+ - gnu
+ return_type: void
+ arguments:
+ - type: double
+ - type: double *
+ - type: double *
+ - name: sincosf
+ standards:
+ - gnu
+ return_type: void
+ arguments:
+ - type: float
+ - type: float *
+ - type: float *
- name: sinhf
standards:
- stdc
|
jhuber6
approved these changes
Aug 21, 2025
lntue
approved these changes
Aug 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds the
acosmath function to the NVPTX build. It also adds thesincosmath function to themath.hheader.