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 F417243BE5; Mon, 26 Feb 2024 08:35:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 928C5402C8; Mon, 26 Feb 2024 08:35:03 +0100 (CET) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mails.dpdk.org (Postfix) with ESMTP id 4B464402BA for ; Mon, 26 Feb 2024 08:35:01 +0100 (CET) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a3d01a9a9a2so284871666b.1 for ; Sun, 25 Feb 2024 23:35:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1708932901; x=1709537701; 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=DuM53z8k9QyEHq+dG412mqgZl5LPMQFJfCvJgHpfSJg=; b=LtACg8Zaa58jCJO04exj0G1SR5sye0I+Ga/R6bSTvq2aEJXPwizDMGQ+MGSoWUk7mM C09G/Av89jfwuIpwcWN+Mu1xQwgcMeMCI3LmVW6KO8a0WC4h4ToMA3bWq4nouNa7U5Xw uhOa8iCzawFwttG+2jQRBznDLPuKm6wRxyLeg/kD3HcW+6iwar8OJRWvdVL1GvPo/7mC hLIAiYVLfBHvJQF3Wb+MvYuq6JhwQdUibBPKf0y3OLKRu2fL2OSL55FdkvTHfiNhwRa9 3pIcA6tDdoiNfb709booV/5mQq7DPmbpzb6slPSeFije3KK5JnBRq31sKWAmXW9K9DjN TYjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708932901; x=1709537701; 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=DuM53z8k9QyEHq+dG412mqgZl5LPMQFJfCvJgHpfSJg=; b=v0GrwoWFvfBZQLDvvf4VwWSSvk6rYJTaxmxxLOOv5+bSmo6bWMTYJQQh+Ua/5XcDHv DiXja37Q5AzqIHy2/4vOHzpqF0nZNE+ep3/B+/veZ+pochc9AriSkcSbnTNYhi7cUz7q brqEXezhwsuaAOvA0+ow5WxD000URMvjYLZYFL04UMAHFt/HZ3RNnwTaqUNqyyQwAAUo PwPzc+/hbhEtF1+6GSjfriPApuZQSRNuLQ0NXa4RaLk0ZW20XdgJuIwQFALc4/V7ThTe PFZooc5iFkV6IAYdQGsHxanyI0ejaPYNdLFBPxEm21oM9r7uHhbG+BwgWzVAwrcjGigH dUZQ== X-Forwarded-Encrypted: i=1; AJvYcCUId+xRTZGs5fGgtNnK022XpOzMRUzto3qEDgdg35Ah/ixaticwCpBqhww2daw8OejDC0ZMVAP6GMBrICM= X-Gm-Message-State: AOJu0YybiFgdtRGsOzqRKfywhpBhON/I+Gcn05PfDX3i7VvVWEW4tGsc +05lHmR6jK5MxcIUwH+dGUwwHyDyXaX6HnmxLTlnBG3AJhIF4JWR/lRpWAbx3Jsb6SCYnL0zvi/ OQlKkVtpfczquYeesQdwDbOgiP5nzdUMHj1ds8g== X-Google-Smtp-Source: AGHT+IHq7U0qM6COHfnq8VajBs9fb9v1zefGBJ18SyMkdNuw16NKj0c1HYraYzIi+kNy3oHoqf+KjbA6FIuXo2m0tXw= X-Received: by 2002:a17:906:d04c:b0:a3f:adcf:7f58 with SMTP id bo12-20020a170906d04c00b00a3fadcf7f58mr3783891ejb.21.1708932900938; Sun, 25 Feb 2024 23:35:00 -0800 (PST) MIME-Version: 1.0 References: <20240221202018.14179-1-pbhagavatula@marvell.com> <20240222124503.17043-1-pbhagavatula@marvell.com> <20240222124503.17043-2-pbhagavatula@marvell.com> In-Reply-To: From: =?UTF-8?Q?Juraj_Linke=C5=A1?= Date: Mon, 26 Feb 2024 08:34:49 +0100 Message-ID: Subject: Re: [EXT] Re: [PATCH v5 2/3] config/arm: add support for fallback march To: Pavan Nikhilesh Bhagavatula Cc: Jerin Jacob , "nd@arm.com" , "wathsala.vithanage@arm.com" , Ruifeng Wang , 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 I Forgot to add my tag: Reviewed-by: Juraj Linke=C5=A1 On Mon, Feb 26, 2024 at 8:31=E2=80=AFAM Juraj Linke=C5=A1 wrote: > > On Mon, Feb 26, 2024 at 8:11=E2=80=AFAM Pavan Nikhilesh Bhagavatula > wrote: > > > > > On Thu, Feb 22, 2024 at 1:45=E2=80=AFPM wr= ote: > > > > > > > > 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. > > > > > > > > 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'] > > > > > > Ah, of course, fallback march is only applied if when candidate_march > !=3D part_number_config['march']. Thanks. > > > > > Signed-off-by: Pavan Nikhilesh > > > > --- > > > > config/arm/meson.build | 14 +++++++++++--- > > > > 1 file changed, 11 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/config/arm/meson.build b/config/arm/meson.build > > > > index d05d54b564..87ff5039f6 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"'], > > > > @@ -708,6 +709,7 @@ if update_flags > > > > > > > > candidate_mcpu =3D '' > > > > candidate_march =3D '' > > > > + fallback_march =3D '' > > > > > > > > if part_number_config.has_key('mcpu') and > > > > cc.has_argument('-mcpu=3D' + part_number_config['mcpu']) > > > > @@ -736,16 +738,22 @@ if update_flags > > > > # start checking from this version downwards > > > > check_compiler_support =3D true > > > > endif > > > > - if (check_compiler_support and > > > > + if (check_compiler_support and candidate_march =3D= =3D '' and > > > > cc.has_argument('-march=3D' + supported_march)= ) > > > > candidate_march =3D supported_march > > > > - # highest supported march version found > > > > - break > > > > + endif > > > > + if (part_number_config.has_key('fallback_march') a= nd > > > > + supported_march =3D=3D part_number_config['fal= lback_march'] and > > > > + cc.has_argument('-march=3D' + supported_march)= ) > > > > + fallback_march =3D supported_march > > > > > > If both fallback_march and march are supported, fallback_march is > > > going to be chosen over march. > > > > The current flow still chooses the march > > > > Message: Arm implementer: Arm > > Message: Arm part number: 0xd49 > > Compiler for C supports arguments -march=3Darmv9-a: YES > > Compiler for C supports arguments -march=3Darmv8.5-a: YES > > Compiler for C supports arguments -march=3Darmv9-a+sve2: YES > > Compiler for C supports arguments -march=3Darmv9-a+sve2+crypto: YES > > Message: Using machine args: ['-march=3Darmv9-a+sve2+crypto'] > > > > > > > I think this is what we want instead: > > > Use march if supported, > > > then use fallback_march if supported, > > > then use the other fallback marchs. > > > > > > If the above is indeed what we want, we could just put this after > > > endforeach (in the original version): > > > > > > # at this point, candidate march is either > > > part_number_config['fallback_march'] or some other lower version > > > if (part_number_config.has_key('fallback_march') and > > > candidate_march !=3D part_number_config['march'] and > > > cc.has_argument('-march=3D' + part_number_config['fallback_march'= ])) > > > # this overwrites only the lower version with preferred > > > fallback_march, if supported > > > candidate_march =3D part_number_config['fallback_march'] > > > endif > > > > > > This way we won't even need the fallback_march variable. > > > > Sure, I will change remove fallback_march variable, Thanks. > > > > > > > > > endif > > > > endforeach > > > > endif > > > > > > > > if candidate_march !=3D part_number_config['march'] > > > > + if fallback_march !=3D '' > > > > + candidate_march =3D fallback_march > > > > + endif > > > > warning('Configuration march version is @0@, not suppo= rted.' > > > > .format(part_number_config['march'])) > > > > if candidate_march !=3D '' > > > > -- > > > > 2.25.1 > > > >