[PATCH] D135930: [X86] Add AVX-NE-CONVERT instructions.

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 28 09:12:26 PDT 2022


pengfei added inline comments.


================
Comment at: clang/lib/Headers/avx512vlbf16intrin.h:164
+#define _mm_cvtneps_pbh(A) \
+  ((__m128bh)__builtin_ia32_vcvtneps2bf16128((__v4sf)(A)))
 
----------------
RKSimon wrote:
> Is there no way for __attribute__ to allow different attribute permutations?
> 
> Also, can we keep the __builtin_ia32_cvtneps2bf16_128 naming convention?
> Is there no way for attribute to allow different attribute permutations?

We have discussed this problem with GCC folks. There are two problems here:
1. Unlike builtins, function attributes are more generic. It may introduce a lot of checks between callers and callees. I had a research to limit it to `__always_inline__` functions only. However, Clang handles inlining in middle-end, we don't have such information in the front-end. Besides, we don't know how to merge different permutations if they are inlining to the same function.
2. We don't know how to put the permutations into IR's function attributes. We need to preserve all permutations for inlining reference, but the backend needs a determine feature list rather than selective.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135930



More information about the cfe-commits mailing list