Skip to content

Commit bc13169

Browse files
committed
More cleanup by FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED.
1 parent 24093f4 commit bc13169

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

include/fast_float/float_common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ template <>
11861186
inline constexpr am_mant_t
11871187
binary_format<double>::max_mantissa_fast_path(am_pow_t power) {
11881188
// caller is responsible to ensure that
1189-
FASTFLOAT_ASSUME(power >= 0 && power <= 22);
1189+
// FASTFLOAT_ASSUME(power >= 0 && power <= 22);
11901190
#if defined(__clang__)
11911191
// Work around clang bug https://godbolt.org/z/zedh7rrhc
11921192
return (void)max_mantissa[0], max_mantissa[power];
@@ -1199,7 +1199,7 @@ template <>
11991199
inline constexpr am_mant_t
12001200
binary_format<float>::max_mantissa_fast_path(am_pow_t power) {
12011201
// caller is responsible to ensure that
1202-
FASTFLOAT_ASSUME(power >= 0 && power <= 10);
1202+
// FASTFLOAT_ASSUME(power >= 0 && power <= 10);
12031203
#if defined(__clang__)
12041204
// Work around clang bug https://godbolt.org/z/zedh7rrhc
12051205
return (void)max_mantissa[0], max_mantissa[power];
@@ -1212,7 +1212,7 @@ template <>
12121212
inline constexpr double
12131213
binary_format<double>::exact_power_of_ten(am_pow_t power) {
12141214
// caller is responsible to ensure that
1215-
FASTFLOAT_ASSUME(power >= 0 && power <= 22);
1215+
// FASTFLOAT_ASSUME(power >= 0 && power <= 22);
12161216
#if defined(__clang__)
12171217
// Work around clang bug https://godbolt.org/z/zedh7rrhc
12181218
return (void)powers_of_ten[0], powers_of_ten[power];
@@ -1225,7 +1225,7 @@ template <>
12251225
inline constexpr float
12261226
binary_format<float>::exact_power_of_ten(am_pow_t power) {
12271227
// caller is responsible to ensure that
1228-
FASTFLOAT_ASSUME(power >= 0 && power <= 10);
1228+
// FASTFLOAT_ASSUME(power >= 0 && power <= 10);
12291229
#if defined(__clang__)
12301230
// Work around clang bug https://godbolt.org/z/zedh7rrhc
12311231
return (void)powers_of_ten[0], powers_of_ten[power];

include/fast_float/parse_number.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,9 @@ clinger_fast_path_impl(am_mant_t const mantissa, am_pow_t const exponent,
218218
// We could check it first (before the previous branch), but
219219
// there might be performance advantages at having the check
220220
// be last.
221-
if (!is_constant_evaluated()
222221
#ifndef FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED
223-
&& detail::rounds_to_nearest()
222+
if (detail::rounds_to_nearest()) {
224223
#endif
225-
) {
226224
// We have that fegetround() == FE_TONEAREST.
227225
// Next is Clinger's fast path.
228226
if (mantissa <= binary_format<T>::max_mantissa_fast_path()) {
@@ -238,6 +236,7 @@ clinger_fast_path_impl(am_mant_t const mantissa, am_pow_t const exponent,
238236
}
239237
#endif
240238
return true;
239+
#ifndef FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED
241240
}
242241
} else {
243242
// 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,
265264
#endif
266265
return true;
267266
}
267+
#endif
268268
}
269269
}
270270
return false;

0 commit comments

Comments
 (0)