[PATCH] D89105: [X86] Support Intel avxvnni

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 23:36:23 PDT 2020


pengfei added inline comments.


================
Comment at: clang/lib/Headers/avxvnniintrin.h:32
+#include "commonvnniintrin.h"
+
+/* Intrinsics with _avx_ prefix are for compatibility with msvc. */
----------------
pengfei wrote:
> craig.topper wrote:
> > pengfei wrote:
> > > Maybe we can move `commonvnniintrin.h` to `immintrin.h`. Then we don't have a different layout.
> > > ```
> > > #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) ||      \
> > >      defined(__AVX512VNNI__) || (defined(__AVX512VL__) && defined(__AVX512VNNI__))
> > > #include <commonvnniintrin.h>
> > > #endif
> > > ```
> > gcc appears to have just put the common intrinsics in avxvnniintrin.h. Why can't we do that?
> I asked GCC guys. They don't use macro like `defined(__AVXVNNI__)`. If we put it in avxvnniintrin.h, we need handle macro `AVX512VNNI` in avxvnniintrin.h. It's bit confused.
> 
> @LiuChen3 I meant `__AVXVNNI__` for the first `__AVX512VNNI__` in last comment.
Or maybe we can put the common intrinsics in avx512vlvnniintrin.h and not to handle macro `__AVXVNNI__` int it.
I think it's reasonable. For Linux, we always include all headers. For Windows, we can only allow user use the `_avx_` intrinscis for `AVXVNNI`, which is compatible with MSVC.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89105/new/

https://reviews.llvm.org/D89105



More information about the llvm-commits mailing list