From patchwork Tue Oct 17 10:41:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 30476 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EAB31B815; Tue, 17 Oct 2017 13:02:26 +0200 (CEST) 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) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2017 04:02:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,390,1503385200"; d="scan'208";a="324143401" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by fmsmga004.fm.intel.com with ESMTP; 17 Oct 2017 04:02:19 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Tue, 17 Oct 2017 11:41:11 +0100 Message-Id: <20171017104113.175250-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171017104113.175250-1-bruce.richardson@intel.com> References: <20171017104113.175250-1-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 5/7] efd: add new avx2 standalone file to build 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" 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