DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Abdullah Sevincer <abdullah.sevincer@intel.com>
Subject: [PATCH v1 2/8] event/dlb2: use global AVX-512 variables
Date: Mon, 30 Sep 2024 18:50:26 +0100	[thread overview]
Message-ID: <20240930175033.2283861-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20240930175033.2283861-1-bruce.richardson@intel.com>

Replace per-driver checks for AVX-512 with the standard variables from
config/x86.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/event/dlb2/meson.build | 42 ++++++++--------------------------
 1 file changed, 9 insertions(+), 33 deletions(-)

diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.build
index 515d1795fe..34131fd18b 100644
--- a/drivers/event/dlb2/meson.build
+++ b/drivers/event/dlb2/meson.build
@@ -26,43 +26,19 @@ sources = files(
 # we are building 64-bit binary (checked above) AND binutils
 # can generate proper code
 
-if binutils_ok
+if target_has_avx512
+    sources += files('dlb2_avx512.c')
+    cflags += '-DCC_AVX512_SUPPORT'
 
-    # compile AVX512 version if either:
-    # a. we have AVX512VL supported in minimum instruction set
-    #    baseline
-    # b. it's not minimum instruction set, but supported by
-    #    compiler
-    #
-    # in former case, just add avx512 C file to files list
-    # in latter case, compile c file to static lib, using correct
-    # compiler flags, and then have the .o file from static lib
-    # linked into main lib.
-
-    # check if all required flags already enabled (variant a).
-    dlb2_avx512_on = false
-    if cc.get_define('__AVX512VL__', args: machine_args) != ''
-        dlb2_avx512_on = true
-    endif
-
-    if dlb2_avx512_on == true
-
-        sources += files('dlb2_avx512.c')
-        cflags += '-DCC_AVX512_SUPPORT'
-
-    elif cc.has_multi_arguments('-mavx512vl')
-
-        cflags += '-DCC_AVX512_SUPPORT'
-        avx512_tmplib = static_library('avx512_tmp',
+elif cc_has_avx512
+    cflags += '-DCC_AVX512_SUPPORT'
+    avx512_tmplib = static_library('avx512_tmp',
                                'dlb2_avx512.c',
                                dependencies: [static_rte_eal, static_rte_eventdev],
-                               c_args: cflags + ['-mavx512vl'])
-        objs += avx512_tmplib.extract_objects('dlb2_avx512.c')
-    else
-        sources += files('dlb2_sse.c')
-    endif
+                               c_args: cflags + cc_avx512_flags)
+    objs += avx512_tmplib.extract_objects('dlb2_avx512.c')
 else
-        sources += files('dlb2_sse.c')
+    sources += files('dlb2_sse.c')
 endif
 
 headers = files('rte_pmd_dlb2.h')
-- 
2.43.0


  parent reply	other threads:[~2024-09-30 17:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30 17:50 [PATCH v1 0/8] centralize AVX-512 feature detection Bruce Richardson
2024-09-30 17:50 ` [PATCH v1 1/8] config/x86: add global defines for checking AVX-512 Bruce Richardson
2024-09-30 17:50 ` Bruce Richardson [this message]
2024-09-30 17:50 ` [PATCH v1 3/8] common/idpf: use global AVX-512 variables Bruce Richardson
2024-09-30 17:50 ` [PATCH v1 4/8] net/cpfl: " Bruce Richardson
2024-09-30 17:50 ` [PATCH v1 5/8] net/i40e: " Bruce Richardson
2024-09-30 17:50 ` [PATCH v1 6/8] net/iavf: " Bruce Richardson
2024-09-30 17:50 ` [PATCH v1 7/8] net/ice: " Bruce Richardson
2024-09-30 17:50 ` [PATCH v1 8/8] net/idpf: " Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240930175033.2283861-3-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=abdullah.sevincer@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).