Skip to content

[libc] Enable double math functions on the GPU - #154857

Merged
jhuber6 merged 1 commit into
llvm:mainfrom
leandrolcampos:MoreDoubleFunctions
Aug 22, 2025
Merged

[libc] Enable double math functions on the GPU#154857
jhuber6 merged 1 commit into
llvm:mainfrom
leandrolcampos:MoreDoubleFunctions

Conversation

@leandrolcampos

Copy link
Copy Markdown
Contributor

This patch adds the acos math function to the NVPTX build. It also adds the sincos math function to the math.h header.

@llvmbot llvmbot added the libc label Aug 21, 2025
@llvmbot

llvmbot commented Aug 21, 2025

Copy link
Copy Markdown
Member

@llvm/pr-subscribers-libc

Author: Leandro Lacerda (leandrolcampos)

Changes

This patch adds the acos math function to the NVPTX build. It also adds the sincos math function to the math.h header.


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

2 Files Affected:

  • (modified) libc/config/gpu/nvptx/entrypoints.txt (+1)
  • (modified) libc/include/math.yaml (+16-8)
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
jhuber6 merged commit 15a192c into llvm:main Aug 22, 2025
21 checks passed
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