> -----Original Message-----
> From: Ferriter, Cian <[email protected]>
> Sent: Thursday, February 24, 2022 11:57 AM
> To: [email protected]
> Cc: Ferriter, Cian <[email protected]>; Van Haaren, Harry
> <[email protected]>
> Subject: [PATCH 3/4] acinclude: Add seperate check for AVX512VBMI ISA.
> 
> Only use the "avx512vbmi" compiler target when it is actually supported
> by the compiler.

Overall this patchset is a good step, by enabling finer-grained checks for ISA.
A suggestion below on how we could perhaps improve the implementation for
the VBMI ISA in particular.

<snip>

>  /* Wrapper function required to enable ISA. */
>  static inline __m512i
> +#if HAVE_AVX512VBMI
>  __attribute__((__target__("avx512vbmi")))
> +#endif
>  _mm512_maskz_permutexvar_epi8_wrap(__mmask64 kmask, __m512i idx,
> __m512i a)
>  {
>      return _mm512_maskz_permutexvar_epi8(kmask, idx, a);
> @@ -626,10 +628,16 @@ mfex_avx512_process(struct dp_packet_batch
> *packets,
>  }

The above function is always compiled in, also when the compiler doesn't support
the VBMI ISA. If the ISA supported by the compiler, the 
__attribute__((__target__(...))
allows the compiler to actually emit those instructions.

This works fine, however if the ISA is not supported, the function is still 
registered/available
to OVS (but the ISA is "downgraded" to AVX512-F, so there's no issue here).

Instead of "downgrading" the ISA in the function, it is also possible to not 
compile/register
the VBMI implementation of the functionality at all. I think this would be 
cleaner, as it avoids
functions existing without the expected ISA inside them.

Thoughts?

<snip>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to