Skip to content

Commit 111edfc

Browse files
[libc][math][c++23] Add fabsbf16 math function (llvm#148398)
This PR implements fabsbf16 math function for BFloat16 type along with the tests. --------- Signed-off-by: krishna2803 <[email protected]> Signed-off-by: Krishna Pandey <[email protected]> Co-authored-by: OverMighty <[email protected]>
1 parent 32779cd commit 111edfc

File tree

19 files changed

+142
-1
lines changed

19 files changed

+142
-1
lines changed

libc/config/baremetal/aarch64/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,11 @@ if(LIBC_TYPES_HAS_FLOAT128)
754754
)
755755
endif()
756756

757+
list(APPEND TARGET_LIBM_ENTRYPOINTS
758+
# bfloat16 entrypoints
759+
libc.src.math.fabsbf16
760+
)
761+
757762
if(LIBC_COMPILER_HAS_FIXED_POINT)
758763
list(APPEND TARGET_LIBM_ENTRYPOINTS
759764
# stdfix.h _Fract and _Accum entrypoints

libc/config/baremetal/arm/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,11 @@ if(LIBC_TYPES_HAS_FLOAT128)
757757
)
758758
endif()
759759

760+
list(APPEND TARGET_LIBM_ENTRYPOINTS
761+
# bfloat16 entrypoints
762+
libc.src.math.fabsbf16
763+
)
764+
760765
if(LIBC_COMPILER_HAS_FIXED_POINT)
761766
list(APPEND TARGET_LIBM_ENTRYPOINTS
762767
# stdfix.h _Fract and _Accum entrypoints

libc/config/baremetal/riscv/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,11 @@ if(LIBC_TYPES_HAS_FLOAT128)
757757
)
758758
endif()
759759

760+
list(APPEND TARGET_LIBM_ENTRYPOINTS
761+
# bfloat16 entrypoints
762+
libc.src.math.fabsbf16
763+
)
764+
760765
if(LIBC_COMPILER_HAS_FIXED_POINT)
761766
list(APPEND TARGET_LIBM_ENTRYPOINTS
762767
# stdfix.h _Fract and _Accum entrypoints

libc/config/darwin/aarch64/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,11 @@ if(LIBC_TYPES_HAS_FLOAT128)
588588
)
589589
endif()
590590

591+
list(APPEND TARGET_LIBM_ENTRYPOINTS
592+
# bfloat16 entrypoints
593+
libc.src.math.fabsbf16
594+
)
595+
591596
if(LIBC_COMPILER_HAS_FIXED_POINT)
592597
list(APPEND TARGET_LIBM_ENTRYPOINTS
593598
# stdfix.h _Fract and _Accum entrypoints

libc/config/darwin/x86_64/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ set(TARGET_LIBM_ENTRYPOINTS
231231
#libc.src.math.truncl
232232
)
233233

234+
list(APPEND TARGET_LIBM_ENTRYPOINTS
235+
# bfloat16 entrypoints
236+
libc.src.math.fabsbf16
237+
)
238+
234239
set(TARGET_LLVMLIBC_ENTRYPOINTS
235240
${TARGET_LIBC_ENTRYPOINTS}
236241
${TARGET_LIBM_ENTRYPOINTS}

libc/config/gpu/amdgpu/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,11 @@ if(LIBC_TYPES_HAS_FLOAT16)
612612
)
613613
endif()
614614

615+
list(APPEND TARGET_LIBM_ENTRYPOINTS
616+
# bfloat16 entrypoints
617+
libc.src.math.fabsbf16
618+
)
619+
615620
set(TARGET_LLVMLIBC_ENTRYPOINTS
616621
${TARGET_LIBC_ENTRYPOINTS}
617622
${TARGET_LIBM_ENTRYPOINTS}

libc/config/gpu/nvptx/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,11 @@ if(LIBC_TYPES_HAS_FLOAT16)
614614
)
615615
endif()
616616

617+
list(APPEND TARGET_LIBM_ENTRYPOINTS
618+
# bfloat16 entrypoints
619+
libc.src.math.fabsbf16
620+
)
621+
617622
set(TARGET_LLVMLIBC_ENTRYPOINTS
618623
${TARGET_LIBC_ENTRYPOINTS}
619624
${TARGET_LIBM_ENTRYPOINTS}

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,11 @@ if(LIBC_TYPES_HAS_FLOAT128)
842842
)
843843
endif()
844844

845+
list(APPEND TARGET_LIBM_ENTRYPOINTS
846+
# bfloat16 entrypoints
847+
libc.src.math.fabsbf16
848+
)
849+
845850
if(LLVM_LIBC_FULL_BUILD)
846851
list(APPEND TARGET_LIBC_ENTRYPOINTS
847852
# assert.h entrypoints

libc/config/linux/arm/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,11 @@ set(TARGET_LIBM_ENTRYPOINTS
458458
libc.src.math.ufromfpxl
459459
)
460460

461+
list(APPEND TARGET_LIBM_ENTRYPOINTS
462+
# bfloat16 entrypoints
463+
libc.src.math.fabsbf16
464+
)
465+
461466
set(TARGET_LLVMLIBC_ENTRYPOINTS
462467
${TARGET_LIBC_ENTRYPOINTS}
463468
${TARGET_LIBM_ENTRYPOINTS}

libc/config/linux/riscv/entrypoints.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,11 @@ if(LIBC_TYPES_HAS_FLOAT128)
861861
)
862862
endif()
863863

864+
list(APPEND TARGET_LIBM_ENTRYPOINTS
865+
# bfloat16 entrypoints
866+
libc.src.math.fabsbf16
867+
)
868+
864869
if(LIBC_COMPILER_HAS_FIXED_POINT)
865870
list(APPEND TARGET_LIBM_ENTRYPOINTS
866871
# stdfix.h _Fract and _Accum entrypoints

0 commit comments

Comments
 (0)