On Wed, Jul 30, 2025 at 01:07:11PM +0000, Remi Machet wrote:
> 
> On 7/29/25 17:29, Spencer Abson wrote:
> > External email: Use caution opening links or attachments
> >
> >
> > GCC doesn't support SME without SVE2, so the -march=armv8-a+<ext> argument 
> > to
> > check_no_compiler_messages causes aarch64_asm_<ext>_ok to return zero for 
> > SME
> > and any <ext> that implies it.  This patch changes the baseline architecure 
> > to
> > armv9-a for these extensions.
> >
> > The tests for ACLE SME2 intrinsics that require FEAT_FAMINMAX were 
> > configured
> > to do-assemble if aarch64_asm_sme2_ok returned 1 (by default), but they 
> > really
> > need to check if +faminmax is supported too.  The fix above exposed this, so
> > we also fix the do-assemble/do-compile choice for those tests here.
> >
> > gcc/testsuite/ChangeLog:
> >
> >          * gcc.target/aarch64/sme2/acle-asm/amax_f16_x2.c: Gate do-assemble 
> > on
> >          assembler support for +faminmax and +sme2.
> >          * gcc.target/aarch64/sme2/acle-asm/amax_f16_x4.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amax_f32_x2.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amax_f32_x4.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amax_f64_x2.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amax_f64_x4.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amin_f16_x2.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amin_f16_x4.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amin_f32_x2.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amin_f32_x4.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amin_f64_x2.c: Likewise.
> >          * gcc.target/aarch64/sme2/acle-asm/amin_f64_x4.c: Likewise.
> >          * lib/target-supports.exp: Split the extensions that require SME 
> > into
> >          a separate set, and use armv9-a as their baseline.
> > ---
> >
> > This is V2 of patch 0/1 from the series for PR121028.
> >
> > Linaro's CI picked up failiures that I couldn't see locally (because my
> > assembler was out of date...).  This revision only needs to be applied to
> > master because the FAMINMAX work is younger than GCC 14.
> >
> > I've now regtested this with a shiny new assembler, OK for master?
> 
> Hi Spencer,
> 
> Should the PR be included in the title and Changelog since this is 
> related your first patch?
> 
> Looks good to me (but I am not an official reviewer or approver).

This is a prerequisite for the fix for PR121028; it fixes a testsuite feature
that I’d like to use in that fix. I’m not sure it would be appropriate to
mention PR121028 in the changelog.

I realise that creating a new thread for a v2 of a patch from an existing
series is a bit confusing - apologies for that...

Thanks,
Spencer
> 
> Remi
> 
> >   .../aarch64/sme2/acle-asm/amin_f64_x2.c       |  2 ++
> >   .../aarch64/sme2/acle-asm/amin_f64_x4.c       |  2 ++
> >   gcc/testsuite/lib/target-supports.exp         | 28 ++++++++++++++++---
> >   13 files changed, 48 insertions(+), 4 deletions(-)
> >
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x2.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x2.c
> > index 90b5438e173..b9fd96ac84f 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x2.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x2.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x4.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x4.c
> > index d168ad7ee8e..70e269761ac 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x4.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f16_x4.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x2.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x2.c
> > index 618d50b9b61..cf57d1b4163 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x2.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x2.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x4.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x4.c
> > index 981e78c1b5c..10d91757066 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x4.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f32_x4.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x2.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x2.c
> > index e93a409475e..b7918ab4487 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x2.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x2.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x4.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x4.c
> > index 2db629e147c..153a37a005d 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x4.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amax_f64_x4.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x2.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x2.c
> > index 74604e14f01..bd6e13b695f 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x2.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x2.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x4.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x4.c
> > index bc3779bca6c..9f71b1f8ae6 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x4.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f16_x4.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x2.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x2.c
> > index 43e3075d40f..aaa6a2e8941 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x2.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x2.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x4.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x4.c
> > index 6bd20f8fdd9..34c1098d285 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x4.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f32_x4.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x2.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x2.c
> > index 3bbef3f27cd..e4138e0cdc9 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x2.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x2.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x4.c 
> > b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x4.c
> > index 6f4c9b7787a..8fbabe78b45 100644
> > --- a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x4.c
> > +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/amin_f64_x4.c
> > @@ -1,3 +1,5 @@
> > +/* { dg-do assemble { target { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } */
> > +/* { dg-do compile { target { ! { aarch64_asm_sme2_ok && 
> > aarch64_asm_faminmax_ok } } } } */
> >   /* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
> >
> >   #include "test_sme2_acle.h"
> > diff --git a/gcc/testsuite/lib/target-supports.exp 
> > b/gcc/testsuite/lib/target-supports.exp
> > index e375b1ec02b..74355194b76 100644
> > --- a/gcc/testsuite/lib/target-supports.exp
> > +++ b/gcc/testsuite/lib/target-supports.exp
> > @@ -12522,10 +12522,16 @@ proc 
> > check_effective_target_aarch64_gas_has_build_attributes { } {
> >   # various architecture extensions via the .arch_extension pseudo-op.
> >
> >   set exts {
> > -    "bf16" "cmpbr" "crc" "crypto" "dotprod" "f32mm" "f64mm" "fp" "fp8"
> > -    "fp8dot2" "fp8dot4" "fp8fma" "i8mm" "ls64" "lse" "lut" "sb" "simd"
> > -    "sme-b16b16" "sme-f16f16" "sme-i16i64" "sme" "sme2" "sme2p1" 
> > "ssve-fp8dot2"
> > -    "ssve-fp8dot4" "ssve-fp8fma" "sve-b16b16" "sve" "sve2"
> > +    "bf16" "cmpbr" "crc" "crypto" "dotprod" "f32mm" "f64mm" "faminmax"
> > +    "fp" "fp8" "fp8dot2" "fp8dot4" "fp8fma" "i8mm" "ls64" "lse" "lut"
> > +    "sb" "simd" "sve-b16b16" "sve" "sve2"
> > +}
> > +
> > +# We don't support SME without SVE2, so we'll use armv9 as the base
> > +# archiecture for SME and the features that require it.
> > +set exts_sve2 {
> > +    "sme-b16b16" "sme-f16f16" "sme-i16i64" "sme" "sme2" "sme2p1"
> > +    "ssve-fp8dot2" "ssve-fp8dot4" "ssve-fp8fma"
> >   }
> >
> >   foreach { aarch64_ext } $exts {
> > @@ -12542,6 +12548,20 @@ foreach { aarch64_ext } $exts {
> >       }]
> >   }
> >
> > +foreach { aarch64_ext } $exts_sve2 {
> > +    eval [string map [list FUNC $aarch64_ext] {
> > +       proc check_effective_target_aarch64_asm_FUNC_ok { } {
> > +         if { [istarget aarch64*-*-*] } {
> > +               return [check_no_compiler_messages aarch64_FUNC_assembler 
> > object {
> > +                       __asm__ (".arch_extension FUNC");
> > +               } "-march=armv9-a+FUNC"]
> > +         } else {
> > +               return 0
> > +         }
> > +       }
> > +    }]
> > +}
> > +
> >   proc check_effective_target_aarch64_asm_sve2p1_ok { } {
> >       if { [istarget aarch64*-*-*] } {
> >          return [check_no_compiler_messages aarch64_sve2p1_assembler object 
> > {
> > --
> > 2.34.1
> >

Reply via email to