41
41
#define SIMDJSON_IS_ARM64 1
42
42
#else
43
43
#define SIMDJSON_IS_32BITS 1
44
+
45
+ // We do not support 32-bit platforms, but it can be
46
+ // handy to identify them.
47
+ #if defined(_M_IX86) || defined(__i386__)
48
+ #define SIMDJSON_IS_X86_32BITS 1
49
+ #elif defined(__arm__) || defined(_M_ARM)
50
+ #define SIMDJSON_IS_ARM_32BITS 1
44
51
#endif
45
52
53
+ #endif // defined(__x86_64__) || defined(_M_AMD64)
54
+
46
55
#ifdef SIMDJSON_IS_32BITS
47
- #if defined(SIMDJSON_REGULAR_VISUAL_STUDIO) || defined(__GNUC__)
48
- #pragma message("The simdjson library is designed\
49
- for 64 -bit processors and it seems that you are not \
56
+ #pragma message("The simdjson library is designed \
57
+ for 64 -bit processors and it seems that you are not \
50
58
compiling for a known 64 -bit platform. All fast kernels \
51
59
will be disabled and performance may be poor. Please \
52
60
use a 64 -bit target such as x64 or 64 -bit ARM." )
53
- #else
54
- #error " The simdjson library is designed\
55
- for 64 -bit processors. It seems that you are not \
56
- compiling for a known 64 -bit platform."
57
- #endif
58
61
#endif // SIMDJSON_IS_32BITS
59
62
60
63
// this is almost standard?
@@ -75,6 +78,15 @@ compiling for a known 64-bit platform."
75
78
#define SIMDJSON_IMPLEMENTATION_WESTMERE 0
76
79
#endif // SIMDJSON_IS_ARM64
77
80
81
+ // Our fast kernels require 64-bit systems.
82
+ //
83
+ // On 32-bit x86, we lack 64-bit popcnt, lzcnt, blsr instructions.
84
+ // Furthermore, the number of SIMD registers is reduced.
85
+ //
86
+ // On 32-bit ARM, we would have smaller registers.
87
+ //
88
+ // The simdjson users should still have the fallback kernel. It is
89
+ // slower, but it should run everywhere.
78
90
#if SIMDJSON_IS_X86_64
79
91
#ifndef SIMDJSON_IMPLEMENTATION_HASWELL
80
92
#define SIMDJSON_IMPLEMENTATION_HASWELL 1
@@ -85,7 +97,7 @@ compiling for a known 64-bit platform."
85
97
#define SIMDJSON_IMPLEMENTATION_ARM64 0
86
98
#endif // SIMDJSON_IS_X86_64
87
99
88
- // we are going to use runtime dispatch
100
+ // We are going to use runtime dispatch.
89
101
#ifdef SIMDJSON_IS_X86_64
90
102
#ifdef __clang__
91
103
// clang does not have GCC push pop
0 commit comments