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 9F5054399B; Mon, 22 Jan 2024 17:29:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 167F640A89; Mon, 22 Jan 2024 17:29:26 +0100 (CET) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mails.dpdk.org (Postfix) with ESMTP id D1785402DA for ; Mon, 22 Jan 2024 17:29:24 +0100 (CET) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-50e6ee8e911so4434305e87.1 for ; Mon, 22 Jan 2024 08:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1705940964; x=1706545764; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vTKkbIKVSUjcQqWX6SO8yYtVtk+QPvurvyfnRMQipbM=; b=Ku9A0nbCtgGpXyzF7f/O8P0l5rgXQpRfXTTPvlsV4wiNkog3xv9yhWo8bAkOYdlPA4 4eJMeCEadt4EYyJg2zP67hLrDeHMp1J6TEWxdOecrJELoOxGkPjFy9qE06TM8o5MmLla yZG0zUCJHztFPl8r6q8jFdHttyMQcaleH81tK1hRPbRKdMAZ3r1DU3bPb+CeZXs1DJr0 4v7AaspxQeBJz8NjXW0m6AwBlR9MS/wtrRAIEAr/kL6pMPd2a+SbIEwjEtzgo24mh2oa opoMuRui4IylXbMmvTeLoYUPyndyuy8WjX6Mdi939thWMrkMm9VgyCPcGvg4lVWd8QFH y//Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705940964; x=1706545764; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vTKkbIKVSUjcQqWX6SO8yYtVtk+QPvurvyfnRMQipbM=; b=L8jB96wzYcQlr0gqeoNLhDiJCQMZ5wWxhAJeg2YrFviVcj5ryo3ca5N9kcc1te8vg2 rMoUiM08YHEzGz6e2KB9K74S36uOb9lIRTLNwJzZ0khW/xHIsmO7DYvJRdga6gzWkfSj Oyz1sQdUJqs/G4QYSlLN3oMx+DfC17PyrEz9rxElymo4zA6/e6RQoeEcZ7N9cobXw2nE x9Hik1k+dNp5ik4BT/27prSnHQEt7rBPToVb2UhAjrV/ucBE5Im4gXP+9hBs5Im04k2F 64s0B5e0g1E0fQzYcuwUfW7Flk6RuskW7dNosZCGh38ZOZM3T5J0GpXxipzaek67QYur yeeA== X-Gm-Message-State: AOJu0Yx2SadQvUn4WPMmGxcDdT3gvvWI5za8j7UkazZePt9rQpVYX3vs lZrpe7Bbq7gWxV9hn9Zt7QPfP6GVhfZPDugxNdmcNwsJYzT85RricEX5b7I7Ye/R5TFLNNrHkby Z4V7hLpgdCXaLnIMbeaSXhwl60DXlNcEzsX9RXQ== X-Google-Smtp-Source: AGHT+IF2f9WC6am6Ub7+Bt0wOYlCGtRI3V/YdCM6jdraiRLZWqpRDJ5JQK2w5O0+P4+ZGIdQxa93wajezctUDV7fNUU= X-Received: by 2002:a05:6512:6c5:b0:50e:778b:8b36 with SMTP id u5-20020a05651206c500b0050e778b8b36mr2083711lff.120.1705940964191; Mon, 22 Jan 2024 08:29:24 -0800 (PST) MIME-Version: 1.0 References: <20240121093653.2890-1-pbhagavatula@marvell.com> <20240121093653.2890-2-pbhagavatula@marvell.com> In-Reply-To: From: =?UTF-8?Q?Juraj_Linke=C5=A1?= Date: Mon, 22 Jan 2024 17:29:13 +0100 Message-ID: Subject: Re: [EXT] Re: [PATCH 2/2] config/arm: add support for fallback march To: Pavan Nikhilesh Bhagavatula Cc: Jerin Jacob , "Ruifeng.Wang@arm.com" , "nd@arm.com" , Bruce Richardson , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Mon, Jan 22, 2024 at 1:16=E2=80=AFPM Pavan Nikhilesh Bhagavatula wrote: > > > On Sun, Jan 21, 2024 at 10:37=E2=80=AFAM wro= te: > > > > > > From: Pavan Nikhilesh > > > > > > Some ARM CPUs have specific march requirements and > > > are not compatible with the supported march list. > > > Add fallback march in case the mcpu and the march > > > advertised in the part_number_config are not supported > > > by the compiler. > > > > > > > It's not clear to me what this patch adds. We already have a fallback > > mechanism and this basically does the same thing, but there's some > > extra logic that's not clear to me. Looks like there are some extra > > conditions around mcpu. In that case, all of the mcpu/march processing > > should be done first and then we should do a common fallback. > > > > The current fallback does a simple reverse compatibility check with the c= ompiler > when force march is not enabled. > But this is not true for neoverse-n2 case, as it is based on armv9-a whic= h is a super set of > armv8.5-a and other features[1] > In the current fallback path if both march neoverse-n2 and mcpu armv9-a a= re not supported > then it would fallback to armv8.6-a but this not correct as neoverse-n2 i= s not based on armv8.5-a > > The fallback march armv8.5-a kicks in (if supported) when neoverse-n2 and= armv9-a are not supported. > Can the two fallback mechanisms be combined? They seem very similar. > > [1] https://github.com/gcc-mirror/gcc/blob/615e25c82de97acc17ab438f88d678= 8cf7ffe1d6/gcc/config/arm/arm-cpus.in#L306 > > > > > Example > > > mcpu =3D neoverse-n2 > > > march =3D armv9-a > > > fallback_march =3D armv8.5-a > > > > > > mcpu, march not supported > > > machine_args =3D ['-march=3Darmv8.5-a'] > > > > > > mcpu, march, fallback_march not supported > > > least march supported =3D armv8-a > > > > > > machine_args =3D ['-march=3Darmv8-a'] > > > > > > Signed-off-by: Pavan Nikhilesh > > > --- > > > config/arm/meson.build | 15 +++++++++++++-- > > > 1 file changed, 13 insertions(+), 2 deletions(-) > > > > > > diff --git a/config/arm/meson.build b/config/arm/meson.build > > > index 8c8cfccca0..2aaf78a81a 100644 > > > --- a/config/arm/meson.build > > > +++ b/config/arm/meson.build > > > @@ -94,6 +94,7 @@ part_number_config_arm =3D { > > > '0xd49': { > > > 'march': 'armv9-a', > > > 'march_features': ['sve2'], > > > + 'fallback_march': 'armv8.5-a', > > > 'mcpu': 'neoverse-n2', > > > 'flags': [ > > > ['RTE_MACHINE', '"neoverse-n2"'], > > > @@ -709,14 +710,14 @@ if update_flags > > > > > > # probe supported archs and their features > > > candidate_march =3D '' > > > + supported_marchs =3D ['armv9-a', 'armv8.6-a', 'armv8.5-a', 'armv= 8.4-a', > > > + 'armv8.3-a', 'armv8.2-a', 'armv8.1-a', 'armv= 8-a'] > > > if part_number_config.has_key('march') > > > if part_number_config.get('force_march', false) or support_m= cpu > > > if cc.has_argument('-march=3D' + part_number_config['ma= rch']) > > > candidate_march =3D part_number_config['march'] > > > endif > > > else > > > - supported_marchs =3D ['armv8.6-a', 'armv8.5-a', 'armv8.4= -a', 'armv8.3- > > a', > > > - 'armv8.2-a', 'armv8.1-a', 'armv8-a'] > > > check_compiler_support =3D false > > > foreach supported_march: supported_marchs > > > if supported_march =3D=3D part_number_config['march'= ] > > > @@ -733,6 +734,16 @@ if update_flags > > > endif > > > > > > if candidate_march !=3D part_number_config['march'] > > > + if part_number_config.has_key('fallback_march') and not > > support_mcpu > > > + fallback_march =3D part_number_config['fallback_marc= h'] > > > + foreach supported_march: supported_marchs > > > + if (supported_march =3D=3D fallback_march > > > + and cc.has_argument('-march=3D' + supported_= march)) > > > + candidate_march =3D supported_march > > > + break > > > + endif > > > + endforeach > > > + endif > > > warning('Configuration march version is @0@, not support= ed.' > > > .format(part_number_config['march'])) > > > if candidate_march !=3D '' > > > -- > > > 2.25.1 > > >