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 79EA845A7B; Tue, 1 Oct 2024 13:18:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2234840611; Tue, 1 Oct 2024 13:18:13 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mails.dpdk.org (Postfix) with ESMTP id F16B44027E for ; Tue, 1 Oct 2024 13:18:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727781491; x=1759317491; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X1O2Bv6YmvFR10aY3fP27Qrz81ZuRRTkHkAsQyPy5KY=; b=Vj5VN0P1DDGHyynkD5pnfCQGIazQBAFu6xUlXaIn0S7Tp6nV2LXV5pfw HvUNsZefPYJsmjbR4Ohv5xzMQaD3wVDevL9x0bAr9WJud3MuH+OxjDpy6 DgPSFb+rAha5lsn9w6sYC8cR+KIxvHSKl78PuZnVKQi3VyjVM0BwPRL25 q93QLcTaXkA1LlnohD5JNdAEoxnNkMloWh/xty44CCXr78mFLOCQXo3pA a3FI25EZ0KnrvKn2XcT0b2ifzWbP5WG7dzR7P48HecHraoGn6gp+NqjaJ 0iufpSBHYSyMgw+Rgj7HPuTDDvNoLP9M6Bu/ulVgefuXh0/+nsVST22v/ A==; X-CSE-ConnectionGUID: 9C7qKSHPSWipVUimkFEsvA== X-CSE-MsgGUID: cQMVI5epSsqLQgt3dm3H9Q== X-IronPort-AV: E=McAfee;i="6700,10204,11211"; a="27084532" X-IronPort-AV: E=Sophos;i="6.11,167,1725346800"; d="scan'208";a="27084532" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2024 04:18:10 -0700 X-CSE-ConnectionGUID: XcmrfBzhTMSIF3p3nMNPlA== X-CSE-MsgGUID: JkMS75M5RVyg6DgiZ5Zc0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,167,1725346800"; d="scan'208";a="74047077" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by orviesa007.jf.intel.com with ESMTP; 01 Oct 2024 04:18:10 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Konstantin Ananyev Subject: [PATCH v2 1/8] config/x86: add global defines for checking AVX-512 Date: Tue, 1 Oct 2024 12:17:54 +0100 Message-ID: <20241001111802.2728765-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001111802.2728765-1-bruce.richardson@intel.com> References: <20240930175033.2283861-1-bruce.richardson@intel.com> <20241001111802.2728765-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