[libc-commits] [libc] [libc][math][c++23] Add bfloat16 support in LLVM libc (PR #144463)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 8 08:57:31 PDT 2025


================
@@ -566,6 +567,10 @@ template <> float16 MPFRNumber::as<float16>() const {
 }
 #endif
 
+template <> bfloat16 MPFRNumber::as<bfloat16>() const {
----------------
overmighty wrote:

Nit: it would be nice if we tried to keep these per-floating-point-type declarations in the same order. In libc/src/__support/CPP/type_traits/is_floating_point.h, we have `float`, `double`, `long double`, `float16`, `float128` and `bfloat16` in that order. Could you move this after `MPFRNumber::as<float128>`?

https://github.com/llvm/llvm-project/pull/144463


More information about the libc-commits mailing list