From bc1316970c24dceb55e2664989db3655b8afd935 Mon Sep 17 00:00:00 2001 From: HedgehogInTheCPP Date: Sat, 22 Aug 2026 21:46:25 +0300 Subject: [PATCH] More cleanup by FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED. --- include/fast_float/float_common.h | 8 ++++---- include/fast_float/parse_number.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index a4b944b..bcf904a 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -1186,7 +1186,7 @@ template <> inline constexpr am_mant_t binary_format::max_mantissa_fast_path(am_pow_t power) { // caller is responsible to ensure that - FASTFLOAT_ASSUME(power >= 0 && power <= 22); + // FASTFLOAT_ASSUME(power >= 0 && power <= 22); #if defined(__clang__) // Work around clang bug https://godbolt.org/z/zedh7rrhc return (void)max_mantissa[0], max_mantissa[power]; @@ -1199,7 +1199,7 @@ template <> inline constexpr am_mant_t binary_format::max_mantissa_fast_path(am_pow_t power) { // caller is responsible to ensure that - FASTFLOAT_ASSUME(power >= 0 && power <= 10); + // FASTFLOAT_ASSUME(power >= 0 && power <= 10); #if defined(__clang__) // Work around clang bug https://godbolt.org/z/zedh7rrhc return (void)max_mantissa[0], max_mantissa[power]; @@ -1212,7 +1212,7 @@ template <> inline constexpr double binary_format::exact_power_of_ten(am_pow_t power) { // caller is responsible to ensure that - FASTFLOAT_ASSUME(power >= 0 && power <= 22); + // FASTFLOAT_ASSUME(power >= 0 && power <= 22); #if defined(__clang__) // Work around clang bug https://godbolt.org/z/zedh7rrhc return (void)powers_of_ten[0], powers_of_ten[power]; @@ -1225,7 +1225,7 @@ template <> inline constexpr float binary_format::exact_power_of_ten(am_pow_t power) { // caller is responsible to ensure that - FASTFLOAT_ASSUME(power >= 0 && power <= 10); + // FASTFLOAT_ASSUME(power >= 0 && power <= 10); #if defined(__clang__) // Work around clang bug https://godbolt.org/z/zedh7rrhc return (void)powers_of_ten[0], powers_of_ten[power]; diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index 896b534..7fdd655 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -218,11 +218,9 @@ clinger_fast_path_impl(am_mant_t const mantissa, am_pow_t const exponent, // We could check it first (before the previous branch), but // there might be performance advantages at having the check // be last. - if (!is_constant_evaluated() #ifndef FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED - && detail::rounds_to_nearest() + if (detail::rounds_to_nearest()) { #endif - ) { // We have that fegetround() == FE_TONEAREST. // Next is Clinger's fast path. if (mantissa <= binary_format::max_mantissa_fast_path()) { @@ -238,6 +236,7 @@ clinger_fast_path_impl(am_mant_t const mantissa, am_pow_t const exponent, } #endif return true; +#ifndef FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED } } else { // We do not have that fegetround() == FE_TONEAREST. @@ -265,6 +264,7 @@ clinger_fast_path_impl(am_mant_t const mantissa, am_pow_t const exponent, #endif return true; } +#endif } } return false;