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 4E12245A6C; Mon, 30 Sep 2024 19:50:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B96014060C; Mon, 30 Sep 2024 19:50:49 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id 7FFB64026C for ; Mon, 30 Sep 2024 19:50:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727718647; x=1759254647; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CmbYfpnnC81u81Hu59G5xajeLdfByXdUgWUzb0FaAfQ=; b=aqnqzTiQEwUk/klwyyhxpcmZbTffH6yvgkLZuoroj4f431U1ujh0LZu5 ssuMOkYFA3OxvBnI87ygpJLimRN1qMs0rU8RtIqhv/xSuvDqQ7YQtaSyt Fr+pDjX1WWoa4/z23WLrUE3hddrSqtRWjl70fwuP9lNu6QMRlviCc4LAY 7e8fBsSneQqTMJzHQvdONXYRg9zLL2r6qNV/PxjhpGiiuthfes7fvV+Bl /oICex65vlxAZaQ69+WjgbtVdlaWMzTITJic/3TSyOBzmuDG4VziKHifN twsev8BCUrcxayLizeW/odrvTe/52n/p52gn3BUPIJeNguLLfZvPPxeu1 w==; X-CSE-ConnectionGUID: R5PL3EvpS7e55D/xLFzTyg== X-CSE-MsgGUID: UhYzFDRbTv68OEL3dtFY/g== X-IronPort-AV: E=McAfee;i="6700,10204,11211"; a="30712523" X-IronPort-AV: E=Sophos;i="6.11,166,1725346800"; d="scan'208";a="30712523" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2024 10:50:46 -0700 X-CSE-ConnectionGUID: qb9J7sUrQZmduwB/vyHxUQ== X-CSE-MsgGUID: oDOmihQsTyuVm7h40abBog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,166,1725346800"; d="scan'208";a="77457740" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by fmviesa003.fm.intel.com with ESMTP; 30 Sep 2024 10:50:45 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Konstantin Ananyev Subject: [PATCH v1 1/8] config/x86: add global defines for checking AVX-512 Date: Mon, 30 Sep 2024 18:50:25 +0100 Message-ID: <20240930175033.2283861-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240930175033.2283861-1-bruce.richardson@intel.com> References: <20240930175033.2283861-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 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config/x86/meson.build b/config/x86/meson.build index 8087b9ae91..f973878371 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -16,7 +16,8 @@ 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_has_avx512 = false +if binutils_ok and cc.has_argument('-mavx512f') code = '''#include void test(__m512i zmm){ __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' @@ -24,6 +25,15 @@ if cc.has_argument('-mavx512f') if result == false machine_args += '-mno-avx512f' warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') + else + cc_avx512_flags = ['-mavx512f', '-mavx512vl', '-mavx512dq', '-mavx512bw'] + cc_has_avx512 = cc.has_multi_arguments(cc_avx512_flags) + 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