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 88FA145AE3; Tue, 8 Oct 2024 18:53:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 213F340DC9; Tue, 8 Oct 2024 18:53:09 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id 1A63D4060A for ; Tue, 8 Oct 2024 18:53:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728406385; x=1759942385; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X1O2Bv6YmvFR10aY3fP27Qrz81ZuRRTkHkAsQyPy5KY=; b=X1WZS7Hy+waj6VSf1ccdCnicOFNUgepcVUn8UV/Da7vd3ywYOxOPOM/h 9d5NcLzmMAN5n9xLTzC9gCnutVQhruzDQtc0Pm4rP+oup/5c2lF/oteob LXCBim/QUVw8nQdZAITGyA8BkClmw3174aksu4zLMu/x0Iz4nce03ybiJ 4DRSt8PjTixAmdn86LWVa5eahJw8jvElL3HF29YFWksXrOtMyiNmD88CB JSzaSPjVMj/3scZsyppdSVBM3zyqnoA4wdiUhTNMGwLd/o2vek7Mo4j7S T0owp9k+b6XSoUCDgl2hXjbasw8wfrzq1IFopFBbDrv97SljP9mMMTJHr g==; X-CSE-ConnectionGUID: 5fBZh1ilSjGQNw7MTBX7UA== X-CSE-MsgGUID: zSZyal1aTQuS6MQI8uHhVw== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="31516994" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="31516994" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 09:53:05 -0700 X-CSE-ConnectionGUID: 9G8p2xMUR6CU7a0uvuwnLw== X-CSE-MsgGUID: 2/DwGx+TRF6XBtqnEz1n/A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="79883025" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by fmviesa003.fm.intel.com with ESMTP; 08 Oct 2024 09:53:04 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson Subject: [PATCH v3 01/10] config/x86: add global defines for checking AVX-512 Date: Tue, 8 Oct 2024 17:52:49 +0100 Message-ID: <20241008165258.2802099-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241008165258.2802099-1-bruce.richardson@intel.com> References: <20240930175033.2283861-1-bruce.richardson@intel.com> <20241008165258.2802099-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Rather than having each driver do its own checking for AVX-512 support, let's do it once in config/x86/meson.build and let all drivers re-use that result. Signed-off-by: Bruce Richardson --- config/x86/meson.build | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/config/x86/meson.build b/config/x86/meson.build index 8087b9ae91..265580a555 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -14,16 +14,27 @@ if is_linux or cc.get_id() == 'gcc' 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') +cc_avx512_flags = ['-mavx512f', '-mavx512vl', '-mavx512dq', '-mavx512bw'] +cc_has_avx512 = false +target_has_avx512 = false +if binutils_ok and cc.has_multi_arguments(cc_avx512_flags) + # check if compiler is working with _mm512_extracti64x4_epi64 + # Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 code = '''#include void test(__m512i zmm){ __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' - result = cc.compiles(code, args : '-mavx512f', name : 'AVX512 checking') + result = cc.compiles(code, args : cc_avx512_flags, name : 'AVX512 checking') if result == false machine_args += '-mno-avx512f' warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') + else + cc_has_avx512 = true + target_has_avx512 = ( + cc.get_define('__AVX512F__', args: machine_args) != '' and + cc.get_define('__AVX512BW__', args: machine_args) != '' and + cc.get_define('__AVX512DQ__', args: machine_args) != '' and + cc.get_define('__AVX512VL__', args: machine_args) != '' + ) endif endif -- 2.43.0