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 2DD4243BE5; Mon, 26 Feb 2024 08:31:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF626402BA; Mon, 26 Feb 2024 08:31:22 +0100 (CET) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by mails.dpdk.org (Postfix) with ESMTP id 316FA40144 for ; Mon, 26 Feb 2024 08:31:21 +0100 (CET) Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-55a5e7fa471so3604779a12.1 for ; Sun, 25 Feb 2024 23:31:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1708932681; x=1709537481; 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=OGgCnJHPg0y4YrA3fvzSENbKfjJUPlX2CSbvyvhWGPo=; b=KHBgFXaiNu11gUcI72dCYHP5GVKRcCTBfaiVEFgRbbCvTW0aOO8MX8ydySq5DHbIsx kgsYbVIe8uDuhJM527kA9+NuSIUFYiJDdl8KQ0LNm5v/H8H2kxrfSG6uZxiH90sugiFm PrYZn9ZAXsE+s284B3Bg3DhKre+NuY3EBvVx9qAY+PI6quDl0bTWHyGBg0Yl5hIpqdei 79afYNgMVj2gty0NVWHaPlg7KdORXxEVp3QHUlVu0dlT7PYFx7YfwUwRTRrDgUEBbBQR f7oC4ul4OtpENnUCI0IKukNjJkUUQcfMaNS6b6qYc996uyv1g+hKXgKcfEmqsVP9TS0i Xfzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708932681; x=1709537481; 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=OGgCnJHPg0y4YrA3fvzSENbKfjJUPlX2CSbvyvhWGPo=; b=inGNfbqB1yE+1aCODrb2zLwNidGbPBPxlwQeR/QA05O1mLymacebP399A783074Ia5 hORHWaHpMBDmModbc0qxi+PCZzubt39hCJOYjDzEVSJuTo8jnuHBL7pea7bXLyjrQ0zr bcKYdxS4OOd54sg95Hn3U9K6WKaJqfGQelkNYZJsyyAWOrweYkA36rmNcVObAcH440aG bA+EYE5FD/ID29Ct6BszwRcycTNXY6ViJKfoMYIzDas+mtX4sSujZwL4LWGBMjNGAUT/ CcvY/zqfjOF2i17q/+UZqdh04+RWuZSKpBefyK4OKGZ8wK/2aFs3cpAf6KCW9X57y0ef H8AQ== X-Forwarded-Encrypted: i=1; AJvYcCXOCXJSwZ+H9fS7PK5cthGs506CHQQKh86sSlcjnQsdCa8fljavzj0uAK4lJIPfYsNZ/AzyCtVc6sxQChI= X-Gm-Message-State: AOJu0YwPIVwvvd+O5QX43bs06UqYKkWbzU0/WenhNOvoODc8b7d2mm5n 8h7weC9gfI1HesusOc393ss5qI6FUUjM5sMY1YB1LqhRTDznxebo18hH0WqCEmrfTUEzod9TupY mFB3MQHjlgnUHexs2Xk3CaZnY3dlPBSUZSmsdyQ== X-Google-Smtp-Source: AGHT+IEn6sQJaMnvVaE3p02Gz5T3OK6Og0rwFbozV41f7sVVo+wPCNboFgWlYxPh54QriJINWmtMElLtiBYHMNOE1B4= X-Received: by 2002:a05:6402:5201:b0:565:a5e1:3a12 with SMTP id s1-20020a056402520100b00565a5e13a12mr3925832edd.3.1708932680848; Sun, 25 Feb 2024 23:31:20 -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:31:09 +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 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 wrot= e: > > > > > > 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') and > > > + supported_march =3D=3D part_number_config['fallb= ack_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 support= ed.' > > > .format(part_number_config['march'])) > > > if candidate_march !=3D '' > > > -- > > > 2.25.1 > > >