-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[libc] Enable float math functions on the GPU #151841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-backend-amdgpu Author: Leandro Lacerda (leandrolcampos) ChangesThis patch adds the It also adds the Full diff: https://github.com/llvm/llvm-project/pull/151841.diff 3 Files Affected:
diff --git a/libc/config/gpu/amdgpu/entrypoints.txt b/libc/config/gpu/amdgpu/entrypoints.txt
index e39819dd85b72..2f909e2e38026 100644
--- a/libc/config/gpu/amdgpu/entrypoints.txt
+++ b/libc/config/gpu/amdgpu/entrypoints.txt
@@ -314,6 +314,7 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.exp
libc.src.math.exp10
libc.src.math.exp10f
+ libc.src.math.exp10m1f
libc.src.math.exp2
libc.src.math.exp2f
libc.src.math.exp2m1f
@@ -489,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/config/gpu/nvptx/entrypoints.txt b/libc/config/gpu/nvptx/entrypoints.txt
index 26e3b1547c98a..9d0200eb6dbe2 100644
--- a/libc/config/gpu/nvptx/entrypoints.txt
+++ b/libc/config/gpu/nvptx/entrypoints.txt
@@ -314,6 +314,7 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.exp
libc.src.math.exp10
libc.src.math.exp10f
+ # libc.src.math.exp10m1f
libc.src.math.exp2
libc.src.math.exp2f
libc.src.math.exp2m1f
@@ -490,6 +491,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
|
|
@llvm/pr-subscribers-libc Author: Leandro Lacerda (leandrolcampos) ChangesThis patch adds the It also adds the Full diff: https://github.com/llvm/llvm-project/pull/151841.diff 3 Files Affected:
diff --git a/libc/config/gpu/amdgpu/entrypoints.txt b/libc/config/gpu/amdgpu/entrypoints.txt
index e39819dd85b72..2f909e2e38026 100644
--- a/libc/config/gpu/amdgpu/entrypoints.txt
+++ b/libc/config/gpu/amdgpu/entrypoints.txt
@@ -314,6 +314,7 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.exp
libc.src.math.exp10
libc.src.math.exp10f
+ libc.src.math.exp10m1f
libc.src.math.exp2
libc.src.math.exp2f
libc.src.math.exp2m1f
@@ -489,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/config/gpu/nvptx/entrypoints.txt b/libc/config/gpu/nvptx/entrypoints.txt
index 26e3b1547c98a..9d0200eb6dbe2 100644
--- a/libc/config/gpu/nvptx/entrypoints.txt
+++ b/libc/config/gpu/nvptx/entrypoints.txt
@@ -314,6 +314,7 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.exp
libc.src.math.exp10
libc.src.math.exp10f
+ # libc.src.math.exp10m1f
libc.src.math.exp2
libc.src.math.exp2f
libc.src.math.exp2m1f
@@ -490,6 +491,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
|
969f574 to
6409d18
Compare
This patch adds the
tanpifmath functions to the GPU build. It also adds thecospifandsinpifmath functions to themath.hheader.