On Mon, Nov 9, 2020 at 11:31 AM Hongtao Liu <crazy...@gmail.com> wrote:
>
> >
> > +      /* Support unified builtin.  */
> > +      || (mask2 == OPTION_MASK_ISA2_AVXVNNI)
> >
> > I don't think we gain anything with unified builtins. Better, just
> > introduce separate builtins, e.g for
> >
>
> Unified builtins are used for unified intrinsics, intrinsics users may prefer
> same interface and let compiler decide encoding version. Separate
> buitins may cause
> some defination ambiguous when target attribute is used, see avx-vnni-2.c.
> We also provide separate intrinsics interface for compatibility with
> different compilers(llvm/msvc/icc).

Hm, the new intrinsics file introduces:

+#ifdef __AVXVNNI__
+#define _mm256_dpbusd_avx_epi32(A, B, C) \
+  _mm256_dpbusd_epi32((A), (B), (C))
...
+#endif /* __AVXVNNI__ */
+
+#define _mm256_dpbusd_epi32(A, B, C)                \
+  ((__m256i) __builtin_ia32_vpdpbusd_v8si ((__v8si) (A),    \
+                       (__v8si) (B),    \
+                       (__v8si) (C)))
+

And there are two versions of intrinsics:

_mm256_dpbusd_avx_epi32
_mm256_dpbusd_epi32

So, is _mm256_dpusb_epi32 active for either

OPTION_MASK_ISA_AVX512VNNI | OPTION_MASK_ISA_AVX512VL

or

OPTION_MASK_ISA2_AVXVNNI ?

Is _mm265_dpbusb_avx_epi32 the "compatibility intrinsics"?

In case the above is correct, please expand the comment

+      /* Support unified builtin.  */
+      || (mask2 == OPTION_MASK_ISA2_AVXVNNI)

with the above information, what kind of unified builtin is this.

Please also note that #defines won't be tested in e.g. sse-13.c, where:

--q--
  Defining away "extern" and "__inline" results in all of them being
  compiled as proper functions.  */

#define extern
#define __inline
--/q--

so these defines should be reimplemented as extern inline functions.

Uros.

Reply via email to