DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
To: Ruifeng Wang <Ruifeng.Wang@arm.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "nd@arm.com" <nd@arm.com>
Subject: RE: [EXT] Re: [PATCH 2/2] config/arm: add armv9-a march
Date: Sat, 20 Jan 2024 07:09:00 +0000	[thread overview]
Message-ID: <PH0PR18MB408622CE0D9D15C21472C747DE772@PH0PR18MB4086.namprd18.prod.outlook.com> (raw)
In-Reply-To: <a85cc799-d9b2-4473-87b6-7a46fe0f0920@arm.com>

> On 2024/1/4 5:18 PM, pbhagavatula@marvell.com wrote:
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > Now that major versions of GCC recognize armv9-a march option,
> > add it to the list of supported march.
> > Update neoverse-n2 part number to include march as armv9-a.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > ---
> >   config/arm/meson.build | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > index 36f21d2259..0804877b57 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -92,6 +92,7 @@ part_number_config_arm = {
> >           'march': 'armv8.4-a',
> >       },
> >       '0xd49': {
> > +        'march': 'armv9-a',
> >           'march_features': ['sve2'],
> >           'compiler_options': ['-mcpu=neoverse-n2'],
> >           'flags': [
> > @@ -701,7 +702,7 @@ if update_flags
> >           if part_number_config.get('force_march', false)
> >               candidate_march = part_number_config['march']
> >           else
> > -            supported_marchs = ['armv8.6-a', 'armv8.5-a', 'armv8.4-a', 'armv8.3-
> a',
> > +            supported_marchs = ['armv9-a', 'armv8.6-a', 'armv8.5-a', 'armv8.4-
> a', 'armv8.3-a',
> 
> armv9.x-a have some overlap with armv8.x-a.
> For armv9.0, the next candidate fallback should be armv8.4-a instead of
> armv8.6-a.
> armv9 should be treated differently for fallback support.


From [1] looks like base arch is v8.5a, also GCC(13) still complains incompatibility with neoverse-n2 [2]

I believe we have to express mcpu separately instead of having it in compiler flags and switch to fallback march only when 
mcpu is not supported. If mcpu is supported and march is not then we shouldn’t pick from supported_marchs.

Example:
march=armv9-a
mcpu= neoverse-n2
fallback_march=armv8.5-a

If compiler supports mcpu as neoverse-n2 and march as armv9-a
machine_args = ['-march=armv9-a', '-mcpu=neoverse-n2']

If compiler supports mcpu as neoverse-n2 and doesn’t support armv9-a
machine_args = ['-mcpu=neoverse-n2']

If compiler supports doesn’t support mcpu as neoverse-n2 and supports armv9-a
machine_args = ['-march=armv9-a']

If compiler supports doesn’t support mcpu as neoverse-n2 and doesn’t support armv9-a
machine_args = ['-march=armv8.5-a']

I will spin up a new patch with the above change.

Thanks,
Pavan. 

[1] https://github.com/gcc-mirror/gcc/blob/615e25c82de97acc17ab438f88d6788cf7ffe1d6/gcc/config/arm/arm-cpus.in#L306

[2]
#aarch64-linux-gnu-gcc --version                              
aarch64-linux-gnu-gcc (GCC) 13.2.0

#aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -march=armv8-a shrn.c 
cc1: warning: switch '-mcpu=neoverse-n2' conflicts with '-march=armv8-a' switch
#aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -march=armv8.1-a shrn.c
cc1: warning: switch '-mcpu=neoverse-n2' conflicts with '-march=armv8.1-a' switch
#aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -march=armv8.2-a shrn.c
cc1: warning: switch '-mcpu=neoverse-n2' conflicts with '-march=armv8.2-a' switch
#aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -march=armv8.3-a shrn.c
cc1: warning: switch '-mcpu=neoverse-n2' conflicts with '-march=armv8.3-a' switch
#aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -march=armv8.4-a shrn.c     
cc1: warning: switch '-mcpu=neoverse-n2' conflicts with '-march=armv8.4-a' switch
#aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -march=armv8.5-a shrn.c
cc1: warning: switch '-mcpu=neoverse-n2' conflicts with '-march=armv8.5-a' switch
#aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -march=armv8.6-a shrn.c
cc1: warning: switch '-mcpu=neoverse-n2' conflicts with '-march=armv8.6-a' switch
#aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -march=armv8.7-a shrn.c
cc1: warning: switch '-mcpu=neoverse-n2' conflicts with '-march=armv8.7-a' switch

> 
> >                                   'armv8.2-a', 'armv8.1-a', 'armv8-a']
> >               check_compiler_support = false
> >               foreach supported_march: supported_marchs

  reply	other threads:[~2024-01-20  7:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04  9:18 [PATCH 1/2] config/arm: fix CN10K minimum march requirement pbhagavatula
2024-01-04  9:18 ` [PATCH 2/2] config/arm: add armv9-a march pbhagavatula
2024-01-18  2:19   ` Ruifeng Wang
2024-01-20  7:09     ` Pavan Nikhilesh Bhagavatula [this message]
2024-01-18  2:02 ` [PATCH 1/2] config/arm: fix CN10K minimum march requirement Ruifeng Wang
2024-01-19 19:42   ` [EXT] " Pavan Nikhilesh Bhagavatula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH0PR18MB408622CE0D9D15C21472C747DE772@PH0PR18MB4086.namprd18.prod.outlook.com \
    --to=pbhagavatula@marvell.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).