diff mbox series

[2/5] testsuite: [arm/mve] Use arm_softfp and arm_hard as needed in MVE tests

Message ID 20200410135553.3848-2-christophe.lyon@linaro.org
State New
Headers show
Series [1/5] testsuite: [arm] Add arm_softfp_ok and arm_hard_ok effective targets. | expand

Commit Message

Li, Pan2 via Gcc-patches April 10, 2020, 1:55 p.m. UTC
Some MVE tests explicitly test a -mfloat-abi=hard option, but we need
to check that the toolchain actually supports it (which may not be the
case for arm-linux-gnueabi* targets).

We also make use of dg-add-options arm_v8_1m_mve_fp and arm_v8_1m_mve
instead of duplicating the corresponding options in
dg-additional-options where we keep only -mfloat-abi to override the
option selected by arm_v8_1m_mve_fp.

2020-04-10  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c: Use arm_hard_ok
	effective target and arm_v8_1m_mve_fp options.
	* gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c: Use arm_softfp_ok
	effective target and arm_v8_1m_mve_fp options.
	* gcc.target/arm/mve/intrinsics/mve_fpu1.c: Use arm_hard_ok
	effective target and arm_v8_1m_mve options.
	* gcc.target/arm/mve/intrinsics/mve_fpu2.c: Use arm_softfp_ok
	effective target and arm_v8_1m_mve options.
---
 gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c | 4 +++-
 gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c | 4 +++-
 gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c    | 4 +++-
 gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c    | 4 +++-
 4 files changed, 12 insertions(+), 4 deletions(-)

Comments

Andre Vieira (lists) April 14, 2020, 8:21 a.m. UTC | #1
On 10/04/2020 14:55, Christophe Lyon via Gcc-patches wrote:
> Some MVE tests explicitly test a -mfloat-abi=hard option, but we need
> to check that the toolchain actually supports it (which may not be the
> case for arm-linux-gnueabi* targets).
>
> We also make use of dg-add-options arm_v8_1m_mve_fp and arm_v8_1m_mve
> instead of duplicating the corresponding options in
> dg-additional-options where we keep only -mfloat-abi to override the
> option selected by arm_v8_1m_mve_fp.
Hi Christophe,

This sounds good!! Thank you for doing this.
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
> index 1462dd4..0fa3afd 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
> @@ -1,6 +1,8 @@
>   /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
> +/* { dg-require-effective-target arm_hard_ok } */
> +/* { dg-add-options arm_v8_1m_mve_fp } */
>   /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
I was wondering, do we still need the skip-if with the arm_hard_ok?
> -/* { dg-additional-options "-march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mthumb -mfpu=auto --save-temps" } */
> +/* { dg-additional-options "-mfloat-abi=hard" } */
>   
>   #include "arm_mve.h"
>   
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
> index d528133..1fca110 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
> @@ -1,5 +1,7 @@
>   /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
> -/* { dg-additional-options "-march=armv8.1-m.main+mve.fp -mfloat-abi=softfp -mthumb -mfpu=auto --save-temps" } */
> +/* { dg-require-effective-target arm_softfp_ok } */
> +/* { dg-add-options arm_v8_1m_mve_fp } */
> +/* { dg-additional-options "-mfloat-abi=softfp" } */
>   
>   #include "arm_mve.h"
>   
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
> index 59ca724..726f9ec 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
> @@ -1,6 +1,8 @@
>   /* { dg-require-effective-target arm_v8_1m_mve_ok } */
> +/* { dg-require-effective-target arm_hard_ok } */
> +/* { dg-add-options arm_v8_1m_mve } */
>   /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
Same here.
> -/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=hard -mthumb -mfpu=auto --save-temps" } */
> +/* { dg-additional-options "-mfloat-abi=hard" } */
>   
>   #include "arm_mve.h"
>   
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
> index ce297ea..7f39905 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
> @@ -1,6 +1,8 @@
>   /* { dg-require-effective-target arm_v8_1m_mve_ok } */
> +/* { dg-require-effective-target arm_softfp_ok } */
> +/* { dg-add-options arm_v8_1m_mve } */
>   /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
And here.
> -/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=softfp -mthumb -mfpu=auto --save-temps" } */
> +/* { dg-additional-options "-mfloat-abi=softfp" } */
>   
>   #include "arm_mve.h"
>   
LGTM.
Christophe Lyon April 14, 2020, 12:40 p.m. UTC | #2
On Tue, 14 Apr 2020 at 10:21, Andre Vieira (lists) <
andre.simoesdiasvieira@arm.com> wrote:

> On 10/04/2020 14:55, Christophe Lyon via Gcc-patches wrote:
> > Some MVE tests explicitly test a -mfloat-abi=hard option, but we need
> > to check that the toolchain actually supports it (which may not be the
> > case for arm-linux-gnueabi* targets).
> >
> > We also make use of dg-add-options arm_v8_1m_mve_fp and arm_v8_1m_mve
> > instead of duplicating the corresponding options in
> > dg-additional-options where we keep only -mfloat-abi to override the
> > option selected by arm_v8_1m_mve_fp.
> Hi Christophe,
>
> This sounds good!! Thank you for doing this.
> > diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
> > index 1462dd4..0fa3afd 100644
> > --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
> > +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
> > @@ -1,6 +1,8 @@
> >   /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
> > +/* { dg-require-effective-target arm_hard_ok } */
> > +/* { dg-add-options arm_v8_1m_mve_fp } */
> >   /* { dg-skip-if "Incompatible float ABI" { *-*-* } {
> "-mfloat-abi=soft" } {""} } */
> I was wondering, do we still need the skip-if with the arm_hard_ok?
>

Indeed, I just checked that it's useless by running with
--target-board=-mfloat-abi=soft.

> -/* { dg-additional-options "-march=armv8.1-m.main+mve.fp
> -mfloat-abi=hard -mthumb -mfpu=auto --save-temps" } */
> > +/* { dg-additional-options "-mfloat-abi=hard" } */
> >
> >   #include "arm_mve.h"
> >
> > diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
> > index d528133..1fca110 100644
> > --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
> > +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
> > @@ -1,5 +1,7 @@
> >   /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
> > -/* { dg-additional-options "-march=armv8.1-m.main+mve.fp
> -mfloat-abi=softfp -mthumb -mfpu=auto --save-temps" } */
> > +/* { dg-require-effective-target arm_softfp_ok } */
> > +/* { dg-add-options arm_v8_1m_mve_fp } */
> > +/* { dg-additional-options "-mfloat-abi=softfp" } */
> >
> >   #include "arm_mve.h"
> >
> > diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
> > index 59ca724..726f9ec 100644
> > --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
> > +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
> > @@ -1,6 +1,8 @@
> >   /* { dg-require-effective-target arm_v8_1m_mve_ok } */
> > +/* { dg-require-effective-target arm_hard_ok } */
> > +/* { dg-add-options arm_v8_1m_mve } */
> >   /* { dg-skip-if "Incompatible float ABI" { *-*-* } {
> "-mfloat-abi=soft" } {""} } */
> Same here.
>
Same


> > -/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=hard
> -mthumb -mfpu=auto --save-temps" } */
> > +/* { dg-additional-options "-mfloat-abi=hard" } */
> >
> >   #include "arm_mve.h"
> >
> > diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
> > index ce297ea..7f39905 100644
> > --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
> > +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
> > @@ -1,6 +1,8 @@
> >   /* { dg-require-effective-target arm_v8_1m_mve_ok } */
> > +/* { dg-require-effective-target arm_softfp_ok } */
> > +/* { dg-add-options arm_v8_1m_mve } */
> >   /* { dg-skip-if "Incompatible float ABI" { *-*-* } {
> "-mfloat-abi=soft" } {""} } */
> And here.
>
Without dg-skip-if, the test passes since soft and softfp are compatible.


> > -/* { dg-additional-options "-march=armv8.1-m.main+mve
> -mfloat-abi=softfp -mthumb -mfpu=auto --save-temps" } */
> > +/* { dg-additional-options "-mfloat-abi=softfp" } */
> >
> >   #include "arm_mve.h"
> >
> LGTM.
>
Thanks, I'll remove the dg-skip-if clauses above before committing if the
patch is approved.

Christophe
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
index 1462dd4..0fa3afd 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu1.c
@@ -1,6 +1,8 @@ 
 /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
+/* { dg-require-effective-target arm_hard_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
-/* { dg-additional-options "-march=armv8.1-m.main+mve.fp -mfloat-abi=hard -mthumb -mfpu=auto --save-temps" } */
+/* { dg-additional-options "-mfloat-abi=hard" } */
 
 #include "arm_mve.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
index d528133..1fca110 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fp_fpu2.c
@@ -1,5 +1,7 @@ 
 /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
-/* { dg-additional-options "-march=armv8.1-m.main+mve.fp -mfloat-abi=softfp -mthumb -mfpu=auto --save-temps" } */
+/* { dg-require-effective-target arm_softfp_ok } */
+/* { dg-add-options arm_v8_1m_mve_fp } */
+/* { dg-additional-options "-mfloat-abi=softfp" } */
 
 #include "arm_mve.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
index 59ca724..726f9ec 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu1.c
@@ -1,6 +1,8 @@ 
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-require-effective-target arm_hard_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
-/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=hard -mthumb -mfpu=auto --save-temps" } */
+/* { dg-additional-options "-mfloat-abi=hard" } */
 
 #include "arm_mve.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
index ce297ea..7f39905 100644
--- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
+++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/mve_fpu2.c
@@ -1,6 +1,8 @@ 
 /* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-require-effective-target arm_softfp_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
 /* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=soft" } {""} } */
-/* { dg-additional-options "-march=armv8.1-m.main+mve -mfloat-abi=softfp -mthumb -mfpu=auto --save-temps" } */
+/* { dg-additional-options "-mfloat-abi=softfp" } */
 
 #include "arm_mve.h"