Repository navigation
Use SSE2 on x86-64 without checking at runtime - #1116
Merged
Merged
Conversation
__builtin_cpu_supports refers to __cpu_model in compiler-rt, which clang-cl does not link, so generator.so and parser.so failed with an undefined symbol. SSE2 is part of the x86-64 baseline, as NEON is for AArch64, where no check is made either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With clang-cl on mswin,
generator.soandparser.sofailed to link with an undefined__cpu_model.__builtin_cpu_supportsrefers to it in compiler-rt, which clang-cl does not link. SSE2 is part of the x86-64 baseline, so this uses it without checking, as is already done for NEON on AArch64.Linux and macOS resolve
__cpu_modelfrom libgcc or compiler-rt, and the check always returnedSIMD_SSE2on x86-64, so nothing changes there. The first commit is a forward-port of ruby/ruby@2f88a23ad0.The second commit removes the
__builtin_cpu_supportsprobe inconf.rband thecpuid.hcheck and include, which only existed for that check. The probe was added for #827 and now only keeps SIMD off on GCC older than 4.8, so those compilers get SIMD with this change. TheHAVE_CPUID_Hguard also made builds fail wherex86intrin.hexists withoutcpuid.h.Generated with Claude Code