mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-09-14 14:42:26 +08:00
FASTFLOAT_HAS_SIMD -> FASTFLOAT_USE_SIMD
This commit is contained in:
parent
262ed0c0fe
commit
bfbe4c4869
@ -52,6 +52,9 @@ Introduced new optional macros to minimize overhead when certain parsing feature
|
||||
|
||||
* **`FASTFLOAT_X86_SIMD`**
|
||||
Automatically uses reworking SSE parsing algorithms to improve performance on x86 machines.
|
||||
|
||||
* **`FASTFLOAT_USE_SIMD`**
|
||||
Add possibility to completely disable manual algorithms realization and give compiler more freedom
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ namespace fast_float {
|
||||
|
||||
template <typename UC>
|
||||
fastfloat_really_inline constexpr bool has_simd_opt() noexcept {
|
||||
#ifdef FASTFLOAT_HAS_SIMD
|
||||
#ifdef FASTFLOAT_USE_SIMD
|
||||
return std::is_same<UC, char16_t>::value;
|
||||
#else
|
||||
return false;
|
||||
@ -79,7 +79,7 @@ read_chars_to_unsigned(UC const *chars) noexcept {
|
||||
return val;
|
||||
}
|
||||
|
||||
#if FASTFLOAT_HAS_SIMD
|
||||
#if FASTFLOAT_USE_SIMD
|
||||
|
||||
#if FASTFLOAT_X86_SIMD
|
||||
|
||||
@ -181,7 +181,7 @@ parse_four_digits_unrolled(uint32_t val) noexcept {
|
||||
return (((val & 0x00FF00FF) * 0x00640001) >> 16) & 0xFFFF;
|
||||
}
|
||||
|
||||
#if FASTFLOAT_HAS_SIMD
|
||||
#if FASTFLOAT_USE_SIMD
|
||||
|
||||
#if FASTFLOAT_X86_SIMD
|
||||
|
||||
@ -415,7 +415,7 @@ loop_parse_if_digits(UC const *&p, UC const *const pend, uint64_t &i) noexcept {
|
||||
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 void
|
||||
loop_parse_if_digits(char const *&p, char const *const pend,
|
||||
uint64_t &i) noexcept {
|
||||
#if FASTFLOAT_X86_SIMD >= 42 && FASTFLOAT_HAS_SIMD
|
||||
#if FASTFLOAT_X86_SIMD >= 42 && FASTFLOAT_USE_SIMD
|
||||
if (!is_constant_evaluated()) {
|
||||
/*
|
||||
* SSE4.2 handles 16 bytes at once.
|
||||
|
||||
@ -187,7 +187,7 @@ using parse_options = parse_options_t<char>;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef FASTFLOAT_HAS_SIMD // user defined
|
||||
#ifdef FASTFLOAT_USE_SIMD // user defined
|
||||
#else
|
||||
#ifdef FASTFLOAT_X86_SIMD // user defined level
|
||||
static_assert(FASTFLOAT_X86_SIMD == 20 || FASTFLOAT_X86_SIMD == 42 ||
|
||||
@ -219,10 +219,10 @@ static_assert(FASTFLOAT_X86_SIMD == 20 || FASTFLOAT_X86_SIMD == 42 ||
|
||||
#endif
|
||||
|
||||
#if defined(FASTFLOAT_X86_SIMD) || defined(FASTFLOAT_ARM_NEON)
|
||||
#define FASTFLOAT_HAS_SIMD 1
|
||||
#define FASTFLOAT_USE_SIMD 1
|
||||
#endif
|
||||
|
||||
#if FASTFLOAT_HAS_SIMD
|
||||
#if FASTFLOAT_USE_SIMD
|
||||
#if defined(__GNUC__)
|
||||
// disable -Wcast-align=strict (GCC only)
|
||||
#define FASTFLOAT_SIMD_DISABLE_WARNINGS \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user