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

Krishna Pandey via libc-commits libc-commits at lists.llvm.org
Mon Jul 7 07:00:56 PDT 2025


================
@@ -415,7 +415,11 @@ template <size_t Bits> struct DyadicFloat {
     if constexpr (cpp::is_same_v<T, float16>)
       return generic_as<T, ShouldSignalExceptions>();
 #endif
-    return fast_as<T, ShouldSignalExceptions>();
+    if constexpr (cpp::is_same_v<T, bfloat16>) {
+      return generic_as<T, ShouldSignalExceptions>();
+    } else {
+      return fast_as<T, ShouldSignalExceptions>();
+    }
   }
----------------
krishna2803 wrote:

https://godbolt.org/z/oMh4anG8o

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


More information about the libc-commits mailing list