From: Bruce Richardson Subject: [PATCH 5/7] efd: add new avx2 standalone file to build Date: Tue, 17 Oct 2017 11:41:11 +0100 Message-ID: <20171017104113.175250-6-bruce.richardson@intel.com> References: <20171017104113.175250-1-bruce.richardson@intel.com> Cc: Bruce Richardson To: dev@dpdk.org Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B2B121B805 for ; Tue, 17 Oct 2017 13:02:20 +0200 (CEST) In-Reply-To: <20171017104113.175250-1-bruce.richardson@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Bruce Richardson --- lib/librte_efd/meson.build | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/librte_efd/meson.build b/lib/librte_efd/meson.build index 73c004e70..01e7a22db 100644 --- a/lib/librte_efd/meson.build +++ b/lib/librte_efd/meson.build @@ -32,3 +32,22 @@ sources = files('rte_efd.c') headers = files('rte_efd.h') deps += ['ring', 'hash'] + +if arch_subdir == 'x86' + # compile AVX2 version if either: + # a. we have AVX supported in minimum instruction set baseline + # b. it's not minimum instruction set, but supported by compiler + # + # 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') + sources += files('rte_efd_x86.c') + elif cc.has_argument('-mavx2') + avx2_tmplib = static_library('avx2_efd_tmp', + 'rte_efd_x86.c', + dependencies: rte_eal, + c_args: '-mavx2') + objs += avx2_tmplib.extract_objects('rte_efd_x86.c') + endif +endif -- 2.13.6