Skip to content

Commit 15a705d

Browse files
authored
[libc][math][c++23] Add {ceil,floor,round,roundeven,trunc}bf16 math functions (#152352)
This PR implements the following basic math functions for BFloat16 type along with the tests: - ceilbf16 - floorbf16 - roundbf16 - roundevenbf16 - truncbf16 --------- Signed-off-by: Krishna Pandey <[email protected]>
1 parent 7d886fa commit 15a705d

34 files changed

+501
-8
lines changed

libc/config/baremetal/aarch64/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,12 @@ endif()
757757

758758
list(APPEND TARGET_LIBM_ENTRYPOINTS
759759
# bfloat16 entrypoints
760+
libc.src.math.ceilbf16
760761
libc.src.math.fabsbf16
762+
libc.src.math.floorbf16
763+
libc.src.math.roundbf16
764+
libc.src.math.roundevenbf16
765+
libc.src.math.truncbf16
761766
)
762767

763768
if(LIBC_COMPILER_HAS_FIXED_POINT)

libc/config/baremetal/arm/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,12 @@ endif()
760760

761761
list(APPEND TARGET_LIBM_ENTRYPOINTS
762762
# bfloat16 entrypoints
763+
libc.src.math.ceilbf16
763764
libc.src.math.fabsbf16
765+
libc.src.math.floorbf16
766+
libc.src.math.roundbf16
767+
libc.src.math.roundevenbf16
768+
libc.src.math.truncbf16
764769
)
765770

766771
if(LIBC_COMPILER_HAS_FIXED_POINT)

libc/config/baremetal/riscv/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,12 @@ endif()
760760

761761
list(APPEND TARGET_LIBM_ENTRYPOINTS
762762
# bfloat16 entrypoints
763+
libc.src.math.ceilbf16
763764
libc.src.math.fabsbf16
765+
libc.src.math.floorbf16
766+
libc.src.math.roundbf16
767+
libc.src.math.roundevenbf16
768+
libc.src.math.truncbf16
764769
)
765770

766771
if(LIBC_COMPILER_HAS_FIXED_POINT)

libc/config/darwin/aarch64/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,12 @@ endif()
590590

591591
list(APPEND TARGET_LIBM_ENTRYPOINTS
592592
# bfloat16 entrypoints
593+
libc.src.math.ceilbf16
593594
libc.src.math.fabsbf16
595+
libc.src.math.floorbf16
596+
libc.src.math.roundbf16
597+
libc.src.math.roundevenbf16
598+
libc.src.math.truncbf16
594599
)
595600

596601
if(LIBC_COMPILER_HAS_FIXED_POINT)

libc/config/darwin/x86_64/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,12 @@ set(TARGET_LIBM_ENTRYPOINTS
233233

234234
list(APPEND TARGET_LIBM_ENTRYPOINTS
235235
# bfloat16 entrypoints
236+
libc.src.math.ceilbf16
236237
libc.src.math.fabsbf16
238+
libc.src.math.floorbf16
239+
libc.src.math.roundbf16
240+
libc.src.math.roundevenbf16
241+
libc.src.math.truncbf16
237242
)
238243

239244
set(TARGET_LLVMLIBC_ENTRYPOINTS

libc/config/gpu/amdgpu/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,12 @@ endif()
616616

617617
list(APPEND TARGET_LIBM_ENTRYPOINTS
618618
# bfloat16 entrypoints
619+
libc.src.math.ceilbf16
619620
libc.src.math.fabsbf16
621+
libc.src.math.floorbf16
622+
libc.src.math.roundbf16
623+
libc.src.math.roundevenbf16
624+
libc.src.math.truncbf16
620625
)
621626

622627
set(TARGET_LLVMLIBC_ENTRYPOINTS

libc/config/gpu/nvptx/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,12 @@ endif()
617617

618618
list(APPEND TARGET_LIBM_ENTRYPOINTS
619619
# bfloat16 entrypoints
620+
libc.src.math.ceilbf16
620621
libc.src.math.fabsbf16
622+
libc.src.math.floorbf16
623+
libc.src.math.roundbf16
624+
libc.src.math.roundevenbf16
625+
libc.src.math.truncbf16
621626
)
622627

623628
set(TARGET_LLVMLIBC_ENTRYPOINTS

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,12 @@ endif()
844844

845845
list(APPEND TARGET_LIBM_ENTRYPOINTS
846846
# bfloat16 entrypoints
847+
libc.src.math.ceilbf16
847848
libc.src.math.fabsbf16
849+
libc.src.math.floorbf16
850+
libc.src.math.roundbf16
851+
libc.src.math.roundevenbf16
852+
libc.src.math.truncbf16
848853
)
849854

850855
if(LLVM_LIBC_FULL_BUILD)

libc/config/linux/arm/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,12 @@ set(TARGET_LIBM_ENTRYPOINTS
460460

461461
list(APPEND TARGET_LIBM_ENTRYPOINTS
462462
# bfloat16 entrypoints
463+
libc.src.math.ceilbf16
463464
libc.src.math.fabsbf16
465+
libc.src.math.floorbf16
466+
libc.src.math.roundbf16
467+
libc.src.math.roundevenbf16
468+
libc.src.math.truncbf16
464469
)
465470

466471
set(TARGET_LLVMLIBC_ENTRYPOINTS

libc/config/linux/riscv/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,12 @@ endif()
863863

864864
list(APPEND TARGET_LIBM_ENTRYPOINTS
865865
# bfloat16 entrypoints
866+
libc.src.math.ceilbf16
866867
libc.src.math.fabsbf16
868+
libc.src.math.floorbf16
869+
libc.src.math.roundbf16
870+
libc.src.math.roundevenbf16
871+
libc.src.math.truncbf16
867872
)
868873

869874
if(LIBC_COMPILER_HAS_FIXED_POINT)

0 commit comments

Comments
 (0)