[v3,10/10] net: use global AVX-512 variables

Message ID 20241008165258.2802099-11-bruce.richardson@intel.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series centralize AVX-512 feature detection |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Bruce Richardson Oct. 8, 2024, 4:52 p.m. UTC
Replace some library-specific checks for AVX-512 with the standard
variables from config/x86.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/net/meson.build | 40 ++++------------------------------------
 1 file changed, 4 insertions(+), 36 deletions(-)
  

Patch

diff --git a/lib/net/meson.build b/lib/net/meson.build
index 0b69138949..f9bef3afc9 100644
--- a/lib/net/meson.build
+++ b/lib/net/meson.build
@@ -38,25 +38,11 @@  deps += ['mbuf']
 
 if dpdk_conf.has('RTE_ARCH_X86_64')
     net_crc_sse42_cpu_support = (cc.get_define('__PCLMUL__', args: machine_args) != '')
-    net_crc_avx512_cpu_support = (
-            cc.get_define('__AVX512F__', args: machine_args) != '' and
-            cc.get_define('__AVX512BW__', args: machine_args) != '' and
-            cc.get_define('__AVX512DQ__', args: machine_args) != '' and
-            cc.get_define('__AVX512VL__', args: machine_args) != '' and
-            cc.get_define('__VPCLMULQDQ__', args: machine_args) != ''
+    net_crc_avx512_cpu_support = (target_has_avx512 and cc.get_define('__VPCLMULQDQ__', args: machine_args) != ''
     )
 
     net_crc_sse42_cc_support = (cc.has_argument('-mpclmul') and cc.has_argument('-maes'))
-    net_crc_avx512_cc_support = (
-            not machine_args.contains('-mno-avx512f') and
-            cc.has_argument('-mavx512f') and
-            cc.has_argument('-mavx512bw') and
-            cc.has_argument('-mavx512dq') and
-            cc.has_argument('-mavx512vl') and
-            cc.has_argument('-mvpclmulqdq') and
-            cc.has_argument('-mavx2') and
-            cc.has_argument('-mavx')
-    )
+    net_crc_avx512_cc_support = (cc.has_argument('-mvpclmulqdq') and cc_has_avx512)
 
     build_static_net_crc_sse42_lib = 0
     build_static_net_crc_avx512_lib = 0
@@ -69,15 +55,7 @@  if dpdk_conf.has('RTE_ARCH_X86_64')
             cflags += ['-DCC_X86_64_AVX512_VPCLMULQDQ_SUPPORT']
         elif net_crc_avx512_cc_support == true
             build_static_net_crc_avx512_lib = 1
-            net_crc_avx512_lib_cflags = [
-                    '-mavx512f',
-                    '-mavx512bw',
-                    '-mavx512dq',
-                    '-mavx512vl',
-                    '-mvpclmulqdq',
-                    '-mavx2',
-                    '-mavx',
-            ]
+            net_crc_avx512_lib_cflags = cc_avx512_flags + ['-mvpclmulqdq']
             cflags += ['-DCC_X86_64_AVX512_VPCLMULQDQ_SUPPORT']
         endif
     elif net_crc_sse42_cc_support == true
@@ -86,17 +64,7 @@  if dpdk_conf.has('RTE_ARCH_X86_64')
         cflags += ['-DCC_X86_64_SSE42_PCLMULQDQ_SUPPORT']
         if net_crc_avx512_cc_support == true
             build_static_net_crc_avx512_lib = 1
-            net_crc_avx512_lib_cflags = [
-                    '-mpclmul',
-                    '-maes',
-                    '-mavx512f',
-                    '-mavx512bw',
-                    '-mavx512dq',
-                    '-mavx512vl',
-                    '-mvpclmulqdq',
-                    '-mavx2',
-                    '-mavx',
-            ]
+            net_crc_avx512_lib_cflags = cc_avx512_flags + ['-mvpclmulqdq', '-mpclmul']
             cflags += ['-DCC_X86_64_AVX512_VPCLMULQDQ_SUPPORT']
         endif
     endif