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 ABE21A04BB; Wed, 2 Sep 2020 13:20:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 48C9EE07; Wed, 2 Sep 2020 13:20:26 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6015A255 for ; Wed, 2 Sep 2020 13:20:24 +0200 (CEST) IronPort-SDR: u2oZP27L/WIOhZtv2Kle08Bv2aIhcaavsMtNTGwZRW99XTH63/ylUVWtERKQ5NQuqn64aSnw14 oFWV+HW/NWDg== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="154767892" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="154767892" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 04:20:22 -0700 IronPort-SDR: WelgQ8vwoPRSfn84HvaN5V6Cv6LV0LZeQaBzdxLNn5kQeJvD8nsvCu/rJPfYYO82bgm3NjBunU RHpkgV+nISTw== X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="477601064" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.3.68]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 02 Sep 2020 04:20:19 -0700 Date: Wed, 2 Sep 2020 12:20:16 +0100 From: Bruce Richardson To: Radu Nicolau Cc: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, viktorin@rehivetech.com, ruifeng.wang@arm.com, jerinj@marvell.com, drc@linux.vnet.ibm.com, konstantin.ananyev@intel.com, Sean Morrissey Message-ID: <20200902112016.GB1064@bricha3-MOBL.ger.corp.intel.com> References: <20200902104343.31774-1-radu.nicolau@intel.com> <20200902104343.31774-2-radu.nicolau@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200902104343.31774-2-radu.nicolau@intel.com> Subject: Re: [dpdk-dev] [PATCH v1 1/4] x86: change cpuflag macros to compiler macros 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 Wed, Sep 02, 2020 at 10:43:40AM +0000, Radu Nicolau wrote: > Replace use of RTE_MACHINE_CPUFLAG macros with regular compiler > macros. > I think it's worth noting in the commit log that the set of macros provided by the compilers are more complete than those provided by DPDK, and by not having our own it allows new instruction sets to be leveraged without having to do extra work to set them up in DPDK. > Signed-off-by: Sean Morrissey > Signed-off-by: Radu Nicolau > --- > app/test/test_memcpy_perf.c | 8 ++++---- > config/x86/meson.build | 2 -- > drivers/net/enic/Makefile | 2 +- > drivers/net/enic/meson.build | 2 +- > drivers/net/i40e/Makefile | 2 +- > drivers/net/i40e/meson.build | 2 +- > drivers/net/iavf/Makefile | 2 +- > drivers/net/iavf/meson.build | 2 +- > drivers/net/ice/Makefile | 2 +- > drivers/net/ice/meson.build | 2 +- > examples/l3fwd/l3fwd_em.c | 4 ++-- > lib/librte_acl/Makefile | 2 +- > lib/librte_acl/meson.build | 2 +- > lib/librte_eal/common/rte_random.c | 4 ++-- > lib/librte_eal/x86/include/rte_memcpy.h | 8 ++++---- > lib/librte_efd/rte_efd_x86.h | 2 +- > lib/librte_hash/rte_cuckoo_hash.c | 2 +- > lib/librte_member/rte_member_ht.c | 10 +++++----- > lib/librte_member/rte_member_x86.h | 2 +- > lib/librte_net/rte_net_crc.c | 2 +- > mk/rte.cpuflags.mk | 1 - > 21 files changed, 31 insertions(+), 34 deletions(-) > > @@ -231,7 +231,7 @@ em_mask_key(void *key, xmm_t mask) > > return vandq_s32(data, mask); > } > -#elif defined(RTE_MACHINE_CPUFLAG_ALTIVEC) > +#elif defined(__ALTIVEC__) Not an x86 flag. Belongs in patch 3. > static inline xmm_t > em_mask_key(void *key, xmm_t mask) > { > diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile > index f4332b044..3b591c2ed 100644 > --- a/lib/librte_acl/Makefile > +++ b/lib/librte_acl/Makefile > @@ -38,7 +38,7 @@ endif > # > > #check if flag for AVX2 is already on, if not set it up manually > -ifeq ($(findstring RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2) > +ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),) > CC_AVX2_SUPPORT=1 > else > CC_AVX2_SUPPORT=\ > diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build > index d1e2c184c..b31a3f798 100644 > --- a/lib/librte_acl/meson.build > +++ b/lib/librte_acl/meson.build > @@ -15,7 +15,7 @@ if dpdk_conf.has('RTE_ARCH_X86') > # in former case, just add avx2 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. > - if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2') > + if cc.get_define('__AVX2__', args: machine_args) != '' Since this is used in a number of places, we probably should just get the result in a variable in config/x86/meson.build. > sources += files('acl_run_avx2.c') > cflags += '-DCC_AVX2_SUPPORT' > elif cc.has_argument('-mavx2')