File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change 1
- if RbConfig ::CONFIG [ 'host_cpu' ] =~ /^(arm.*|aarch64.*)/
1
+ case RbConfig ::CONFIG [ 'host_cpu' ]
2
+ when /^(arm|aarch64)/
2
3
# Try to compile a small program using NEON instructions
3
4
if have_header ( 'arm_neon.h' )
4
5
have_type ( 'uint8x16_t' , headers = [ 'arm_neon.h' ] ) && try_compile ( <<~'SRC' )
8
9
if (argc > 100000) printf("%p", &test);
9
10
return 0;
10
11
}
11
- SRC
12
- $defs. push ( "-DJSON_ENABLE_SIMD" )
12
+ SRC
13
+ $defs. push ( "-DJSON_ENABLE_SIMD" )
13
14
end
14
- end
15
-
16
- if have_header ( 'x86intrin.h' ) && have_type ( '__m128i' , headers = [ 'x86intrin.h' ] ) && try_compile ( <<~'SRC' )
17
- #include <x86intrin.h>
18
- int main(int argc, char **argv) {
19
- __m128i test = _mm_set1_epi8(32);
20
- if (argc > 100000) printf("%p", &test);
21
- return 0;
22
- }
23
- SRC
15
+ when /^(x86_64|x64)/
16
+ if have_header ( 'x86intrin.h' ) && have_type ( '__m128i' , headers = [ 'x86intrin.h' ] ) && try_compile ( <<~'SRC' )
17
+ #include <x86intrin.h>
18
+ int main(int argc, char **argv) {
19
+ __m128i test = _mm_set1_epi8(32);
20
+ if (argc > 100000) printf("%p", &test);
21
+ return 0;
22
+ }
23
+ SRC
24
24
$defs. push ( "-DJSON_ENABLE_SIMD" )
25
+ end
25
26
end
26
27
27
28
have_header ( 'cpuid.h' )
You can’t perform that action at this time.
0 commit comments