Skip to content

Commit a5632d5

Browse files
committed
Fix digit comparison, cleanup
1 parent cb397ef commit a5632d5

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

include/fast_float/ascii_number.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ FASTFLOAT_SIMD_DISABLE_WARNINGS
161161

162162
// (x - '0') <= 9
163163
// http://0x80.pl/articles/simd-parsing-int-sequences.html
164-
const __m128i t0 = _mm_sub_epi16(data, _mm_set1_epi16(80));
165-
const __m128i t1 = _mm_cmpgt_epi16(t0, _mm_set1_epi16(-119));
164+
const __m128i t0 = _mm_add_epi16(data, _mm_set1_epi16(32720));
165+
const __m128i t1 = _mm_cmpgt_epi16(t0, _mm_set1_epi16(-32759));
166166

167167
if (_mm_movemask_epi8(t1) == 0) {
168168
i = i * 100000000 + parse_eight_digits_unrolled(simd_read8_to_u64(data));

include/fast_float/float_common.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,6 @@ fastfloat_really_inline constexpr bool cpp20_and_in_constexpr() {
170170
#endif
171171
}
172172

173-
fastfloat_really_inline constexpr bool has_simd() {
174-
#if FASTFLOAT_HAS_SIMD
175-
return true;
176-
#else
177-
return false;
178-
#endif
179-
}
180-
181173
// Compares two ASCII strings in a case insensitive manner.
182174
template <typename UC>
183175
inline FASTFLOAT_CONSTEXPR14 bool

0 commit comments

Comments
 (0)