diff --git a/implementation__detection_8h_source.html b/implementation__detection_8h_source.html index b33d040ac..ee4759fca 100644 --- a/implementation__detection_8h_source.html +++ b/implementation__detection_8h_source.html @@ -119,110 +119,146 @@ $(document).ready(function(){initNavTree('implementation__detection_8h_source.ht
26 #ifndef SIMDJSON_IMPLEMENTATION_ARM64
27 #define SIMDJSON_IMPLEMENTATION_ARM64 (SIMDJSON_IS_ARM64)
28 #endif
-
29 #define SIMDJSON_CAN_ALWAYS_RUN_ARM64 SIMDJSON_IMPLEMENTATION_ARM64 && SIMDJSON_IS_ARM64
-
30 
-
31 // Default Icelake to on if this is x86-64. Even if we're not compiled for it, it could be selected
-
32 // at runtime.
-
33 #ifndef SIMDJSON_IMPLEMENTATION_ICELAKE
-
34 #define SIMDJSON_IMPLEMENTATION_ICELAKE ((SIMDJSON_IS_X86_64) && (SIMDJSON_AVX512_ALLOWED) && (SIMDJSON_COMPILER_SUPPORTS_VBMI2))
-
35 #endif
-
36 
-
37 #ifdef _MSC_VER
-
38 // To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this next line, see
-
39 // https://github.com/simdjson/simdjson/issues/1247
-
40 #define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE ((SIMDJSON_IMPLEMENTATION_ICELAKE) && (__AVX2__) && (__AVX512F__) && (__AVX512DQ__) && (__AVX512CD__) && (__AVX512BW__) && (__AVX512VL__) && (__AVX512VBMI2__))
-
41 #else
-
42 #define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE ((SIMDJSON_IMPLEMENTATION_ICELAKE) && (__AVX2__) && (__BMI__) && (__PCLMUL__) && (__LZCNT__) && (__AVX512F__) && (__AVX512DQ__) && (__AVX512CD__) && (__AVX512BW__) && (__AVX512VL__) && (__AVX512VBMI2__))
-
43 #endif
-
44 
-
45 // Default Haswell to on if this is x86-64. Even if we're not compiled for it, it could be selected
-
46 // at runtime.
-
47 #ifndef SIMDJSON_IMPLEMENTATION_HASWELL
-
48 #if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE
-
49 // if icelake is always available, never enable haswell.
-
50 #define SIMDJSON_IMPLEMENTATION_HASWELL 0
-
51 #else
-
52 #define SIMDJSON_IMPLEMENTATION_HASWELL SIMDJSON_IS_X86_64
-
53 #endif
-
54 #endif
-
55 #ifdef _MSC_VER
-
56 // To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this next line, see
-
57 // https://github.com/simdjson/simdjson/issues/1247
-
58 #define SIMDJSON_CAN_ALWAYS_RUN_HASWELL ((SIMDJSON_IMPLEMENTATION_HASWELL) && (SIMDJSON_IS_X86_64) && (__AVX2__))
-
59 #else
-
60 #define SIMDJSON_CAN_ALWAYS_RUN_HASWELL ((SIMDJSON_IMPLEMENTATION_HASWELL) && (SIMDJSON_IS_X86_64) && (__AVX2__) && (__BMI__) && (__PCLMUL__) && (__LZCNT__))
-
61 #endif
-
62 
-
63 // Default Westmere to on if this is x86-64.
-
64 #ifndef SIMDJSON_IMPLEMENTATION_WESTMERE
-
65 #if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL
-
66 // if icelake or haswell are always available, never enable westmere.
-
67 #define SIMDJSON_IMPLEMENTATION_WESTMERE 0
-
68 #else
-
69 #define SIMDJSON_IMPLEMENTATION_WESTMERE SIMDJSON_IS_X86_64
-
70 #endif
-
71 #endif
-
72 #define SIMDJSON_CAN_ALWAYS_RUN_WESTMERE (SIMDJSON_IMPLEMENTATION_WESTMERE && SIMDJSON_IS_X86_64 && __SSE4_2__ && __PCLMUL__)
-
73 
-
74 #ifndef SIMDJSON_IMPLEMENTATION_PPC64
-
75 #define SIMDJSON_IMPLEMENTATION_PPC64 (SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX)
-
76 #endif
-
77 #define SIMDJSON_CAN_ALWAYS_RUN_PPC64 SIMDJSON_IMPLEMENTATION_PPC64 && SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX
+
29 #if SIMDJSON_IMPLEMENTATION_ARM64 && SIMDJSON_IS_ARM64
+
30 #define SIMDJSON_CAN_ALWAYS_RUN_ARM64 1
+
31 #else
+
32 #define SIMDJSON_CAN_ALWAYS_RUN_ARM64 0
+
33 #endif
+
34 
+
35 // Default Icelake to on if this is x86-64. Even if we're not compiled for it, it could be selected
+
36 // at runtime.
+
37 #ifndef SIMDJSON_IMPLEMENTATION_ICELAKE
+
38 #define SIMDJSON_IMPLEMENTATION_ICELAKE ((SIMDJSON_IS_X86_64) && (SIMDJSON_AVX512_ALLOWED) && (SIMDJSON_COMPILER_SUPPORTS_VBMI2))
+
39 #endif
+
40 
+
41 #ifdef _MSC_VER
+
42 // To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this next line, see
+
43 // https://github.com/simdjson/simdjson/issues/1247
+
44 #if ((SIMDJSON_IMPLEMENTATION_ICELAKE) && (__AVX2__) && (__AVX512F__) && (__AVX512DQ__) && (__AVX512CD__) && (__AVX512BW__) && (__AVX512VL__) && (__AVX512VBMI2__))
+
45 #define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE 1
+
46 #else
+
47 #define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE 0
+
48 #endif
+
49 
+
50 #else
+
51 
+
52 #if ((SIMDJSON_IMPLEMENTATION_ICELAKE) && (__AVX2__) && (__BMI__) && (__PCLMUL__) && (__LZCNT__) && (__AVX512F__) && (__AVX512DQ__) && (__AVX512CD__) && (__AVX512BW__) && (__AVX512VL__) && (__AVX512VBMI2__))
+
53 #define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE 1
+
54 #else
+
55 #define SIMDJSON_CAN_ALWAYS_RUN_ICELAKE 0
+
56 #endif
+
57 
+
58 #endif
+
59 
+
60 // Default Haswell to on if this is x86-64. Even if we're not compiled for it, it could be selected
+
61 // at runtime.
+
62 #ifndef SIMDJSON_IMPLEMENTATION_HASWELL
+
63 #if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE
+
64 // if icelake is always available, never enable haswell.
+
65 #define SIMDJSON_IMPLEMENTATION_HASWELL 0
+
66 #else
+
67 #define SIMDJSON_IMPLEMENTATION_HASWELL SIMDJSON_IS_X86_64
+
68 #endif
+
69 #endif
+
70 #ifdef _MSC_VER
+
71 // To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this next line, see
+
72 // https://github.com/simdjson/simdjson/issues/1247
+
73 #if ((SIMDJSON_IMPLEMENTATION_HASWELL) && (SIMDJSON_IS_X86_64) && (__AVX2__))
+
74 #define SIMDJSON_CAN_ALWAYS_RUN_HASWELL 1
+
75 #else
+
76 #define SIMDJSON_CAN_ALWAYS_RUN_HASWELL 0
+
77 #endif
78 
-
79 #ifndef SIMDJSON_IMPLEMENTATION_LASX
-
80 #define SIMDJSON_IMPLEMENTATION_LASX (SIMDJSON_IS_LOONGARCH64 && __loongarch_asx)
-
81 #endif
-
82 #define SIMDJSON_CAN_ALWAYS_RUN_LASX (SIMDJSON_IMPLEMENTATION_LASX)
-
83 
-
84 #ifndef SIMDJSON_IMPLEMENTATION_LSX
-
85 #if SIMDJSON_CAN_ALWAYS_RUN_LASX
-
86 #define SIMDJSON_IMPLEMENTATION_LSX 0
-
87 #else
-
88 #define SIMDJSON_IMPLEMENTATION_LSX (SIMDJSON_IS_LOONGARCH64 && __loongarch_sx)
-
89 #endif
-
90 #endif
-
91 #define SIMDJSON_CAN_ALWAYS_RUN_LSX (SIMDJSON_IMPLEMENTATION_LSX)
-
92 
-
93 // Default Fallback to on unless a builtin implementation has already been selected.
-
94 #ifndef SIMDJSON_IMPLEMENTATION_FALLBACK
-
95 #if SIMDJSON_CAN_ALWAYS_RUN_ARM64 || SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL || SIMDJSON_CAN_ALWAYS_RUN_WESTMERE || SIMDJSON_CAN_ALWAYS_RUN_PPC64 || SIMDJSON_CAN_ALWAYS_RUN_LSX || SIMDJSON_CAN_ALWAYS_RUN_LASX
-
96 // if anything at all except fallback can always run, then disable fallback.
-
97 #define SIMDJSON_IMPLEMENTATION_FALLBACK 0
-
98 #else
-
99 #define SIMDJSON_IMPLEMENTATION_FALLBACK 1
-
100 #endif
-
101 #endif
-
102 #define SIMDJSON_CAN_ALWAYS_RUN_FALLBACK SIMDJSON_IMPLEMENTATION_FALLBACK
-
103 
-
104 // Determine the best builtin implementation
-
105 #ifndef SIMDJSON_BUILTIN_IMPLEMENTATION
-
106 
-
107 #if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE
-
108 #define SIMDJSON_BUILTIN_IMPLEMENTATION icelake
-
109 #elif SIMDJSON_CAN_ALWAYS_RUN_HASWELL
-
110 #define SIMDJSON_BUILTIN_IMPLEMENTATION haswell
-
111 #elif SIMDJSON_CAN_ALWAYS_RUN_WESTMERE
-
112 #define SIMDJSON_BUILTIN_IMPLEMENTATION westmere
-
113 #elif SIMDJSON_CAN_ALWAYS_RUN_ARM64
-
114 #define SIMDJSON_BUILTIN_IMPLEMENTATION arm64
-
115 #elif SIMDJSON_CAN_ALWAYS_RUN_PPC64
-
116 #define SIMDJSON_BUILTIN_IMPLEMENTATION ppc64
-
117 #elif SIMDJSON_CAN_ALWAYS_RUN_LSX
-
118 #define SIMDJSON_BUILTIN_IMPLEMENTATION lsx
-
119 #elif SIMDJSON_CAN_ALWAYS_RUN_LASX
-
120 #define SIMDJSON_BUILTIN_IMPLEMENTATION lasx
-
121 #elif SIMDJSON_CAN_ALWAYS_RUN_FALLBACK
-
122 #define SIMDJSON_BUILTIN_IMPLEMENTATION fallback
+
79 #else
+
80 
+
81 #if ((SIMDJSON_IMPLEMENTATION_HASWELL) && (SIMDJSON_IS_X86_64) && (__AVX2__) && (__BMI__) && (__PCLMUL__) && (__LZCNT__))
+
82 #define SIMDJSON_CAN_ALWAYS_RUN_HASWELL 1
+
83 #else
+
84 #define SIMDJSON_CAN_ALWAYS_RUN_HASWELL 0
+
85 #endif
+
86 
+
87 #endif
+
88 
+
89 // Default Westmere to on if this is x86-64.
+
90 #ifndef SIMDJSON_IMPLEMENTATION_WESTMERE
+
91 #if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL
+
92 // if icelake or haswell are always available, never enable westmere.
+
93 #define SIMDJSON_IMPLEMENTATION_WESTMERE 0
+
94 #else
+
95 #define SIMDJSON_IMPLEMENTATION_WESTMERE SIMDJSON_IS_X86_64
+
96 #endif
+
97 #endif
+
98 
+
99 #if (SIMDJSON_IMPLEMENTATION_WESTMERE && SIMDJSON_IS_X86_64 && __SSE4_2__ && __PCLMUL__)
+
100 #define SIMDJSON_CAN_ALWAYS_RUN_WESTMERE 1
+
101 #else
+
102 #define SIMDJSON_CAN_ALWAYS_RUN_WESTMERE 0
+
103 #endif
+
104 
+
105 
+
106 #ifndef SIMDJSON_IMPLEMENTATION_PPC64
+
107 #define SIMDJSON_IMPLEMENTATION_PPC64 (SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX)
+
108 #endif
+
109 #if SIMDJSON_IMPLEMENTATION_PPC64 && SIMDJSON_IS_PPC64 && SIMDJSON_IS_PPC64_VMX
+
110 #define SIMDJSON_CAN_ALWAYS_RUN_PPC64 1
+
111 #else
+
112 #define SIMDJSON_CAN_ALWAYS_RUN_PPC64 0
+
113 #endif
+
114 
+
115 #ifndef SIMDJSON_IMPLEMENTATION_LASX
+
116 #define SIMDJSON_IMPLEMENTATION_LASX (SIMDJSON_IS_LOONGARCH64 && __loongarch_asx)
+
117 #endif
+
118 #define SIMDJSON_CAN_ALWAYS_RUN_LASX (SIMDJSON_IMPLEMENTATION_LASX)
+
119 
+
120 #ifndef SIMDJSON_IMPLEMENTATION_LSX
+
121 #if SIMDJSON_CAN_ALWAYS_RUN_LASX
+
122 #define SIMDJSON_IMPLEMENTATION_LSX 0
123 #else
-
124 #error "All possible implementations (including fallback) have been disabled! simdjson will not run."
+
124 #define SIMDJSON_IMPLEMENTATION_LSX (SIMDJSON_IS_LOONGARCH64 && __loongarch_sx)
125 #endif
-
126 
-
127 #endif // SIMDJSON_BUILTIN_IMPLEMENTATION
+
126 #endif
+
127 #define SIMDJSON_CAN_ALWAYS_RUN_LSX (SIMDJSON_IMPLEMENTATION_LSX)
128 
-
129 #define SIMDJSON_BUILTIN_IMPLEMENTATION_ID SIMDJSON_IMPLEMENTATION_ID_FOR(SIMDJSON_BUILTIN_IMPLEMENTATION)
-
130 #define SIMDJSON_BUILTIN_IMPLEMENTATION_IS(IMPL) SIMDJSON_BUILTIN_IMPLEMENTATION_ID == SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL)
-
131 
-
132 #endif // SIMDJSON_IMPLEMENTATION_DETECTION_H
+
129 // Default Fallback to on unless a builtin implementation has already been selected.
+
130 #ifndef SIMDJSON_IMPLEMENTATION_FALLBACK
+
131 #if SIMDJSON_CAN_ALWAYS_RUN_ARM64 || SIMDJSON_CAN_ALWAYS_RUN_ICELAKE || SIMDJSON_CAN_ALWAYS_RUN_HASWELL || SIMDJSON_CAN_ALWAYS_RUN_WESTMERE || SIMDJSON_CAN_ALWAYS_RUN_PPC64 || SIMDJSON_CAN_ALWAYS_RUN_LSX || SIMDJSON_CAN_ALWAYS_RUN_LASX
+
132 // if anything at all except fallback can always run, then disable fallback.
+
133 #define SIMDJSON_IMPLEMENTATION_FALLBACK 0
+
134 #else
+
135 #define SIMDJSON_IMPLEMENTATION_FALLBACK 1
+
136 #endif
+
137 #endif
+
138 #define SIMDJSON_CAN_ALWAYS_RUN_FALLBACK SIMDJSON_IMPLEMENTATION_FALLBACK
+
139 
+
140 // Determine the best builtin implementation
+
141 #ifndef SIMDJSON_BUILTIN_IMPLEMENTATION
+
142 
+
143 #if SIMDJSON_CAN_ALWAYS_RUN_ICELAKE
+
144 #define SIMDJSON_BUILTIN_IMPLEMENTATION icelake
+
145 #elif SIMDJSON_CAN_ALWAYS_RUN_HASWELL
+
146 #define SIMDJSON_BUILTIN_IMPLEMENTATION haswell
+
147 #elif SIMDJSON_CAN_ALWAYS_RUN_WESTMERE
+
148 #define SIMDJSON_BUILTIN_IMPLEMENTATION westmere
+
149 #elif SIMDJSON_CAN_ALWAYS_RUN_ARM64
+
150 #define SIMDJSON_BUILTIN_IMPLEMENTATION arm64
+
151 #elif SIMDJSON_CAN_ALWAYS_RUN_PPC64
+
152 #define SIMDJSON_BUILTIN_IMPLEMENTATION ppc64
+
153 #elif SIMDJSON_CAN_ALWAYS_RUN_LSX
+
154 #define SIMDJSON_BUILTIN_IMPLEMENTATION lsx
+
155 #elif SIMDJSON_CAN_ALWAYS_RUN_LASX
+
156 #define SIMDJSON_BUILTIN_IMPLEMENTATION lasx
+
157 #elif SIMDJSON_CAN_ALWAYS_RUN_FALLBACK
+
158 #define SIMDJSON_BUILTIN_IMPLEMENTATION fallback
+
159 #else
+
160 #error "All possible implementations (including fallback) have been disabled! simdjson will not run."
+
161 #endif
+
162 
+
163 #endif // SIMDJSON_BUILTIN_IMPLEMENTATION
+
164 
+
165 #define SIMDJSON_BUILTIN_IMPLEMENTATION_ID SIMDJSON_IMPLEMENTATION_ID_FOR(SIMDJSON_BUILTIN_IMPLEMENTATION)
+
166 #define SIMDJSON_BUILTIN_IMPLEMENTATION_IS(IMPL) SIMDJSON_BUILTIN_IMPLEMENTATION_ID == SIMDJSON_IMPLEMENTATION_ID_FOR(IMPL)
+
167 
+
168 #endif // SIMDJSON_IMPLEMENTATION_DETECTION_H