[libc-commits] [libc] 15a192c - [libc] Enable double math functions on the GPU (#154857)

via libc-commits libc-commits at lists.llvm.org
Fri Aug 22 04:52:16 PDT 2025


Author: Leandro Lacerda
Date: 2025-08-22T06:52:13-05:00
New Revision: 15a192cde5b89b6487cb95a7eeef7fa3b127f867

URL: https://github.com/llvm/llvm-project/commit/15a192cde5b89b6487cb95a7eeef7fa3b127f867
DIFF: https://github.com/llvm/llvm-project/commit/15a192cde5b89b6487cb95a7eeef7fa3b127f867.diff

LOG: [libc] Enable double math functions on the GPU (#154857)

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

Added: 
    

Modified: 
    libc/config/gpu/nvptx/entrypoints.txt
    libc/include/math.yaml

Removed: 
    


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


        


More information about the libc-commits mailing list