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 7A6D543BA4; Fri, 23 Feb 2024 12:49:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F11B8402E3; Fri, 23 Feb 2024 12:49:36 +0100 (CET) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mails.dpdk.org (Postfix) with ESMTP id DBD614021E for ; Fri, 23 Feb 2024 12:49:35 +0100 (CET) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a3eafbcb1c5so94526166b.0 for ; Fri, 23 Feb 2024 03:49:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1708688975; x=1709293775; 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=bVCkQ5CBZLdZGHjOC1eQukiy6tp3EEt/WOwgLcuaUvQ=; b=GIzPZgbTgWYw1UlzaCADvD6D94/u91yhC1nDlwn+uDdeGsmSU8RQcJ3YSD9pD9ylaX lBIEb/kID+3Ows0fEZMYqbbrsxUQJJw/HCh0mdgldHxtUsiAX8Tl7fWLO8ikgu4uSWMt HnI8K/2yeJ7okZYEib/dKwpHz9IugSlzC2ZFSXO9n4C6ZwHdZRLODD74PusdRmexIFpd slqj2yhyK9OmX0H6vUvQM49HIjK+9UHxHMrA0GduMnNgYqdQAw5g+hnc2wJpkKcwxRAH m5z2+lduHk4R24y/ZHlfjolnv74cWCbESnPHyEmojVoeLnJcG5wGAIF5ZJHvIBD5Wle6 UnjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708688975; x=1709293775; 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=bVCkQ5CBZLdZGHjOC1eQukiy6tp3EEt/WOwgLcuaUvQ=; b=JZptzJLqJLYzngQUV9HVLA8yk7n7ypn/KjCNOVnSR+98v9PA/xTjMMxtQgsxqG4ky3 mA03ku291lDkFUzOE/ce8A6OBZvddo/0s7ls+pdkvmIBti5h10VZLml7yW4Sxt0EhSEH ICNO2sMEuMbzi+dCWVmVMfgG2L3mmS4XJdjFBPqSfPXgUFzu5eDhKWajx2DZ9+SaQJEF ILepwX3B2qpcQJ/RuPbL+b5jvKDBCtdMQAjjxoS4uZql/+ih5pHFXY1v3m/XJ0vThHsh k8trrn6GawwZekf7GIrFpWpS0SQESXcBCuKhvzpRYX1lsAURlKC5kzTMR4SrMhfYFODW xKqQ== X-Forwarded-Encrypted: i=1; AJvYcCVKnvZ2NK0kNShOK39U8vxerifQmpCjd2giHjtmrnWkxU0HLPhpj/t3AtQnHOXbfUDtKraNOMhyVak/85g= X-Gm-Message-State: AOJu0YyVA2BFm3/YIk8YKK83rkB+ePBJ+UwPRRMjHkwJm2b762adj5ew oaPbv6zBYgZwHCSMZ1cOAccN05Es5sFHFEu5dg++/SsLehJChsg3Cxa0x9zFvZObLdw8EhQWYkV s5Gd0XJQVt10GvqxN2/VUmmtiYXzbnJegVEQODg== X-Google-Smtp-Source: AGHT+IHtTlgrWNqaj5/ROyotSUjpwQj5/PNiPLa92WZdAt3qJAvsbg2OroHEfSkswNM7oPS8ae4MHUFGl6HaQKbSxhk= X-Received: by 2002:a17:906:6b8c:b0:a3e:eb81:ab62 with SMTP id l12-20020a1709066b8c00b00a3eeb81ab62mr1304302ejr.7.1708688975513; Fri, 23 Feb 2024 03:49:35 -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: <20240222124503.17043-2-pbhagavatula@marvell.com> From: =?UTF-8?Q?Juraj_Linke=C5=A1?= Date: Fri, 23 Feb 2024 12:49:24 +0100 Message-ID: Subject: Re: [PATCH v5 2/3] config/arm: add support for fallback march To: pbhagavatula@marvell.com Cc: jerinj@marvell.com, 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 On Thu, Feb 22, 2024 at 1:45=E2=80=AFPM wrote: > > 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'] > > 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') and > + supported_march =3D=3D part_number_config['fallback_= 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. 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. > 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 supported.' > .format(part_number_config['march'])) > if candidate_march !=3D '' > -- > 2.25.1 >