Repository navigation
Allow setting XSIMD_WITH_SSE3, SSSE3, SSE4_1 and SSE4_2 manually with MSVC - #1430
Merged
Merged
Conversation
… MSVC MSVC doesn't define __SSE3__, __SSSE3__, __SSE4_1__ or __SSE4_2__ even with /arch:SSE4.2. So users need to define these reserved identifiers to enable these instruction sets with MSVC since xtensor-stack#881. But defining them may break other libraries. For example, simdjson >= 5 uses GCC builtins such as __builtin_ctz when __SSE2__ is defined: apache/arrow#51690 This allows users to set XSIMD_WITH_SSE3, XSIMD_WITH_SSSE3, XSIMD_WITH_SSE4_1 and XSIMD_WITH_SSE4_2 manually only with MSVC. For example, users can enable SSE4.2 with MSVC by -DXSIMD_WITH_SSE4_2=1. Lower instruction sets are enabled automatically by the existing MSVC workaround. This also allows selecting SSE3 or SSSE3 with MSVC requested in xtensor-stack#878. Other compilers including clang-cl define these macros based on compiler flags and require the corresponding compiler flags to use intrinsics. So setting them manually with other compilers is reported as an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Apache Arrow needs only |
JohanMabille
approved these changes
Oct 16, 2026
Member
|
Thanks! |
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.
MSVC doesn't define
__SSE3__,__SSSE3__,__SSE4_1__or__SSE4_2__even with/arch:SSE4.2. So users need to define these reserved identifiers to enable these instruction sets with MSVC since #881. But defining them may break other libraries. For example, simdjson >= 5 uses GCC builtins such as__builtin_ctzwhen__SSE2__is defined: apache/arrow#51690This allows users to set
XSIMD_WITH_SSE3,XSIMD_WITH_SSSE3,XSIMD_WITH_SSE4_1andXSIMD_WITH_SSE4_2manually only with MSVC. For example, users can enable SSE4.2 with MSVC by-DXSIMD_WITH_SSE4_2=1. Lower instruction sets are enabled automatically by the existing MSVC workaround. This also allows selecting SSE3 or SSSE3 with MSVC requested in #878.Other compilers including clang-cl define these macros based on compiler flags and require the corresponding compiler flags to use intrinsics. So setting them manually with other compilers is reported as an error.