[libc-commits] [libc] [llvm] [libc] Make str_to_float independent of fenv (PR #102369)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Wed Aug 7 15:07:09 PDT 2024
================
@@ -525,10 +525,13 @@ clinger_fast_path(ExpandedFloat<T> init_num,
FPBits result;
T float_mantissa;
if constexpr (cpp::is_same_v<StorageType, UInt<128>>) {
- float_mantissa = static_cast<T>(fputil::DyadicFloat<128>(
- Sign::POS, 0,
- fputil::DyadicFloat<128>::MantissaType(
- {uint64_t(mantissa), uint64_t(mantissa >> 64)})));
+ // float_mantissa = static_cast<T>(fputil::DyadicFloat<128>(
+ // Sign::POS, 0,
+ // fputil::DyadicFloat<128>::MantissaType(
+ // {uint64_t(mantissa), uint64_t(mantissa >> 64)})));
+ float_mantissa = (static_cast<T>(uint64_t(mantissa)) *
+ static_cast<T>(1ull << 32) * static_cast<T>(1ull << 32)) +
----------------
michaelrj-google wrote:
That's much cleaner, thank you.
https://github.com/llvm/llvm-project/pull/102369
More information about the libc-commits
mailing list