Repository navigation
Commit f92d002
Allow setting XSIMD_WITH_SSE3, SSSE3, SSE4_1 and SSE4_2 manually with MSVC (#1430)
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_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 #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 <[email protected]>1 parent 514204f commit f92d002
1 file changed
Lines changed: 32 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
| |||
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
125 | 135 | | |
126 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
127 | 141 | | |
128 | 142 | | |
129 | 143 | | |
| |||
133 | 147 | | |
134 | 148 | | |
135 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
136 | 153 | | |
137 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
138 | 159 | | |
139 | 160 | | |
140 | 161 | | |
| |||
144 | 165 | | |
145 | 166 | | |
146 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
147 | 171 | | |
148 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
149 | 177 | | |
150 | 178 | | |
151 | 179 | | |
| |||
0 commit comments