Repository navigation
marzer.tomlplusplus: no SSE2 path under the MSVC ABI (revision 2) - #575
Merged
Merged
Conversation
…ath (revision 2) <emmintrin.h> defines its intrinsics static inline. Under the MSVC ABI clang gives such a function the same mangled name in every module whose global module fragment includes the header, so a unit that imports both std (MSVC's library includes the intrinsics) and tomlplusplus fails with "definition with same mangled name '?_mm_movemask_epi8@@...'". toml++ used SSE2 only to skip ASCII faster; with TOML_ENABLE_SIMD 0 the scalar path parses the same documents and the module includes no intrinsics header.
The collision is an MSVC-ABI one; Linux, macOS and MinGW keep toml++'s SSE2 path.
Member
Author
|
Narrowed: |
Sunrisepeak
added a commit
that referenced
this pull request
Oct 26, 2026
* marzer.tomlplusplus: the module unit builds toml++ without its SSE2 path (revision 2) <emmintrin.h> defines its intrinsics static inline. Under the MSVC ABI clang gives such a function the same mangled name in every module whose global module fragment includes the header, so a unit that imports both std (MSVC's library includes the intrinsics) and tomlplusplus fails with "definition with same mangled name '?_mm_movemask_epi8@@...'". toml++ used SSE2 only to skip ASCII faster; with TOML_ENABLE_SIMD 0 the scalar path parses the same documents and the module includes no intrinsics header. * marzer.tomlplusplus: turn SSE2 off under the MSVC ABI only (_MSC_VER) The collision is an MSVC-ABI one; Linux, macOS and MinGW keep toml++'s SSE2 path.
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.
A unit that imports both
stdandtomlplusplusdoes not compile with clang under the MSVC ABI (found by openmui's Windows CI, Sunrisepeak/mui#1):<emmintrin.h>defines its intrinsicsstatic inline; under the MSVC ABI clang gives such a function the same mangled name in every module whose global module fragment includes the header, and MSVC's library (behindstd) includes it too. toml++ includes it only for its SSE2 fast path (impl/simd.hpp), which skips ASCII faster.The generated module unit now defines
TOML_ENABLE_SIMD 0in its global module fragment, so the module includes no intrinsics header; the scalar path parses the same documents (checked with GCC and clang: parsing works and noemmintrin.his included). The payload changes, so the revision goes to 2 on every platform.