Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libc/config/baremetal/aarch64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -785,16 +785,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/baremetal/arm/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -788,16 +788,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/baremetal/riscv/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -788,16 +788,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/darwin/aarch64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -618,16 +618,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/darwin/x86_64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/gpu/amdgpu/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -644,16 +644,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/gpu/nvptx/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -646,16 +646,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/linux/aarch64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -873,16 +873,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/linux/arm/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -488,16 +488,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/linux/riscv/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -891,16 +891,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/linux/x86_64/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -924,16 +924,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
6 changes: 6 additions & 0 deletions libc/config/windows/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,22 @@ list(APPEND TARGET_LIBM_ENTRYPOINTS
libc.src.math.fminimum_magbf16
libc.src.math.fminimum_mag_numbf16
libc.src.math.fminimum_numbf16
libc.src.math.llrintbf16
libc.src.math.llroundbf16
libc.src.math.lrintbf16
libc.src.math.lroundbf16
libc.src.math.fromfpbf16
libc.src.math.fromfpxbf16
libc.src.math.getpayloadbf16
libc.src.math.nanbf16
libc.src.math.nearbyintbf16
libc.src.math.nextafterbf16
libc.src.math.nextdownbf16
libc.src.math.nexttowardbf16
libc.src.math.nextupbf16
libc.src.math.roundbf16
libc.src.math.roundevenbf16
libc.src.math.rintbf16
libc.src.math.setpayloadbf16
libc.src.math.setpayloadsigbf16
libc.src.math.truncbf16
Expand Down
12 changes: 6 additions & 6 deletions libc/docs/headers/math/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,21 @@ Basic Operations
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| llogb | |check| | |check| | |check| | |check| | |check| | | 7.12.6.10 | F.10.3.10 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| llrint | |check| | |check| | |check| | |check| | |check| | | 7.12.9.5 | F.10.6.5 |
| llrint | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.9.5 | F.10.6.5 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| llround | |check| | |check| | |check| | |check| | |check| | | 7.12.9.7 | F.10.6.7 |
| llround | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.9.7 | F.10.6.7 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| logb | |check| | |check| | |check| | |check| | |check| | | 7.12.6.17 | F.10.3.17 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| lrint | |check| | |check| | |check| | |check| | |check| | | 7.12.9.5 | F.10.6.5 |
| lrint | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.9.5 | F.10.6.5 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| lround | |check| | |check| | |check| | |check| | |check| | | 7.12.9.7 | F.10.6.7 |
| lround | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.9.7 | F.10.6.7 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| modf | |check| | |check| | |check| | |check| | |check| | | 7.12.6.18 | F.10.3.18 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| nan | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.11.2 | F.10.8.2 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| nearbyint | |check| | |check| | |check| | |check| | |check| | | 7.12.9.3 | F.10.6.3 |
| nearbyint | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.9.3 | F.10.6.3 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| nextafter | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.11.3 | F.10.8.3 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
Expand All @@ -227,7 +227,7 @@ Basic Operations
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| remquo | |check| | |check| | |check| | |check| | |check| | | 7.12.10.3 | F.10.7.3 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| rint | |check| | |check| | |check| | |check| | |check| | | 7.12.9.4 | F.10.6.4 |
| rint | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.9.4 | F.10.6.4 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
| round | |check| | |check| | |check| | |check| | |check| | |check| | 7.12.9.6 | F.10.6.6 |
+------------------+------------------+-----------------+------------------------+----------------------+------------------------+------------------------+------------------------+----------------------------+
Expand Down
5 changes: 5 additions & 0 deletions libc/src/__support/FPUtil/bfloat16.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ struct BFloat16 {
return cpp::bit_cast<float>(x_bits);
}

template <typename T, cpp::enable_if_t<cpp::is_integral_v<T>, int> = 0>
LIBC_INLINE constexpr explicit operator T() const {
return static_cast<T>(static_cast<float>(*this));
}

LIBC_INLINE bool operator==(BFloat16 other) const {
return fputil::equals(*this, other);
}
Expand Down
6 changes: 6 additions & 0 deletions libc/src/math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -392,24 +392,28 @@ add_math_entrypoint_object(llrintf)
add_math_entrypoint_object(llrintl)
add_math_entrypoint_object(llrintf16)
add_math_entrypoint_object(llrintf128)
add_math_entrypoint_object(llrintbf16)

add_math_entrypoint_object(llround)
add_math_entrypoint_object(llroundf)
add_math_entrypoint_object(llroundl)
add_math_entrypoint_object(llroundf16)
add_math_entrypoint_object(llroundf128)
add_math_entrypoint_object(llroundbf16)

add_math_entrypoint_object(lrint)
add_math_entrypoint_object(lrintf)
add_math_entrypoint_object(lrintl)
add_math_entrypoint_object(lrintf16)
add_math_entrypoint_object(lrintf128)
add_math_entrypoint_object(lrintbf16)

add_math_entrypoint_object(lround)
add_math_entrypoint_object(lroundf)
add_math_entrypoint_object(lroundl)
add_math_entrypoint_object(lroundf16)
add_math_entrypoint_object(lroundf128)
add_math_entrypoint_object(lroundbf16)

add_math_entrypoint_object(modf)
add_math_entrypoint_object(modff)
Expand All @@ -429,6 +433,7 @@ add_math_entrypoint_object(nearbyintf)
add_math_entrypoint_object(nearbyintl)
add_math_entrypoint_object(nearbyintf16)
add_math_entrypoint_object(nearbyintf128)
add_math_entrypoint_object(nearbyintbf16)

add_math_entrypoint_object(nextafter)
add_math_entrypoint_object(nextafterf)
Expand Down Expand Up @@ -479,6 +484,7 @@ add_math_entrypoint_object(rintf)
add_math_entrypoint_object(rintl)
add_math_entrypoint_object(rintf16)
add_math_entrypoint_object(rintf128)
add_math_entrypoint_object(rintbf16)

add_math_entrypoint_object(round)
add_math_entrypoint_object(roundf)
Expand Down
Loading
Loading