diff --git a/include/simdjson/simdjson.h b/include/simdjson/simdjson.h index 9a16692d..4190aeaf 100644 --- a/include/simdjson/simdjson.h +++ b/include/simdjson/simdjson.h @@ -12,7 +12,7 @@ enum class instruction_set { // the 'native' enum class value should point at a good default on the current machine #ifdef __AVX2__ native = avx2 -#elif defined(__ARM_NEON) +#elif defined(__ARM_NEON) || (defined(_MSC_VER) && defined(_M_ARM64)) native = neon #else // Let us assume that we have an old x64 processor, but one that has SSE (i.e., something diff --git a/src/jsonparser.cpp b/src/jsonparser.cpp index 7f82471a..be17b069 100644 --- a/src/jsonparser.cpp +++ b/src/jsonparser.cpp @@ -14,10 +14,10 @@ int json_parse_dispatch(const uint8_t *buf, size_t len, ParsedJson &pj, bool rea #ifdef __AVX2__ json_parse_functype* avx_implementation = &json_parse_implementation; #endif -#ifdef __SSE4_2__ +#if defined(__SSE4_2__) || (defined(_MSC_VER) && defined(_M_AMD64)) json_parse_functype* sse4_2_implementation = &json_parse_implementation; #endif -#ifdef __ARM_NEON +#if defined(__ARM_NEON) || (defined(_MSC_VER) && defined(_M_ARM64)) json_parse_functype* neon_implementation = &json_parse_implementation; #endif @@ -25,9 +25,9 @@ int json_parse_dispatch(const uint8_t *buf, size_t len, ParsedJson &pj, bool rea // Should be done at runtime. Does not make any sense on preprocessor. #ifdef __AVX2__ instruction_set best_implementation = instruction_set::avx2; -#elif defined (__SSE4_2__) +#elif defined (__SSE4_2__) || (defined(_MSC_VER) && defined(_M_AMD64)) instruction_set best_implementation = instruction_set::sse4_2; -#elif defined (__ARM_NEON) +#elif defined (__ARM_NEON) || (defined(_MSC_VER) && defined(_M_ARM64)) instruction_set best_implementation = instruction_set::neon; #else instruction_set best_implementation = instruction_set::none; @@ -45,7 +45,7 @@ int json_parse_dispatch(const uint8_t *buf, size_t len, ParsedJson &pj, bool rea json_parse_ptr = sse4_2_implementation; break; #endif -#ifdef __ARM_NEON +#if defined(__ARM_NEON) || (defined(_MSC_VER) && defined(_M_ARM64)) case instruction_set::neon : json_parse_ptr = neon_implementation; break;