add fastfloat_noinline from https://github.com/fastfloat/fast_float/pull/403 my fork don't need any additional from this PR because it's already simd optimized more strictly.

This commit is contained in:
HedgehogInTheCPP 2026-08-29 17:33:00 +03:00
parent c1b6fa94ad
commit 9b3d9f7b1a
3 changed files with 13 additions and 6 deletions

View File

@ -379,8 +379,9 @@ parse_mantissa(bigint &result, const parsed_number_string_t<UC> &num) noexcept {
}
template <typename T>
inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa positive_digit_comp(
bigint &bigmant, adjusted_mantissa am, am_pow_t const exponent) noexcept {
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa
positive_digit_comp(bigint &bigmant, adjusted_mantissa am,
am_pow_t const exponent) noexcept {
FASTFLOAT_ASSERT(bigmant.pow10(exponent));
bool truncated;
am.mantissa = bigmant.hi64(truncated);
@ -407,7 +408,7 @@ inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa positive_digit_comp(
// we then need to scale by `2^(f- e)`, and then the two significant digits
// are of the same magnitude.
template <typename T>
inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa
negative_digit_comp(bigint &real_digits, adjusted_mantissa am,
am_pow_t const real_exp) noexcept {
// get the value of `b`, rounded down, and get a bigint representation of b+h
@ -472,7 +473,7 @@ negative_digit_comp(bigint &real_digits, adjusted_mantissa am,
// the actual digits. we then compare the big integer representations
// of both, and use that to direct rounding.
template <typename T, typename UC>
inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa digit_comp(
fastfloat_noinline FASTFLOAT_CONSTEXPR20 adjusted_mantissa digit_comp(
parsed_number_string_t<UC> const &num, adjusted_mantissa am) noexcept {
// remove the invalid exponent bias
am.power2 -= invalid_am_bias;

View File

@ -230,10 +230,16 @@ static_assert(FASTFLOAT_X86_SIMD == 20 || FASTFLOAT_X86_SIMD == 42 ||
#endif
#endif
#ifdef FASTFLOAT_VISUAL_STUDIO
#define fastfloat_really_inline __forceinline
#else
#define fastfloat_noinline __declspec(noinline)
#elif defined(__GNUC__) || defined(__clang__)
#define fastfloat_really_inline inline __attribute__((always_inline))
#define fastfloat_noinline __attribute__((noinline))
#else
#define fastfloat_really_inline inline
#define fastfloat_noinline
#endif
// Branch-probability hint marking the rare slow-path branches as cold, so the

View File

@ -331,7 +331,7 @@ from_chars_advanced(parsed_number_string_t<UC> const &pns, T &value) noexcept {
// and the am.power2<0 digit_comp recompute, so both slow branches collapse to
// one helper call.
template <typename T, typename UC>
FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
static fastfloat_noinline FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
parse_number_slow_path(UC const *first, UC const *last, T &value,
parse_options_t<UC> const options
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN