* [PATCH] s390: Fix test vector/long-double-to-i64.c
@ 2024-02-29 12:15 Stefan Schulze Frielinghaus
2024-03-11 10:14 ` Andreas Krebbel
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Schulze Frielinghaus @ 2024-02-29 12:15 UTC (permalink / raw)
To: krebbel, gcc-patches; +Cc: Stefan Schulze Frielinghaus
Starting with r14-8319-g86de9b66480b71 fwprop improved so that vpdi is
no longer required.
gcc/testsuite/ChangeLog:
* gcc.target/s390/vector/long-double-to-i64.c: Fix scan
assembler directive.
---
.../gcc.target/s390/vector/long-double-to-i64.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
index 2dbbb5d1c03..ed89878e6ee 100644
--- a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
@@ -1,19 +1,24 @@
/* { dg-do compile } */
/* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
/* { dg-do run { target { s390_z14_hw } } } */
+/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } } } */
+
#include <assert.h>
#include <stdint.h>
+/*
+** long_double_to_i64:
+** ld %f0,0\(%r2\)
+** ld %f2,8\(%r2\)
+** cgxbr %r2,5,%f0
+** br %r14
+*/
__attribute__ ((noipa)) static int64_t
long_double_to_i64 (long double x)
{
return x;
}
-/* { dg-final { scan-assembler-times {\n\tvpdi\t%v\d+,%v\d+,%v\d+,1\n} 1 } } */
-/* { dg-final { scan-assembler-times {\n\tvpdi\t%v\d+,%v\d+,%v\d+,5\n} 1 } } */
-/* { dg-final { scan-assembler-times {\n\tcgxbr\t} 1 } } */
-
int
main (void)
{
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] s390: Fix test vector/long-double-to-i64.c
2024-02-29 12:15 [PATCH] s390: Fix test vector/long-double-to-i64.c Stefan Schulze Frielinghaus
@ 2024-03-11 10:14 ` Andreas Krebbel
2024-03-12 15:07 ` Stefan Schulze Frielinghaus
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Krebbel @ 2024-03-11 10:14 UTC (permalink / raw)
To: Stefan Schulze Frielinghaus, gcc-patches
On 2/29/24 13:15, Stefan Schulze Frielinghaus wrote:
> Starting with r14-8319-g86de9b66480b71 fwprop improved so that vpdi is
> no longer required.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/s390/vector/long-double-to-i64.c: Fix scan
> assembler directive.
Should we perhaps rather turn the scan-assembler directives into something which checks for the
absence of vpdi then? In order to get notified once this really useful optimization breaks?
Andreas
> ---
> .../gcc.target/s390/vector/long-double-to-i64.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
> index 2dbbb5d1c03..ed89878e6ee 100644
> --- a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
> +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
> @@ -1,19 +1,24 @@
> /* { dg-do compile } */
> /* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
> /* { dg-do run { target { s390_z14_hw } } } */
> +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } } } */
> +
> #include <assert.h>
> #include <stdint.h>
>
> +/*
> +** long_double_to_i64:
> +** ld %f0,0\(%r2\)
> +** ld %f2,8\(%r2\)
> +** cgxbr %r2,5,%f0
> +** br %r14
> +*/
> __attribute__ ((noipa)) static int64_t
> long_double_to_i64 (long double x)
> {
> return x;
> }
>
> -/* { dg-final { scan-assembler-times {\n\tvpdi\t%v\d+,%v\d+,%v\d+,1\n} 1 } } */
> -/* { dg-final { scan-assembler-times {\n\tvpdi\t%v\d+,%v\d+,%v\d+,5\n} 1 } } */
> -/* { dg-final { scan-assembler-times {\n\tcgxbr\t} 1 } } */
> -
> int
> main (void)
> {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] s390: Fix test vector/long-double-to-i64.c
2024-03-11 10:14 ` Andreas Krebbel
@ 2024-03-12 15:07 ` Stefan Schulze Frielinghaus
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Schulze Frielinghaus @ 2024-03-12 15:07 UTC (permalink / raw)
To: Andreas Krebbel; +Cc: gcc-patches
On Mon, Mar 11, 2024 at 11:14:04AM +0100, Andreas Krebbel wrote:
> On 2/29/24 13:15, Stefan Schulze Frielinghaus wrote:
> > Starting with r14-8319-g86de9b66480b71 fwprop improved so that vpdi is
> > no longer required.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * gcc.target/s390/vector/long-double-to-i64.c: Fix scan
> > assembler directive.
>
> Should we perhaps rather turn the scan-assembler directives into something which checks for the
> absence of vpdi then? In order to get notified once this really useful optimization breaks?
I thought about checking for the most optimal code which would be just
two loads and a convert instruction. Thus if this fails, then we have a
regression. Speaking of regressions, the old behaviour was restored by
r14-9412-g3e3e4156a5f93e which means we are back using vpdi. Thus, I
will leave this patch on hold and have a second look.
Cheers,
Stefan
>
> Andreas
>
> > ---
> > .../gcc.target/s390/vector/long-double-to-i64.c | 13 +++++++++----
> > 1 file changed, 9 insertions(+), 4 deletions(-)
> >
> > diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
> > index 2dbbb5d1c03..ed89878e6ee 100644
> > --- a/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
> > +++ b/gcc/testsuite/gcc.target/s390/vector/long-double-to-i64.c
> > @@ -1,19 +1,24 @@
> > /* { dg-do compile } */
> > /* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
> > /* { dg-do run { target { s390_z14_hw } } } */
> > +/* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } } } */
> > +
> > #include <assert.h>
> > #include <stdint.h>
> >
> > +/*
> > +** long_double_to_i64:
> > +** ld %f0,0\(%r2\)
> > +** ld %f2,8\(%r2\)
> > +** cgxbr %r2,5,%f0
> > +** br %r14
> > +*/
> > __attribute__ ((noipa)) static int64_t
> > long_double_to_i64 (long double x)
> > {
> > return x;
> > }
> >
> > -/* { dg-final { scan-assembler-times {\n\tvpdi\t%v\d+,%v\d+,%v\d+,1\n} 1 } } */
> > -/* { dg-final { scan-assembler-times {\n\tvpdi\t%v\d+,%v\d+,%v\d+,5\n} 1 } } */
> > -/* { dg-final { scan-assembler-times {\n\tcgxbr\t} 1 } } */
> > -
> > int
> > main (void)
> > {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-12 15:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29 12:15 [PATCH] s390: Fix test vector/long-double-to-i64.c Stefan Schulze Frielinghaus
2024-03-11 10:14 ` Andreas Krebbel
2024-03-12 15:07 ` Stefan Schulze Frielinghaus
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 read-only IMAP folder(s) and NNTP newsgroup(s).