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 04F7F468C9; Tue, 10 Jun 2025 17:07:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE98442EAD; Tue, 10 Jun 2025 17:07:09 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id D0FDD40672 for ; Tue, 10 Jun 2025 17:07:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1749568028; x=1781104028; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=9rEI6BCNefSb5A+AtPh6PjdkwDaTI2wu2NCxoohZIyg=; b=UC9nk/ZKbdIM+QarwrUcgLOwluu2dDARpJyKUSG5yOr14WlnJq/xhe37 l4kMxtD0zEBbJmLx+C3OQOun+i+/aleCKpX9wLwcPynwXlb8pvZdLvxfO H0GJwLvPEQOWD4T/3fOgGTq6c+CmzPLl1m2OMexJmxwcZ8eyaFjo/UsY/ k6R142vvFQF9LWymOptPxMludsqmePMgovccXNYqEbhYKAkrULJv1bS2u moWHdiWAQnP4dQtHHsigX8NK3wQKXfoVuPlFr2swVLdsroeqU6TCbsyIo Alpa3ncpKqB3hmNKT5DmwQpzYFjyOibZNTWU8EkerzeeOpVsxDbq0CJ7X w==; X-CSE-ConnectionGUID: O78DlYk+QDGx0qJ7NbryHA== X-CSE-MsgGUID: 6Oc44ijiSvSZYfbC1u0aQg== X-IronPort-AV: E=McAfee;i="6800,10657,11460"; a="55476543" X-IronPort-AV: E=Sophos;i="6.16,225,1744095600"; d="scan'208";a="55476543" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2025 08:06:57 -0700 X-CSE-ConnectionGUID: ykbCU81LRliWxQkWcrWBaQ== X-CSE-MsgGUID: EhDAr194RsSeyBZY1/kabw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,225,1744095600"; d="scan'208";a="177808857" Received: from orsmsx903.amr.corp.intel.com ([10.22.229.25]) by orviesa002.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2025 08:06:55 -0700 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.25; Tue, 10 Jun 2025 08:06:54 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.25 via Frontend Transport; Tue, 10 Jun 2025 08:06:54 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (40.107.96.56) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.55; Tue, 10 Jun 2025 08:06:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TJUtcnvr1Yntm+JDdRo46m0vYz8nO45tXHXHKICtwlrsFoMmXEEEz8gy21ANi1ecy7JjxEYbtCdh7MJGxuo6k+5abGkPOui3C5iNp4GXuSUq591Ujb9j98sN6Nz/Ow6BQ4SIFGVTp0VeTxEXnxSnIwLoI+31AE9iRdVplT1aDWa9PjsbmQM+BuKeOWZz24zncofCRjEHCw1dFm4shopMd1W1Ms5KWN6aHGVdncujeIakQLIRt9mMHrFPv0J0SQfIuiASD5Kl3vJYup1c/dX4XnY+lJjPK2Mla8sTVASWl93b1h+Sc+MgysPWwglZvqgu3BCPWefBhgIFBI5f6HehDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HilBeAn7OIpNqWYbIkn0qqlIySTDAWTnRJzW55iMZAg=; b=fJz33y4L6blX+zyIFyReWw5iOlL5NLs85EGsDa8aus3o5SX0b65nPRbs7tC7hevJylSBtpHFYMopMOz8lHiTk+Q+psd0ju8CTpeqi6/mm1U3F8hHZQcHl0Wp4++pacPNu2MLvMw3tpV2DrxGvKJjFZjIP3UPiwUCfvdZ/0rfn24Gy9C+GPhmgh6n5GNFDOrxONW7CA3ZrQ/UCrsgrUUnSIBqOngshPDL6UmTmcuyTt2Vn3ew+KhFTXwcQzQvCMYbHlyxBTtnfCObP67ERHpFea7nzbxxomEDzcH02PViYyKxq7cu5lGsw4mWBJxfKqf9gaZT39yGKX3wXKLHr8swnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by MN2PR11MB4727.namprd11.prod.outlook.com (2603:10b6:208:26f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.18; Tue, 10 Jun 2025 15:06:44 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%5]) with mapi id 15.20.8813.021; Tue, 10 Jun 2025 15:06:44 +0000 Date: Tue, 10 Jun 2025 16:06:39 +0100 From: Bruce Richardson To: "Varghese, Vipin" CC: "dev@dpdk.org" , "Song, Keesang" Subject: Re: [PATCH v4] build: reduce use of AVX compiler flags Message-ID: References: <20250325172215.3360590-1-bruce.richardson@intel.com> <20250529154249.1310449-1-bruce.richardson@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DUZPR01CA0033.eurprd01.prod.exchangelabs.com (2603:10a6:10:468::8) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|MN2PR11MB4727:EE_ X-MS-Office365-Filtering-Correlation-Id: 159736e8-52d7-4a7a-5649-08dda83069a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?pVrWGE/kGY1B0YDVkaoibg24cQVbRxvC8uRdLfHAfMcF1OpKTJM2XAppEt8f?= =?us-ascii?Q?9odcZjnSQV4nhlr9IIgPN8+ONo6B+GOXFd+CBHsMmWtao0M1VCclG00PM77d?= =?us-ascii?Q?Tv5P2pxh2fhIGMZC7spfuHZrUbIg8i0PZUN9+dxDH6S2DPiNXxVDrynhkUV5?= =?us-ascii?Q?kfzcFHaLTBR/97XS6j1NVNf+P224ZWewPktm8DQb8POZPufc8YdGHGAXv8vy?= =?us-ascii?Q?q+aDWux/A3gwPqUfx8tOlCEkn6YFMAKJKV/SkMl1BKLSuSJPuM8cbD8xnpON?= =?us-ascii?Q?RI2UuaYVfw0ha8dGkdC1wT9bdn5pXsoGBq8YK/kfvxB225X2ig2VGFoezR89?= =?us-ascii?Q?QVuibvZwkB5TElXbljxk7ASv1lC8PWcQCnjq+1w6Lks0vruGzVYPF0GaObSX?= =?us-asc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Xj3eocz1DmfNM0Q4L0CYY4M?= =?us-ascii?Q?fCpCaNLglAi11T0r9xoNhW1AmFq0Z9X3GlxEBxlNd2u/hvXO/OQZQM030UNM?= =?us-ascii?Q?IENjTmbKk4LAqaf4KVYn2Ci/L70TSveJATLMIgVhanb3aW9XpqI8KnPl9LCA?= =?us-ascii?Q?i8dmzfsFjkQ=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?EFjudKjzDXBetFHmvHqZY3QcyyJ8Gct188VpWcrSJsUANsbwfLdONF+xY7cb?= =?us-ascii?Q?tDk1IEqIWwDsciuJqX2xdGMwYflqR2gcmvaR5wybLpog8j052H8K6zV+w3rj?= =?us-ascii?Q?Jzac/NyLAv7KPVMEExMZkej0YPXAvig71WCqyLhLXZMYdKLBoutw3ZQOP5FZ?= =?us-ascii?Q?whHQXZ+qC7jxpCWOyzO9RJvKoV7wQbpzfmOzTASOHZ2589McCrnNDzwv3uHS?= =?us-ascii?Q?+yU+t9/MJCCtQXl7FtgTRzKrJVE9QO8d5GzsGhbQTbFm4uuemAZiKWD24+v3?= =?us-ascii?Q?WG4euryY8ZdqM3AuEZpNxinC9crPv657fguEgQeNOymasLNirT5udi81EFAQ?= =?us-ascii?Q?r4QZw1NKLaKEEas59iFmkO3sUVAZ4iJoQcblaX6v2iND+8GKZTActq18lBoy?= =?us-ascii?Q?eOmqrxOWFPcnHUHBP/ipolUTChuACaWU0UfqHmf5UxFm2j4m8yIG7qjoALBx?= =?us-ascii?Q?t86ooTL+Un9qDdSL4Yjxtbp1tbqBe+OZ49S55pNeuWPhdIstTTefgUWSGG/a?= =?us-ascii?Q?rV8q4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IRcIhMnnMhqE7?= =?us-ascii?Q?daJsuHdJ5n4bgy1nm5OwSN8M3l36zAfP2xRpkVQrEByxQ5fOdJdgAU+Jyoza?= =?us-ascii?Q?pirjyk7cIelu0y3quh/tsigneZ1EBdSpb2bMq22uALtiKartdN5Vbkp9vMzJ?= =?us-ascii?Q?NeVbXkRsILF/OS6YIiXtn7YvSUvVH+fU9St0hoL79PN0PPvv8JEKgn+7QxAy?= =?us-ascii?Q?Bw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 159736e8-52d7-4a7a-5649-08dda83069a9 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2025 15:06:44.3764 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Lk/X+VONG0clq2T4x6NHMs6VuNVpNnq82CFR6ahBhndJCdUlYw6P00z8MBoYF7pn7ds4fMKRfz6Fxo5mJ28i9+CSh8b7saqrq8YGvx/AYeE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4727 X-OriginatorOrg: intel.com 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 On Tue, Jun 10, 2025 at 02:52:24PM +0000, Varghese, Vipin wrote: > [Public] > > Snipped > > > > > > > In above log I get `2 instances of march`; logs `-march=native -mrtm > > > -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format- > > truncation -Wno-address-of-packed-member - > > DRTE_LOG_DEFAULT_LOGTYPE=pmd.net.i40e -DCC_AVX512_SUPPORT - > > march=skylake-avx512`. > > > > > > Question-1: I think this is not expected right? The `-march=native` is populated > > from `cflags` and `-march= skylake-avx512` is populated from ` cc_avx512_flags`. > > > > The above command is correct. So long as the compiler supports AVX-512 we will > > always compile the AVX-512 code paths for runtime selection. In practice, all > > supported compilers have AVX-512 support, so in reality we have the two scenarios > > you tested: > > > > * The target architecture e.g. znver3 in your case, doesn't support avx512, > > so the meson.build file adds on the necessary flags to add this support, > > i.e. that file is compiled with -march=skylake=avx512, which is the > > minimum ISA that gives you the necessary support. > > * The target architecture, e.g. znver4, does support AVX-512, then no > > additional flags are added and the files are compiled "as normal" > > > > In both these cases, whether the target architecture is specified as "native" or > > explicitly makes no difference. > > So, for files which needs avx512 support like acl_avx512, fib_tire_avx512 and others, we then only pass `cc_avx512_flags`. > All other cases this is ignored. Thank you that makes sense. > > > > > > Question-2: if the target is meet minimal ISA why not we use `-march=x86-64- > > v4`? > > > > > > > Good point, that would indeed be better. I'm just not sure whether it is supported > > widely enough on our compilers. Do you know what gcc and clang versions support > > that target? > > As I recollect we have been using `x86-64-v4` this from gcc 12.3 and clang-14. > I am not sure if the older versions supports `avx512 that is x86-64-v4` > Checking with godbolt.org, to see what versions give errors or not. * Clang accepts the argument from v12 onwards * GCC accepts the argument from v11 onwards. Unfortunately, that means that we need to at least keep some form of backward compatibility for older compilers until such time as we have those versions as minimum. If you are ok with the patch in general, I'll see if I can respin a version where we check for support for -march=x86-64-v4 and use that when we can, otherwise falling back to skylake-avx512 as here. Does that seem a reasonable approach? /Bruce