diff mbox series

[ovs-dev] dpif-netdev-extract-avx512: Protect GCC builtin usage.

Message ID 20220621155248.3031687-1-cian.ferriter@intel.com
State Accepted
Commit 23ed22594d159cd5549443252a666238034b0c17
Headers show
Series [ovs-dev] dpif-netdev-extract-avx512: Protect GCC builtin usage. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/intel-ovs-compilation success test: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Ferriter, Cian June 21, 2022, 3:52 p.m. UTC
__builtin_constant_p is only available in GCC and only versions >= 4.
Use the same "#if __GNUC__ >= 4" check used in other parts of OVS for
this builtin.

Signed-off-by: Cian Ferriter <cian.ferriter@intel.com>
---
 lib/dpif-netdev-extract-avx512.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ilya Maximets June 28, 2022, 4:26 p.m. UTC | #1
On 6/21/22 17:52, Cian Ferriter wrote:
> __builtin_constant_p is only available in GCC and only versions >= 4.
> Use the same "#if __GNUC__ >= 4" check used in other parts of OVS for
> this builtin.
> 
> Signed-off-by: Cian Ferriter <cian.ferriter@intel.com>
> ---
>  lib/dpif-netdev-extract-avx512.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/dpif-netdev-extract-avx512.c b/lib/dpif-netdev-extract-avx512.c
> index 12271be17..f1919befd 100644
> --- a/lib/dpif-netdev-extract-avx512.c
> +++ b/lib/dpif-netdev-extract-avx512.c
> @@ -128,7 +128,11 @@ _mm512_maskz_permutexvar_epi8_selector(__mmask64 k_shuf, __m512i v_shuf,
>      __m512i v512_zeros = _mm512_setzero_si512();
>      __m512i v_blk0;
>  #if HAVE_AVX512VBMI
> +#if __GNUC__ >= 4
>      if (__builtin_constant_p(use_vbmi) && use_vbmi) {
> +#else
> +    if (use_vbmi) {
> +#endif
>          /* As different AVX512 ISA levels have different implementations,
>          * this specializes on the use_vbmi attribute passed in.
>          */

Thanks!  Applied and backported down to 2.16.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/lib/dpif-netdev-extract-avx512.c b/lib/dpif-netdev-extract-avx512.c
index 12271be17..f1919befd 100644
--- a/lib/dpif-netdev-extract-avx512.c
+++ b/lib/dpif-netdev-extract-avx512.c
@@ -128,7 +128,11 @@  _mm512_maskz_permutexvar_epi8_selector(__mmask64 k_shuf, __m512i v_shuf,
     __m512i v512_zeros = _mm512_setzero_si512();
     __m512i v_blk0;
 #if HAVE_AVX512VBMI
+#if __GNUC__ >= 4
     if (__builtin_constant_p(use_vbmi) && use_vbmi) {
+#else
+    if (use_vbmi) {
+#endif
         /* As different AVX512 ISA levels have different implementations,
         * this specializes on the use_vbmi attribute passed in.
         */