================ @@ -354,7 +354,10 @@ LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, T> getpayload(T x) { return static_cast<T>(payload_dfloat); } else { - return static_cast<T>(payload); + if constexpr (cpp::is_same_v<T, bfloat16>) + return T(static_cast<int>(payload)); + else + return static_cast<T>(payload); ---------------- overmighty wrote:
Why do we have the `BFloat16(uint16_t bits)` constructor again? Removing it makes this change unnecessary and `libc-math-smoke-tests` and `libc.test.src.__support.FPUtil.bfloat16_test.__unit__` still pass. https://github.com/llvm/llvm-project/pull/153994 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits