mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
[ruby/json] Drop the leftovers of runtime SSE2 detection
Neither the `__builtin_cpu_supports` probe in conf.rb nor `cpuid.h` has a use now that SSE2 is assumed on x86-64. The probe kept SIMD off on GCC older than 4.8, and the `HAVE_CPUID_H` guard broke builds that have `x86intrin.h` but not `cpuid.h` with a redefinition of `find_simd_implementation`. https://github.com/ruby/json/commit/fae76b9eb4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1c7e4ce28f
commit
76f0a79179
2 files changed
+2
-9
No files matched your search
@@ -1,16 +1,15 @@
|
||||
case RbConfig::CONFIG['host_cpu']
|
||||
when /^(arm|aarch64)/
|
||||
# Try to compile a small program using NEON instructions
|
||||
header, type, init, extra = 'arm_neon.h', 'uint8x16_t', 'vdupq_n_u8(32)', nil
|
||||
header, type, init = 'arm_neon.h', 'uint8x16_t', 'vdupq_n_u8(32)'
|
||||
when /^(x86_64|x64)/
|
||||
header, type, init, extra = 'x86intrin.h', '__m128i', '_mm_set1_epi8(32)', 'if (__builtin_cpu_supports("sse2")) { printf("OK"); }'
|
||||
header, type, init = 'x86intrin.h', '__m128i', '_mm_set1_epi8(32)'
|
||||
end
|
||||
if header
|
||||
if have_header(header) && try_compile(<<~SRC, '-Werror=implicit-function-declaration')
|
||||
#{cpp_include(header)}
|
||||
int main(int argc, char **argv) {
|
||||
#{type} test = #{init};
|
||||
#{extra}
|
||||
if (argc > 100000) printf("%p", &test);
|
||||
return 0;
|
||||
}
|
||||
@@ -20,5 +19,3 @@ if header
|
||||
puts "Disable SIMD"
|
||||
end
|
||||
end
|
||||
|
||||
have_header('cpuid.h')
|
||||
@@ -143,7 +143,6 @@ ALWAYS_INLINE(static) int string_scan_simd_neon(const char **ptr, const char *en
|
||||
#define HAVE_SIMD 1
|
||||
#define HAVE_SIMD_SSE2 1
|
||||
|
||||
#ifdef HAVE_CPUID_H
|
||||
#define FIND_SIMD_IMPLEMENTATION_DEFINED 1
|
||||
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
@@ -182,9 +181,6 @@ ALWAYS_INLINE(static) TARGET_SSE2 int string_scan_simd_sse2(const char **ptr, co
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <cpuid.h>
|
||||
#endif /* HAVE_CPUID_H */
|
||||
|
||||
static inline SIMD_Implementation find_simd_implementation(void)
|
||||
{
|
||||
// SSE2 is part of the x86-64 baseline.
|
||||
|
||||
Reference in new issue
Block a user