From d33208c7db6225ed606bdeefb2d8ff425279d294 Mon Sep 17 00:00:00 2001 From: mswilson Date: Tue, 10 Dec 2019 10:12:17 -0800 Subject: [PATCH] Correct detection of NEON support (#392) ... as the test as it is currently implemented will always evaluate to true. Fixes #389 --- include/simdjson/isadetection.h | 2 +- src/jsonparser.cpp | 2 +- src/jsonstream.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/simdjson/isadetection.h b/include/simdjson/isadetection.h index 1040f2f9d..328df2918 100644 --- a/include/simdjson/isadetection.h +++ b/include/simdjson/isadetection.h @@ -74,7 +74,7 @@ enum instruction_set { #if defined(__arm__) || defined(__aarch64__) // incl. armel, armhf, arm64 -#if defined(__NEON__) +#if defined(__ARM_NEON) static inline uint32_t detect_supported_architectures() { return instruction_set::NEON; diff --git a/src/jsonparser.cpp b/src/jsonparser.cpp index fff629e23..b2d466d02 100644 --- a/src/jsonparser.cpp +++ b/src/jsonparser.cpp @@ -42,7 +42,7 @@ Architecture find_best_supported_implementation() { return Architecture::HASWELL; if ((westmere_flags & supports) == westmere_flags) return Architecture::WESTMERE; - if (instruction_set::NEON) + if (supports & instruction_set::NEON) return Architecture::ARM64; return Architecture::NONE; diff --git a/src/jsonstream.cpp b/src/jsonstream.cpp index aacd2dfc6..a4a252777 100755 --- a/src/jsonstream.cpp +++ b/src/jsonstream.cpp @@ -211,7 +211,7 @@ void find_the_best_supported_implementation() { } #endif #ifdef IS_ARM64 - if (instruction_set::NEON) { + if (supports & instruction_set::NEON) { best_stage1 = simdjson::find_structural_bits; best_stage2 = simdjson::unified_machine; return;