From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC07FA0C48; Tue, 20 Jul 2021 15:36:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C2774068B; Tue, 20 Jul 2021 15:36:58 +0200 (CEST) Received: from sender11-of-o51.zoho.eu (sender11-of-o51.zoho.eu [31.186.226.237]) by mails.dpdk.org (Postfix) with ESMTP id D15C740689; Tue, 20 Jul 2021 15:36:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1626788214; cv=none; d=zohomail.eu; s=zohoarc; b=KUJHoXgMnrWRdE//roC/fgKg//WzEM3UtF3Pyg3jcv5yErc50JVxZlSWpxgTmh78igmrLHelAtwt+tpCxfeY9eN+yAonIN66kwuFA9MWPhsVS9eNlVITHWpco6Een7KKcSMb4gVgsuyDUCEDzdh2dmQ+EnMxhPLX1FD4uRCR0oQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1626788214; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To; bh=wFounSQfE7x8WJjoTr8WS160PV7rl1xfE3DFCUY45o4=; b=QQnYtTmgKLBYC9l5Tyn53rSIguwD0/SZc6hVAKrAR6IesDNmyG6XM9iMZbQ0wN4M5v1zbfU+F7GBfjMwJCkQ9ybkBqy53U7BW6/JpJtg3RQ1fIWzADqjQudosOaoZWHJ00OQ2b1hnvDqfEfXG4wXPA2yy6+m4gF3/xXXibo9sy8= ARC-Authentication-Results: i=1; mx.zohomail.eu; spf=pass smtp.mailfrom=liangma@liangbit.com; dmarc=pass header.from= Received: from DESKTOP-POQV63C.localdomain (51.37.210.143 [51.37.210.143]) by mx.zoho.eu with SMTPS id 1626788214387334.5737726283588; Tue, 20 Jul 2021 15:36:54 +0200 (CEST) From: Liang Ma To: dev@dpdk.org Cc: leyi.rong@intel.com, Liang Ma , stable@dpdk.org, Bruce Richardson , Konstantin Ananyev Date: Tue, 20 Jul 2021 14:36:45 +0100 Message-Id: <20210720133645.938-1-liangma@liangbit.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210717170830.1736-1-liangma@liangbit.com> References: <20210717170830.1736-1-liangma@liangbit.com> X-ZohoMailClient: External Subject: [dpdk-dev] [PATCH v4] build: check for broken AVX-512 compiler support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Liang Ma GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype. Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6. This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512. Bugzilla ID: 717 Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) Cc: stable@dpdk.org Reported-by: Liang Ma Signed-off-by: Liang Ma Acked-by: Bruce richardson --- config/x86/meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/x86/meson.build b/config/x86/meson.build index b9348c44de..87b051cd2d 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -10,6 +10,19 @@ if not is_windows endif endif +#check if compiler is working with _mm512_extracti64x4_epi64 +#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 +if cc.has_argument('-mavx512f') + code = '''#include + void test(__m512i zmm){ + __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' + result = cc.compiles(code, args : '-mavx512f', name : 'AVX512 checking') + if result == false + machine_args += '-mno-avx512f' + warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') + endif +endif + # we require SSE4.2 for DPDK if cc.get_define('__SSE4_2__', args: machine_args) == '' message('SSE 4.2 not enabled by default, explicitly enabling') -- 2.17.1