Skip to content

Commit 46c8cc7

Browse files
authored
[libc] Enable all f16 math functions on the GPU (llvm#145813)
Summary: This patch adds all the new f16 math functions to the GPU build. These should all pass except exp2m1f16 on AMDGPU for some reason. I'll investigate that later.
1 parent 2f9eee8 commit 46c8cc7

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

libc/config/gpu/amdgpu/entrypoints.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,14 +511,25 @@ set(TARGET_LIBM_ENTRYPOINTS
511511
if(LIBC_TYPES_HAS_FLOAT16)
512512
list(APPEND TARGET_LIBM_ENTRYPOINTS
513513
# math.h C23 _Float16 entrypoints
514+
libc.src.math.acosf16
515+
libc.src.math.acoshf16
516+
libc.src.math.acospif16
517+
libc.src.math.asinf16
518+
libc.src.math.asinhf16
519+
libc.src.math.atanf16
520+
libc.src.math.atanhf16
514521
libc.src.math.canonicalizef16
515522
libc.src.math.ceilf16
516523
libc.src.math.copysignf16
524+
libc.src.math.cosf16
517525
libc.src.math.coshf16
526+
libc.src.math.cospif16
518527
libc.src.math.exp10f16
519528
libc.src.math.exp10m1f16
520529
libc.src.math.exp2f16
530+
# libc.src.math.exp2m1f16
521531
libc.src.math.expf16
532+
libc.src.math.expm1f16
522533
libc.src.math.f16add
523534
libc.src.math.f16addf
524535
libc.src.math.f16addl
@@ -556,7 +567,10 @@ if(LIBC_TYPES_HAS_FLOAT16)
556567
libc.src.math.fromfpf16
557568
libc.src.math.fromfpxf16
558569
libc.src.math.getpayloadf16
570+
libc.src.math.hypotf16
559571
libc.src.math.ilogbf16
572+
libc.src.math.iscanonicalf16
573+
libc.src.math.issignalingf16
560574
libc.src.math.ldexpf16
561575
libc.src.math.llogbf16
562576
libc.src.math.llrintf16
@@ -583,9 +597,13 @@ if(LIBC_TYPES_HAS_FLOAT16)
583597
libc.src.math.scalbnf16
584598
libc.src.math.setpayloadf16
585599
libc.src.math.setpayloadsigf16
600+
libc.src.math.sinf16
586601
libc.src.math.sinhf16
602+
libc.src.math.sinpif16
587603
libc.src.math.sqrtf16
604+
libc.src.math.tanf16
588605
libc.src.math.tanhf16
606+
libc.src.math.tanpif16
589607
libc.src.math.totalorderf16
590608
libc.src.math.totalordermagf16
591609
libc.src.math.truncf16

libc/config/gpu/nvptx/entrypoints.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,14 +513,25 @@ set(TARGET_LIBM_ENTRYPOINTS
513513
if(LIBC_TYPES_HAS_FLOAT16)
514514
list(APPEND TARGET_LIBM_ENTRYPOINTS
515515
# math.h C23 _Float16 entrypoints
516+
libc.src.math.acosf16
517+
libc.src.math.acoshf16
518+
libc.src.math.acospif16
519+
libc.src.math.asinf16
520+
libc.src.math.asinhf16
521+
libc.src.math.atanf16
522+
libc.src.math.atanhf16
516523
libc.src.math.canonicalizef16
517524
libc.src.math.ceilf16
518525
libc.src.math.copysignf16
526+
libc.src.math.cosf16
519527
libc.src.math.coshf16
528+
libc.src.math.cospif16
520529
libc.src.math.exp10f16
521530
libc.src.math.exp10m1f16
522531
libc.src.math.exp2f16
532+
libc.src.math.exp2m1f16
523533
libc.src.math.expf16
534+
libc.src.math.expm1f16
524535
libc.src.math.f16add
525536
libc.src.math.f16addf
526537
libc.src.math.f16addl
@@ -558,7 +569,10 @@ if(LIBC_TYPES_HAS_FLOAT16)
558569
libc.src.math.fromfpf16
559570
libc.src.math.fromfpxf16
560571
libc.src.math.getpayloadf16
572+
libc.src.math.hypotf16
561573
libc.src.math.ilogbf16
574+
libc.src.math.iscanonicalf16
575+
libc.src.math.issignalingf16
562576
libc.src.math.ldexpf16
563577
libc.src.math.llogbf16
564578
libc.src.math.llrintf16
@@ -585,9 +599,13 @@ if(LIBC_TYPES_HAS_FLOAT16)
585599
libc.src.math.scalbnf16
586600
libc.src.math.setpayloadf16
587601
libc.src.math.setpayloadsigf16
602+
libc.src.math.sinf16
588603
libc.src.math.sinhf16
604+
libc.src.math.sinpif16
589605
libc.src.math.sqrtf16
606+
libc.src.math.tanf16
590607
libc.src.math.tanhf16
608+
libc.src.math.tanpif16
591609
libc.src.math.totalorderf16
592610
libc.src.math.totalordermagf16
593611
libc.src.math.truncf16

0 commit comments

Comments
 (0)