[libc][math][c++23] Implement basic arithmetic operations for BFloat16 #151228
[libc][stdfix] Fix typo `ulk` -> `lk` in riscv entrypoints
3bd7c349
Merge branch 'llvm:main' into main
f5bec032
feat: add bfloat16 struct
369756cb
add: FPType::BFloat16
817cdfa5
chore: remove compiler version checks and add bfloat16 to is_floating…
39511a45
feat: update MPCommon.h for bfloat16 type and change __bf16 to our ow…
265896dc
feat: create a dummy struct for bfloat16
0038a8ab
feat: add BFloat16 checks in compiler features
4086984d
feat: add dummy bfloat16 -> float conversion function
af0bda34
chore: add entrypoints for fbfloat16 function
67786f38
chore: add dummy tests for fbfloat16
485592ae
chore: update fbfloat16 dummy smoke tests
f3ef6e0a
fix: circular dependencies
548417c5
refactor: remove `LIBC_TYPES_HAS_BFLOAT16` dependency from sources an…
95b10485
refactor: fputil::cast for bfloat16
f14ff95d
feat: complete arbitrary float to bfloat conversion
9ef7cc1d
chore: complete smoke tests for fbfloat16 function
0058b85c
refactor: rename fbfloat16 smoke test suite, refactor bfloat16 specia…
77d38974
feat: add exhaustive tests for fbfloat16
3a1493e7
chore: update bfloat16 ctor to support conversion from non-floats
32a5efd4
refactor: bfloat16.h dependencies
394f420f
chore: remove fbfloat16 dummy function
f137dcf6
feat!: implement f{add,mul,div}bf16 functions
6faf4181
style: clang-format
1ce3c78a
feat: implement unittests for bfloat16 conversions
0bef082a
feat: implement bf16add function
c83492d1
chore: prevent casting to same type in fputil::cast
d5b22c27
remove: operator overload for equals from bfloat16 type
78af99a7
feat: add exhaustive tests for float to bfloat16 conversion
11097876
feat[WIP]: implement integer to bfloat16 ctor
5e882aa7
feat[WIP]: implement dummy tests for integer to bfloat16 ctor
ab1eb04d
feat: update bf16 integer ctor for correct rounding
a8ac5843
refactor: update test structure
41983f88
fix: test failures
ac2a4d74
refactor: address nits
b764234b
revert: remove CMake detection changes
78ff165c
chore: fix typo `InType` -> `OutType`
d6ae7dd8
chore: nits
622556e1
chore: remove duplicate include
a172f3ed
nit: indentation
617c7f3b
Apply suggestion from @overmighty
a8b74f9b
nit: suggestions
43f1b6a8
nit: indentation
63d34a79
nit: sorting
4eea0dca
chore: revert entrypoint changes
b8e4034d
merge: branch 'bfloat16' into 'bf16-arithmetic'
bb105744
feat![WIP]: use DyadicFloat<16> for bf16 add function
f67e67e8
refactor: inline lambda for testing int
7e98df48
chore: inline float cast overload
9012f7ea
nit: remove extra space
e36208c4
nit: minor changes
88e849bd
refactor: merge bfloat16 MPFRNumber ctor with float & float16
08cc137e
fix: ARM tests
eb05fcbd
refactor: move bfloat16 inside fputil namespace
26cce094
merge: branch 'bfloat16' into bf16-arithmetic
8763c15f
merge: branch 'main' into bf16-arithmetic
f4509cf3
refactor: remove old files and clean
67a24b70
feat: implement unary - operator
e65f2f83
merge: branch 'main' into bf16-arithmetic
26d0fa08
merge: branch 'main' into bf16-arithmetic
5b013d8f
feat: implement addition and subtraction operations for bfloat16
a3d128c2
feat: bfloat16 addition smoke tests
ccdcf0a6
feat!: bfloat16 subtraction smoke tests
76367054
chore: update bf16 add test header
72f23bc4
chore: add InType in multiplication tests
49acb3dd
feat: implement multiplication operation for bfloat16
5aa803d6
chore: use DyadicFloat<16> instead of DyadicFloat<8> for bfloat16.
d307338c
feat: implement division operation for bfloat16
e94fd8cc
fix: mul warnings
6cf4ad3e
refactor: use cpp::max in DyadicFloat selection
6ac2e57a
fix: deps
f8b1a497
feat: exhaustive tests for bfloat16 addition
9ef51c9a
feat: explain_binary_operation_one_output for bfloat16
ab17caa5
style: indentation
03cf2b29
chore: remove `inline`
c95542f7
chore: nits
8d5fc797
fix: update deps
b6c9579d
fix: headers
1ffcca13
fix: clang-format
1585db16
krishna2803
marked this pull request as ready for review 43 days ago
feat: exhaustive tests for bfloat16 {div,mul,sub} and nits for bfloat…
76377ee5
fix: deps
264fa99a
fix: use MantissaType::WORD_SIZE instead of sizeof(MantissaType)
b7e418dd
style: refactoring
1c7a0670
style: shorter test names
5dd2d7df
chore: add more special numbers
26ee04f5
style: refactor and add TODO
c73e1722
merge: branch 'main' into bf16-arithmetic
718884d9
merge: branch 'main' into bf16-arithmetic
8a99e2a5
fix: typo
dfa253b4
refactor: add_sub and cast for bfloat16
e431dc4b
lntue
commented
on 2025-08-06
lntue
approved these changes
on 2025-08-06
fix: typo
ae2b7fcf
lntue
approved these changes
on 2025-08-06
lntue
merged
a4ff76e8
into main 39 days ago
krishna2803
deleted the bf16-arithmetic branch 39 days ago
Assignees
No one assigned
Login to write a write a comment.
Login via GitHub