[clang] [clang] Add `intrin0.h` header to mimic `intrin0.h` used by MSVC STL for clang-cl (PR #75711)

Max Winkler via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 20:26:29 PST 2023


MaxEW707 wrote:

MSVC STL requires the x64 adc intel intrinsics. I moved those to a separate file `adcintrin.h` that can be included from `immintrin.h` and `intrin0.h` for x64.

I also made a table [here ](https://gist.github.com/MaxEW707/2f4bf26801bc1b6b088aa7a2fadba526) of all the intrinsics available with MSVC's `intrin0.h`, which intrinsics are used by MSVC STL, which are used by MSVC STL when compiled under clang and which intrinsics are provided as builtins from clang.

You will notice that the `_ReadWriteBarrier` compiler barrier isn't supported on arm by clang.  This [godbolt](https://godbolt.org/z/xEv3oEbK6) appears to corroborate that finding. I am not too worried about this since I believe Microsoft is dropping 32-bit ARM in a future Windows 11 update if my memory is correct.

The last table at the end shows the intrinsics that aren't implemented in clang but MSVC STL has workarounds using the clang intrinsics instead. We don't have to worry about supporting those.


https://github.com/llvm/llvm-project/pull/75711


More information about the cfe-commits mailing list