Skip to content

Commit cd19fba

Browse files
[libc] Enable float math functions on the GPU (llvm#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.
1 parent 779868d commit cd19fba

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

libc/config/gpu/amdgpu/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ set(TARGET_LIBM_ENTRYPOINTS
489489
libc.src.math.tan
490490
libc.src.math.tanf
491491
libc.src.math.tanhf
492+
libc.src.math.tanpif
492493
libc.src.math.tgamma
493494
libc.src.math.tgammaf
494495
libc.src.math.totalorder

libc/config/gpu/nvptx/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ set(TARGET_LIBM_ENTRYPOINTS
490490
libc.src.math.tan
491491
libc.src.math.tanf
492492
libc.src.math.tanhf
493+
libc.src.math.tanpif
493494
libc.src.math.tgamma
494495
libc.src.math.tgammaf
495496
libc.src.math.totalorder

libc/include/math.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ functions:
283283
return_type: float
284284
arguments:
285285
- type: float
286+
- name: cospif
287+
standards:
288+
- stdc
289+
return_type: float
290+
arguments:
291+
- type: float
286292
- name: cospif16
287293
standards:
288294
- stdc
@@ -2453,6 +2459,12 @@ functions:
24532459
arguments:
24542460
- type: _Float16
24552461
guard: LIBC_TYPES_HAS_FLOAT16
2462+
- name: sinpif
2463+
standards:
2464+
- stdc
2465+
return_type: float
2466+
arguments:
2467+
- type: float
24562468
- name: sinpif16
24572469
standards:
24582470
- stdc

0 commit comments

Comments
 (0)