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 2496CA0547; Tue, 20 Jul 2021 00:34:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 981674068F; Tue, 20 Jul 2021 00:34:48 +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 566704068B; Tue, 20 Jul 2021 00:34:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1626734084; cv=none; d=zohomail.eu; s=zohoarc; b=S8ai8hbrWts+AQf5N9ojnj/1BftWazgKhGWCIAW4Uy+Si7Y2/vlw3h36+3XFW9U/u8GmdRMI82vYwk0mJY5qtQlv1Y1dGehtw9RTiUl2BG9HseVBCLyhlsBJ8kCWsrIUrGDUNMnL/rUvDVDagXWQh827xDLeQzX8cl5B3hLq3P0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1626734084; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To; bh=gulP3m68bcu2ox9Cu26ENmEpyaeQO5K4KXGr1KW80jA=; b=kWBAC+c1gRv8fE3zTiWk9ceYR4jsjLL8QvdrQB366jKJ71V1M5b2CDeROFKRHbEzKq37Y9nYDPeQZj7l75PKO8pFXPULeTZz0RYgAaQrZIHG+XF8pW7afiL8n4Oju5FwJhwnK0J671H/xZuIadCuDbRgehKGkMk82JOGDc8F8bU= ARC-Authentication-Results: i=1; mx.zohomail.eu; spf=pass smtp.mailfrom=liangma@liangbit.com; dmarc=pass header.from= Received: from DESKTOP-POQV63C.localdomain (93.107.66.56 [93.107.66.56]) by mx.zoho.eu with SMTPS id 1626734083389305.2627700303052; Tue, 20 Jul 2021 00:34:43 +0200 (CEST) From: Liang Ma To: dev@dpdk.org Cc: leyi.rong@intel.com, Liang Ma , stable@dpdk.org, Bruce Richardson , Konstantin Ananyev Date: Mon, 19 Jul 2021 23:34:33 +0100 Message-Id: <20210719223433.2109-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 v2] build: check AVX512 rather than compiler version 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 --- config/x86/meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/x86/meson.build b/config/x86/meson.build index b9348c44de..77370a91f7 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 not is_windows + 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 and cc.has_argument('-mno-avx512f') + 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