From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4A9F5A0521; Tue, 3 Nov 2020 14:28:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B227ECA49; Tue, 3 Nov 2020 14:28:13 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 64CD6CA3B for ; Tue, 3 Nov 2020 14:28:12 +0100 (CET) IronPort-SDR: N4ttRZrXimg78sT6XypR0TTtw9gWj4PtUuMnNMYJUnrHHHl89YzUF1ACCE+ygmJgh+oWO4gPw2 HIrmeCqk7Lbw== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="169182687" X-IronPort-AV: E=Sophos;i="5.77,448,1596524400"; d="scan'208";a="169182687" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2020 05:28:10 -0800 IronPort-SDR: dk9tzqtay7pVVufqbD+bhKlHEDKvljbI/Aa9IfDy630B2htkvnvS6dte1GACx3jtjvy1TJrQv1 PcnQJNbEflJA== X-IronPort-AV: E=Sophos;i="5.77,448,1596524400"; d="scan'208";a="538490803" Received: from bricha3-mobl.ger.corp.intel.com ([10.249.45.202]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 03 Nov 2020 05:28:08 -0800 Date: Tue, 3 Nov 2020 13:28:04 +0000 From: Bruce Richardson To: Leyi Rong Cc: qi.z.zhang@intel.com, ferruh.yigit@intel.com, dev@dpdk.org Message-ID: <20201103132804.GC1144@bricha3-MOBL.ger.corp.intel.com> References: <20201103125629.56030-1-leyi.rong@intel.com> <20201103125629.56030-2-leyi.rong@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201103125629.56030-2-leyi.rong@intel.com> Subject: Re: [dpdk-dev] [PATCH 1/2] net/ice: fix build error on lower version GCC X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Nov 03, 2020 at 08:56:28PM +0800, Leyi Rong wrote: > Fix the build error when -march=skylake-avx512 is not supported on > lower version GCC. > > Fixes: ef5d52dae5e2 ("net/ice: add AVX512 vector path") > > Signed-off-by: Leyi Rong > --- > drivers/net/ice/meson.build | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/ice/meson.build b/drivers/net/ice/meson.build > index 7d54a49236..ec8933aa1a 100644 > --- a/drivers/net/ice/meson.build > +++ b/drivers/net/ice/meson.build > @@ -46,12 +46,21 @@ if arch_subdir == 'x86' > > if ice_avx512_cpu_support == true or ice_avx512_cc_support == true > cflags += ['-DCC_AVX512_SUPPORT'] > - ice_avx512_lib = static_library('ice_avx512_lib', > - 'ice_rxtx_vec_avx512.c', > - dependencies: [static_rte_ethdev, > - static_rte_kvargs, static_rte_hash], > - include_directories: includes, > - c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw']) > + if cc.has_argument('-march=skylake-avx512') > + ice_avx512_lib = static_library('ice_avx512_lib', > + 'ice_rxtx_vec_avx512.c', > + dependencies: [static_rte_ethdev, > + static_rte_kvargs, static_rte_hash], > + include_directories: includes, > + c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw']) > + else > + ice_avx512_lib = static_library('ice_avx512_lib', > + 'ice_rxtx_vec_avx512.c', > + dependencies: [static_rte_ethdev, > + static_rte_kvargs, static_rte_hash], > + include_directories: includes, > + c_args: [cflags, '-mavx512f', '-mavx512bw']) > + endif Rather than duplicating the whole static_library call, you can just do: avx512_cflags = [cflags, '-mavx512f', '-mavx512bw'] if cc.has_argument('-march=skylake-avx512') avx512_cflags += '-march=skylake-avx512' endif and then use avx512_cflags inside a single static_library call. Much shorter code. /Bruce > objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c') > endif > endif > -- > 2.17.1 >