[2/2] config/arm: add armv9-a march

Message ID 20240104091830.3245-2-pbhagavatula@marvell.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] config/arm: fix CN10K minimum march requirement |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Pavan Nikhilesh Bhagavatula Jan. 4, 2024, 9:18 a.m. UTC
  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(-)
  

Comments

Ruifeng Wang Jan. 18, 2024, 2:19 a.m. UTC | #1
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.

>                                   'armv8.2-a', 'armv8.1-a', 'armv8-a']
>               check_compiler_support = false
>               foreach supported_march: supported_marchs
  
Pavan Nikhilesh Bhagavatula Jan. 20, 2024, 7:09 a.m. UTC | #2
> 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
  

Patch

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',
                                 'armv8.2-a', 'armv8.1-a', 'armv8-a']
             check_compiler_support = false
             foreach supported_march: supported_marchs