On 1/26/2022 7:45 PM, William Tu wrote:
Ubuntu Xenial 16.04 is using GCC 5.4 and it does not support
target "-mavx512vpopcntdq" and cuases error
   lib/dpif-netdev-lookup-avx512-gather.c:356:47:
   error: attribute(target("avx512vpopcntdq")) is unknown
GCC 7+ supports vpopcntdq:
https://gcc.gnu.org/gcc-7/changes.html
The patch detects vpopcntdq and disables AVX512 when not found.

Reported-by: Greg Rose <gvrose8...@gmail.com>
Signed-off-by: William Tu <u9012...@gmail.com>
---
  acinclude.m4 | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 5c971e98ce91..0c360fd1ef73 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -77,7 +77,7 @@ dnl Checks if compiler and binutils supports AVX512.
  AC_DEFUN([OVS_CHECK_AVX512], [
    OVS_CHECK_BINUTILS_AVX512
    OVS_CHECK_CC_OPTION(
-    [-mavx512f], [ovs_have_cc_mavx512f=yes], [ovs_have_cc_mavx512f=no])
+    [-mavx512f -mavx512vpopcntdq], [ovs_have_cc_mavx512f=yes], 
[ovs_have_cc_mavx512f=no])
    AM_CONDITIONAL([HAVE_AVX512F], [test $ovs_have_cc_mavx512f = yes])
    if test "$ovs_have_cc_mavx512f" = yes; then
      AC_DEFINE([HAVE_AVX512F], [1],

Tested-by: Greg Rose <gvrose8...@gmail.com>
Reviewed-by: Greg Rose <gvrose8...@gmail.com>

Thanks William!
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to