[PATCH] D53912: [Headers] [MS] Add intrin0.h

Stephan T. Lavavej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 2 14:51:13 PDT 2018


STL_MSFT added a comment.

Yes, the "real builtin" approach seems to be best. For a recent example, https://reviews.llvm.org/D49606 added `__shiftright128` as an inline function in intrin.h, but that didn't work with MSVC's STL when I moved our declaration of `__shiftright128` from intrin.h to intrin0.h. This was fixed by https://reviews.llvm.org/D50907 making `__shiftright128` a real builtin.

For the record, MSVC's intrin.h declares ~880 intrinsics (plus many many more from immintrin.h etc.) and it includes intrin0.h to get the declarations of ~130 intrinsics. There is no duplication - each intrinsic is declared in either the small intrin0.h or the large intrin.h. MSVC's STL then includes intrin0.h in its headers for increased throughput. We occasionally move intrinsics from intrin.h to intrin0.h as we discover that they're needed in the STL (as we've recently done for `__shiftright128`, `_umul128`, `_BitScanForward[64]`, and `_BitScanReverse[64]`).


Repository:
  rC Clang

https://reviews.llvm.org/D53912





More information about the cfe-commits mailing list