[libc-commits] [libc] cd19fba - [libc] Enable float math functions on the GPU (#151841)
via libc-commits
libc-commits at lists.llvm.org
Sat Aug 2 20:13:08 PDT 2025
Author: Leandro Lacerda
Date: 2025-08-02T22:13:04-05:00
New Revision: cd19fbad093f2834bfafa6ee1535a48c8d453077
URL: https://github.com/llvm/llvm-project/commit/cd19fbad093f2834bfafa6ee1535a48c8d453077
DIFF: https://github.com/llvm/llvm-project/commit/cd19fbad093f2834bfafa6ee1535a48c8d453077.diff
LOG: [libc] Enable float math functions on the GPU (#151841)
This patch adds the `tanpif` math functions to the GPU build. It also
adds the `cospif` and `sinpif` math functions to the `math.h` header.
Added:
Modified:
libc/config/gpu/amdgpu/entrypoints.txt
libc/config/gpu/nvptx/entrypoints.txt
libc/include/math.yaml
Removed:
################################################################################
diff --git a/libc/config/gpu/amdgpu/entrypoints.txt b/libc/config/gpu/amdgpu/entrypoints.txt
index e39819dd85b72..291a2d01db5b6 100644
--- a/libc/config/gpu/amdgpu/entrypoints.txt
+++ b/libc/config/gpu/amdgpu/entrypoints.txt
@@ -489,6 +489,7 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.tan
libc.src.math.tanf
libc.src.math.tanhf
+ libc.src.math.tanpif
libc.src.math.tgamma
libc.src.math.tgammaf
libc.src.math.totalorder
diff --git a/libc/config/gpu/nvptx/entrypoints.txt b/libc/config/gpu/nvptx/entrypoints.txt
index 26e3b1547c98a..55b27e69d5571 100644
--- a/libc/config/gpu/nvptx/entrypoints.txt
+++ b/libc/config/gpu/nvptx/entrypoints.txt
@@ -490,6 +490,7 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.tan
libc.src.math.tanf
libc.src.math.tanhf
+ libc.src.math.tanpif
libc.src.math.tgamma
libc.src.math.tgammaf
libc.src.math.totalorder
diff --git a/libc/include/math.yaml b/libc/include/math.yaml
index 007be235f4380..e8ac7ee5033db 100644
--- a/libc/include/math.yaml
+++ b/libc/include/math.yaml
@@ -283,6 +283,12 @@ functions:
return_type: float
arguments:
- type: float
+ - name: cospif
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
- name: cospif16
standards:
- stdc
@@ -2453,6 +2459,12 @@ functions:
arguments:
- type: _Float16
guard: LIBC_TYPES_HAS_FLOAT16
+ - name: sinpif
+ standards:
+ - stdc
+ return_type: float
+ arguments:
+ - type: float
- name: sinpif16
standards:
- stdc
More information about the libc-commits
mailing list