diff options
author | Leandro Lacerda <leandrolcampos@yahoo.com.br> | 2025-08-03 00:13:04 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-02 22:13:04 -0500 |
commit | cd19fbad093f2834bfafa6ee1535a48c8d453077 (patch) | |
tree | 2d99e3abe9fb9b148013b997008b5c2a27750051 | |
parent | 779868de6975f6fd0ea17bb9a8e929037d3752d7 (diff) | |
download | llvm-cd19fbad093f2834bfafa6ee1535a48c8d453077.zip llvm-cd19fbad093f2834bfafa6ee1535a48c8d453077.tar.gz llvm-cd19fbad093f2834bfafa6ee1535a48c8d453077.tar.bz2 |
[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.
-rw-r--r-- | libc/config/gpu/amdgpu/entrypoints.txt | 1 | ||||
-rw-r--r-- | libc/config/gpu/nvptx/entrypoints.txt | 1 | ||||
-rw-r--r-- | libc/include/math.yaml | 12 |
3 files changed, 14 insertions, 0 deletions
diff --git a/libc/config/gpu/amdgpu/entrypoints.txt b/libc/config/gpu/amdgpu/entrypoints.txt index e39819d..291a2d0 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 26e3b15..55b27e6 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 007be23..e8ac7ee 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 |