Re: [PATCH] S/390: Emit vector alignment hints for z13 if AS accepts them [BACKPORT GCC10]

2020-07-16 Thread Andreas Krebbel via Gcc-patches
On 09.07.20 09:29, Stefan Schulze Frielinghaus wrote:
> gcc/ChangeLog:
> 
>   * config.in: Regenerate.
>   * config/s390/s390.c (print_operand): Emit vector alignment hints
>   for target z13, if AS accepts them.  For other targets the logic
>   stays the same.
>   * config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define
>   macro.
>   * configure: Regenerate.
>   * configure.ac: Check HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13.
> 
> gcc/testsuite/ChangeLog:
> 
>   * gcc.target/s390/vector/align-1.c: Change target architecture
>   to z13.
>   * gcc.target/s390/vector/align-2.c: Change target architecture
>   to z13.

Ok. Thanks!

Andreas



Re: [PATCH] S/390: Emit vector alignment hints for z13 if AS accepts them [BACKPORT GCC9]

2020-07-16 Thread Andreas Krebbel via Gcc-patches
On 09.07.20 09:35, Stefan Schulze Frielinghaus wrote:
> Bootstrapped and regtested on s390x with and without a patched gas. Ok
> for master?
> 
> gcc/ChangeLog:
> 
>   * config.in: Regenerate.
>   * config/s390/s390.c (print_operand): Emit vector alignment hints
>   for target z13, if AS accepts them.  For other targets the logic
>   stays the same.
>   * config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define
>   macro.
>   * configure: Regenerate.
>   * configure.ac: Check HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13.
> 
> gcc/testsuite/ChangeLog:
> 
>   * gcc.target/s390/vector/align-1.c: Change target architecture
>   to z13.
>   * gcc.target/s390/vector/align-2.c: Change target architecture
>   to z13.

Ok. Thanks!

Andreas


Re: [PATCH] S/390: Emit vector alignment hints for z13 if AS accepts them [BACKPORT GCC9]

2020-07-09 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Thu, Jul 09, 2020 at 09:35:42AM +0200, Stefan Schulze Frielinghaus via 
Gcc-patches wrote:
> Bootstrapped and regtested on s390x with and without a patched gas. Ok
> for master?

Ok for releases/gcc-9 branch? (not for master of course, sorry for the
confusion).

> gcc/ChangeLog:
> 
>   * config.in: Regenerate.
>   * config/s390/s390.c (print_operand): Emit vector alignment hints
>   for target z13, if AS accepts them.  For other targets the logic
>   stays the same.
>   * config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define
>   macro.
>   * configure: Regenerate.
>   * configure.ac: Check HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13.
> 
> gcc/testsuite/ChangeLog:
> 
>   * gcc.target/s390/vector/align-1.c: Change target architecture
>   to z13.
>   * gcc.target/s390/vector/align-2.c: Change target architecture
>   to z13.
> 
> (cherry picked from commit 929fd91ba975eebf9e57f7f092041271dcaf0c34)
> (squashed with commit 87cb9423add08743d8bb3368f0af61ddc9572837)
> ---
>  gcc/config.in |  7 +
>  gcc/config/s390/s390.c|  4 +--
>  gcc/config/s390/s390.h|  7 +
>  gcc/configure | 31 +++
>  gcc/configure.ac  |  5 +++
>  .../gcc.target/s390/vector/align-1.c  |  2 +-
>  .../gcc.target/s390/vector/align-2.c  |  2 +-
>  7 files changed, 53 insertions(+), 5 deletions(-)
> 
> diff --git a/gcc/config.in b/gcc/config.in
> index a718ceaf3da..bfef2340339 100644
> --- a/gcc/config.in
> +++ b/gcc/config.in
> @@ -676,6 +676,13 @@
>  #endif
>  
>  
> +/* Define if your assembler supports vl/vst/vlm/vstm with an optional
> +   alignment hint argument on z13. */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13
> +#endif
> +
> +
>  /* Define if your assembler supports VSX instructions. */
>  #ifndef USED_FOR_TARGET
>  #undef HAVE_AS_VSX
> diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
> index db3f94978ec..fb0ef44c196 100644
> --- a/gcc/config/s390/s390.c
> +++ b/gcc/config/s390/s390.c
> @@ -7766,15 +7766,13 @@ print_operand (FILE *file, rtx x, int code)
>switch (code)
>  {
>  case 'A':
> -#ifdef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS
> -  if (TARGET_Z14 && MEM_P (x))
> +  if (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS && MEM_P (x))
>   {
> if (MEM_ALIGN (x) >= 128)
>   fprintf (file, ",4");
> else if (MEM_ALIGN (x) == 64)
>   fprintf (file, ",3");
>   }
> -#endif
>return;
>  case 'C':
>fprintf (file, s390_branch_condition_mnemonic (x, FALSE));
> diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
> index f7023d985f1..bd5316ffe94 100644
> --- a/gcc/config/s390/s390.h
> +++ b/gcc/config/s390/s390.h
> @@ -167,6 +167,13 @@ enum processor_flags
>   (TARGET_VX && TARGET_CPU_VXE2)
>  #define TARGET_VXE2_P(opts)  \
>   (TARGET_VX_P (opts) && TARGET_CPU_VXE2_P (opts))
> +#if defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13)
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z13
> +#elif defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS)
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z14
> +#else
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS 0
> +#endif
>  
>  #ifdef HAVE_AS_MACHINE_MACHINEMODE
>  #define S390_USE_TARGET_ATTRIBUTE 1
> diff --git a/gcc/configure b/gcc/configure
> index a065ba23728..35f5a87983b 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -27779,6 +27779,37 @@ if test 
> $gcc_cv_as_s390_vector_loadstore_alignment_hints = yes; then
>  
>  $as_echo "#define HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS 1" >>confdefs.h
>  
> +fi
> +
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for vector 
> load/store alignment hints on z13" >&5
> +$as_echo_n "checking assembler for vector load/store alignment hints on 
> z13... " >&6; }
> +if ${gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13=no
> +  if test x$gcc_cv_as != x; then
> +$as_echo '   vl %v24,0(%r15),3 ' > conftest.s
> +if { ac_try='$gcc_cv_as $gcc_cv_as_flags -mzarch -march=z13 -o 
> conftest.o conftest.s >&5'
> +  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> +  (eval $ac_try) 2>&5
> +  ac_status=$?
> +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> +  test $ac_status = 0; }; }
> +then
> + gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13=yes
> +else
> +  echo "configure: failed program was" >&5
> +  cat conftest.s >&5
> +fi
> +rm -f conftest.o conftest.s
> +  fi
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
> $gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13" >&5
> 

Re: [PATCH] S/390: Emit vector alignment hints for z13 if AS accepts them [BACKPORT GCC10]

2020-07-09 Thread Stefan Schulze Frielinghaus via Gcc-patches
Bootstrapped and regtested on s390x with and without patched gas. Ok for
releases/gcc-10 branch?

On Thu, Jul 09, 2020 at 09:29:21AM +0200, Stefan Schulze Frielinghaus via 
Gcc-patches wrote:
> gcc/ChangeLog:
> 
>   * config.in: Regenerate.
>   * config/s390/s390.c (print_operand): Emit vector alignment hints
>   for target z13, if AS accepts them.  For other targets the logic
>   stays the same.
>   * config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define
>   macro.
>   * configure: Regenerate.
>   * configure.ac: Check HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13.
> 
> gcc/testsuite/ChangeLog:
> 
>   * gcc.target/s390/vector/align-1.c: Change target architecture
>   to z13.
>   * gcc.target/s390/vector/align-2.c: Change target architecture
>   to z13.
> 
> (cherry picked from commit 929fd91ba975eebf9e57f7f092041271dcaf0c34)
> (squashed with commit f842bdd7a97e9fef7513a266d641cac72d5f97cc)
> ---
>  gcc/config.in |  7 +
>  gcc/config/s390/s390.c|  4 +--
>  gcc/config/s390/s390.h|  7 +
>  gcc/configure | 31 +++
>  gcc/configure.ac  |  5 +++
>  .../gcc.target/s390/vector/align-1.c  |  2 +-
>  .../gcc.target/s390/vector/align-2.c  |  2 +-
>  7 files changed, 53 insertions(+), 5 deletions(-)
> 
> diff --git a/gcc/config.in b/gcc/config.in
> index 809e7b26823..364eba47737 100644
> --- a/gcc/config.in
> +++ b/gcc/config.in
> @@ -706,6 +706,13 @@
>  #endif
>  
>  
> +/* Define if your assembler supports vl/vst/vlm/vstm with an optional
> +   alignment hint argument on z13. */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13
> +#endif
> +
> +
>  /* Define if your assembler supports VSX instructions. */
>  #ifndef USED_FOR_TARGET
>  #undef HAVE_AS_VSX
> diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
> index 18332271ed7..ac579a9458b 100644
> --- a/gcc/config/s390/s390.c
> +++ b/gcc/config/s390/s390.c
> @@ -7853,15 +7853,13 @@ print_operand (FILE *file, rtx x, int code)
>switch (code)
>  {
>  case 'A':
> -#ifdef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS
> -  if (TARGET_Z14 && MEM_P (x))
> +  if (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS && MEM_P (x))
>   {
> if (MEM_ALIGN (x) >= 128)
>   fprintf (file, ",4");
> else if (MEM_ALIGN (x) == 64)
>   fprintf (file, ",3");
>   }
> -#endif
>return;
>  case 'C':
>fprintf (file, s390_branch_condition_mnemonic (x, FALSE));
> diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
> index 2e29dbe97e8..e4ef63e4080 100644
> --- a/gcc/config/s390/s390.h
> +++ b/gcc/config/s390/s390.h
> @@ -167,6 +167,13 @@ enum processor_flags
>   (TARGET_VX && TARGET_CPU_VXE2)
>  #define TARGET_VXE2_P(opts)  \
>   (TARGET_VX_P (opts) && TARGET_CPU_VXE2_P (opts))
> +#if defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13)
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z13
> +#elif defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS)
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z14
> +#else
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS 0
> +#endif
>  
>  #ifdef HAVE_AS_MACHINE_MACHINEMODE
>  #define S390_USE_TARGET_ATTRIBUTE 1
> diff --git a/gcc/configure b/gcc/configure
> index cd3d9516fce..eb6061c1631 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -28235,6 +28235,37 @@ if test 
> $gcc_cv_as_s390_vector_loadstore_alignment_hints = yes; then
>  
>  $as_echo "#define HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS 1" >>confdefs.h
>  
> +fi
> +
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for vector 
> load/store alignment hints on z13" >&5
> +$as_echo_n "checking assembler for vector load/store alignment hints on 
> z13... " >&6; }
> +if ${gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13=no
> +  if test x$gcc_cv_as != x; then
> +$as_echo '   vl %v24,0(%r15),3 ' > conftest.s
> +if { ac_try='$gcc_cv_as $gcc_cv_as_flags -mzarch -march=z13 -o 
> conftest.o conftest.s >&5'
> +  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> +  (eval $ac_try) 2>&5
> +  ac_status=$?
> +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> +  test $ac_status = 0; }; }
> +then
> + gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13=yes
> +else
> +  echo "configure: failed program was" >&5
> +  cat conftest.s >&5
> +fi
> +rm -f conftest.o conftest.s
> +  fi
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
> $gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13" >&5
> +$as_echo "$gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13" >&6; }
> +if 

Re: [PATCH] S/390: Emit vector alignment hints for z13 if AS accepts them

2020-06-16 Thread Andreas Krebbel via Gcc-patches
On 16.06.20 10:26, Stefan Schulze Frielinghaus wrote:
> Since 87cb9423add vector alignment hints are emitted for target z13,
> too.  This patch changes this behaviour in the sense that alignment
> hints are only emitted for target z13 if the assembler accepts them.
> 
> Bootstrapped and regtested on S/390. Ok for master?
> 
> gcc/ChangeLog:
> 
>   * config.in: Regenerate.
>   * config/s390/s390.c (print_operand): Emit vector alignment hints
>   for target z13, if AS accepts them.  For other targets the logic
>   stays the same.
>   * config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define
>   macro.
>   * configure: Regenerate.
>   * configure.ac: Check HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13.

Ok. Thanks!

Andreas

> ---
>  gcc/config.in  |  7 +++
>  gcc/config/s390/s390.c |  4 +---
>  gcc/config/s390/s390.h |  7 +++
>  gcc/configure  | 31 +++
>  gcc/configure.ac   |  5 +
>  5 files changed, 51 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/config.in b/gcc/config.in
> index 809e7b26823..364eba47737 100644
> --- a/gcc/config.in
> +++ b/gcc/config.in
> @@ -706,6 +706,13 @@
>  #endif
>  
>  
> +/* Define if your assembler supports vl/vst/vlm/vstm with an optional
> +   alignment hint argument on z13. */
> +#ifndef USED_FOR_TARGET
> +#undef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13
> +#endif
> +
> +
>  /* Define if your assembler supports VSX instructions. */
>  #ifndef USED_FOR_TARGET
>  #undef HAVE_AS_VSX
> diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
> index 56e3e87425a..758315c0c72 100644
> --- a/gcc/config/s390/s390.c
> +++ b/gcc/config/s390/s390.c
> @@ -7853,15 +7853,13 @@ print_operand (FILE *file, rtx x, int code)
>switch (code)
>  {
>  case 'A':
> -#ifdef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS
> -  if (TARGET_Z13 && MEM_P (x))
> +  if (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS && MEM_P (x))
>   {
> if (MEM_ALIGN (x) >= 128)
>   fprintf (file, ",4");
> else if (MEM_ALIGN (x) == 64)
>   fprintf (file, ",3");
>   }
> -#endif
>return;
>  case 'C':
>fprintf (file, s390_branch_condition_mnemonic (x, FALSE));
> diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
> index 2e29dbe97e8..e4ef63e4080 100644
> --- a/gcc/config/s390/s390.h
> +++ b/gcc/config/s390/s390.h
> @@ -167,6 +167,13 @@ enum processor_flags
>   (TARGET_VX && TARGET_CPU_VXE2)
>  #define TARGET_VXE2_P(opts)  \
>   (TARGET_VX_P (opts) && TARGET_CPU_VXE2_P (opts))
> +#if defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13)
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z13
> +#elif defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS)
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z14
> +#else
> +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS 0
> +#endif
>  
>  #ifdef HAVE_AS_MACHINE_MACHINEMODE
>  #define S390_USE_TARGET_ATTRIBUTE 1
> diff --git a/gcc/configure b/gcc/configure
> index def9d9a48be..f224679ed3e 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -28241,6 +28241,37 @@ if test 
> $gcc_cv_as_s390_vector_loadstore_alignment_hints = yes; then
>  
>  $as_echo "#define HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS 1" >>confdefs.h
>  
> +fi
> +
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for vector 
> load/store alignment hints on z13" >&5
> +$as_echo_n "checking assembler for vector load/store alignment hints on 
> z13... " >&6; }
> +if ${gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13=no
> +  if test x$gcc_cv_as != x; then
> +$as_echo '   vl %v24,0(%r15),3 ' > conftest.s
> +if { ac_try='$gcc_cv_as $gcc_cv_as_flags -mzarch -march=z13 -o 
> conftest.o conftest.s >&5'
> +  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> +  (eval $ac_try) 2>&5
> +  ac_status=$?
> +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> +  test $ac_status = 0; }; }
> +then
> + gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13=yes
> +else
> +  echo "configure: failed program was" >&5
> +  cat conftest.s >&5
> +fi
> +rm -f conftest.o conftest.s
> +  fi
> +fi
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
> $gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13" >&5
> +$as_echo "$gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13" >&6; }
> +if test $gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13 = yes; then
> +
> +$as_echo "#define HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13 1" 
> >>confdefs.h
> +
>  fi
>  
>  
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index e769c9c87d4..e83f0833ef3 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -5106,6 +5106,11 @@ configured with 

Re: [PATCH] S/390: Emit vector alignment hints for z13

2020-06-02 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Fri, May 29, 2020 at 01:57:30PM +0200, Andreas Krebbel wrote:
> On 28.05.20 20:24, Stefan Schulze Frielinghaus wrote:
> > Vector alignment hints are fully supported since z14.  On z13 alignment
> > hints have no effect, however, instructions with alignment hints are
> > still legal.  Thus, emit alignment hints also for z13 targets so that if
> > the binary is actually run on a z14 or later it benefits from such
> > hints.
> 
> More precisely the alignment hints don't have any effect before z15, are 
> described already in the
> z14 architecture but actually are also accepted by z13 hardware.

True, I removed the confusing comment and pushed.

Thanks, Stefan

> 
> > 
> > Note, this requires gas including commit f687f5f563 of the binutils
> > repository.
> > 
> > gcc/ChangeLog:
> > 
> > * config/s390/s390.c (print_operand): Emit vector alignment
> > hints for z13.
> > 
> > gcc/testsuite/ChangeLog:
> > 
> > * gcc.target/s390/vector/align-1.c: Change target architecture
> > to z13.
> > * gcc.target/s390/vector/align-2.c: Change target architecture
> > to z13.
> 
> Ok. Thanks!
> 
> Andreas
> 
> > ---
> >  gcc/config/s390/s390.c | 7 ++-
> >  gcc/testsuite/gcc.target/s390/vector/align-1.c | 2 +-
> >  gcc/testsuite/gcc.target/s390/vector/align-2.c | 2 +-
> >  3 files changed, 8 insertions(+), 3 deletions(-)
> > 
> > diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
> > index 4de3129f88e..b5fd5a2f3ed 100644
> > --- a/gcc/config/s390/s390.c
> > +++ b/gcc/config/s390/s390.c
> > @@ -7854,7 +7854,12 @@ print_operand (FILE *file, rtx x, int code)
> >  {
> >  case 'A':
> >  #ifdef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS
> > -  if (TARGET_Z14 && MEM_P (x))
> > +  /* Vector alignment hints are fully supported since z14.  On z13
> > +alignment hints have no effect, however, instructions with alignment
> > +hints are still legal.  Thus, emit alignment hints also for z13
> > +targets so that if the binary is actually run on a z14 or later it
> > +benefits from such hints.  */
> > +  if (TARGET_Z13 && MEM_P (x))
> > {
> >   if (MEM_ALIGN (x) >= 128)
> > fprintf (file, ",4");
> > diff --git a/gcc/testsuite/gcc.target/s390/vector/align-1.c 
> > b/gcc/testsuite/gcc.target/s390/vector/align-1.c
> > index ccad22a..6997af2ddcd 100644
> > --- a/gcc/testsuite/gcc.target/s390/vector/align-1.c
> > +++ b/gcc/testsuite/gcc.target/s390/vector/align-1.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O3 -mzarch -march=z14" } */
> > +/* { dg-options "-O3 -mzarch -march=z13" } */
> >  
> >  /* The user alignment ends up in DECL_ALIGN of the VAR_DECL and is
> > currently ignored if it is smaller than the alignment of the type.
> > diff --git a/gcc/testsuite/gcc.target/s390/vector/align-2.c 
> > b/gcc/testsuite/gcc.target/s390/vector/align-2.c
> > index e4e2fba6a58..00e09d3eadb 100644
> > --- a/gcc/testsuite/gcc.target/s390/vector/align-2.c
> > +++ b/gcc/testsuite/gcc.target/s390/vector/align-2.c
> > @@ -1,5 +1,5 @@
> >  /* { dg-do compile } */
> > -/* { dg-options "-O3 -mzarch -march=z14" } */
> > +/* { dg-options "-O3 -mzarch -march=z13" } */
> >  
> >  /* The user alignment ends up in TYPE_ALIGN of the type of the
> > VAR_DECL.  */
> > 
> 


Re: [PATCH] S/390: Emit vector alignment hints for z13

2020-05-29 Thread Andreas Krebbel via Gcc-patches
On 28.05.20 20:24, Stefan Schulze Frielinghaus wrote:
> Vector alignment hints are fully supported since z14.  On z13 alignment
> hints have no effect, however, instructions with alignment hints are
> still legal.  Thus, emit alignment hints also for z13 targets so that if
> the binary is actually run on a z14 or later it benefits from such
> hints.

More precisely the alignment hints don't have any effect before z15, are 
described already in the
z14 architecture but actually are also accepted by z13 hardware.

> 
> Note, this requires gas including commit f687f5f563 of the binutils
> repository.
> 
> gcc/ChangeLog:
> 
>   * config/s390/s390.c (print_operand): Emit vector alignment
>   hints for z13.
> 
> gcc/testsuite/ChangeLog:
> 
>   * gcc.target/s390/vector/align-1.c: Change target architecture
>   to z13.
>   * gcc.target/s390/vector/align-2.c: Change target architecture
>   to z13.

Ok. Thanks!

Andreas

> ---
>  gcc/config/s390/s390.c | 7 ++-
>  gcc/testsuite/gcc.target/s390/vector/align-1.c | 2 +-
>  gcc/testsuite/gcc.target/s390/vector/align-2.c | 2 +-
>  3 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
> index 4de3129f88e..b5fd5a2f3ed 100644
> --- a/gcc/config/s390/s390.c
> +++ b/gcc/config/s390/s390.c
> @@ -7854,7 +7854,12 @@ print_operand (FILE *file, rtx x, int code)
>  {
>  case 'A':
>  #ifdef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS
> -  if (TARGET_Z14 && MEM_P (x))
> +  /* Vector alignment hints are fully supported since z14.  On z13
> +  alignment hints have no effect, however, instructions with alignment
> +  hints are still legal.  Thus, emit alignment hints also for z13
> +  targets so that if the binary is actually run on a z14 or later it
> +  benefits from such hints.  */
> +  if (TARGET_Z13 && MEM_P (x))
>   {
> if (MEM_ALIGN (x) >= 128)
>   fprintf (file, ",4");
> diff --git a/gcc/testsuite/gcc.target/s390/vector/align-1.c 
> b/gcc/testsuite/gcc.target/s390/vector/align-1.c
> index ccad22a..6997af2ddcd 100644
> --- a/gcc/testsuite/gcc.target/s390/vector/align-1.c
> +++ b/gcc/testsuite/gcc.target/s390/vector/align-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O3 -mzarch -march=z14" } */
> +/* { dg-options "-O3 -mzarch -march=z13" } */
>  
>  /* The user alignment ends up in DECL_ALIGN of the VAR_DECL and is
> currently ignored if it is smaller than the alignment of the type.
> diff --git a/gcc/testsuite/gcc.target/s390/vector/align-2.c 
> b/gcc/testsuite/gcc.target/s390/vector/align-2.c
> index e4e2fba6a58..00e09d3eadb 100644
> --- a/gcc/testsuite/gcc.target/s390/vector/align-2.c
> +++ b/gcc/testsuite/gcc.target/s390/vector/align-2.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O3 -mzarch -march=z14" } */
> +/* { dg-options "-O3 -mzarch -march=z13" } */
>  
>  /* The user alignment ends up in TYPE_ALIGN of the type of the
> VAR_DECL.  */
> 



Re: [PATCH] S/390: Emit vector alignment hints for z13

2020-05-28 Thread Stefan Schulze Frielinghaus via Gcc-patches
Forgot to mention:

Bootstrapped and regtested on z13 and z14 with gas including f687f5f563

Ok for master?

On Thu, May 28, 2020 at 08:24:26PM +0200, Stefan Schulze Frielinghaus via 
Gcc-patches wrote:
> Vector alignment hints are fully supported since z14.  On z13 alignment
> hints have no effect, however, instructions with alignment hints are
> still legal.  Thus, emit alignment hints also for z13 targets so that if
> the binary is actually run on a z14 or later it benefits from such
> hints.
> 
> Note, this requires gas including commit f687f5f563 of the binutils
> repository.
> 
> gcc/ChangeLog:
> 
>   * config/s390/s390.c (print_operand): Emit vector alignment
>   hints for z13.
> 
> gcc/testsuite/ChangeLog:
> 
>   * gcc.target/s390/vector/align-1.c: Change target architecture
>   to z13.
>   * gcc.target/s390/vector/align-2.c: Change target architecture
>   to z13.
> ---
>  gcc/config/s390/s390.c | 7 ++-
>  gcc/testsuite/gcc.target/s390/vector/align-1.c | 2 +-
>  gcc/testsuite/gcc.target/s390/vector/align-2.c | 2 +-
>  3 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
> index 4de3129f88e..b5fd5a2f3ed 100644
> --- a/gcc/config/s390/s390.c
> +++ b/gcc/config/s390/s390.c
> @@ -7854,7 +7854,12 @@ print_operand (FILE *file, rtx x, int code)
>  {
>  case 'A':
>  #ifdef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS
> -  if (TARGET_Z14 && MEM_P (x))
> +  /* Vector alignment hints are fully supported since z14.  On z13
> +  alignment hints have no effect, however, instructions with alignment
> +  hints are still legal.  Thus, emit alignment hints also for z13
> +  targets so that if the binary is actually run on a z14 or later it
> +  benefits from such hints.  */
> +  if (TARGET_Z13 && MEM_P (x))
>   {
> if (MEM_ALIGN (x) >= 128)
>   fprintf (file, ",4");
> diff --git a/gcc/testsuite/gcc.target/s390/vector/align-1.c 
> b/gcc/testsuite/gcc.target/s390/vector/align-1.c
> index ccad22a..6997af2ddcd 100644
> --- a/gcc/testsuite/gcc.target/s390/vector/align-1.c
> +++ b/gcc/testsuite/gcc.target/s390/vector/align-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O3 -mzarch -march=z14" } */
> +/* { dg-options "-O3 -mzarch -march=z13" } */
>  
>  /* The user alignment ends up in DECL_ALIGN of the VAR_DECL and is
> currently ignored if it is smaller than the alignment of the type.
> diff --git a/gcc/testsuite/gcc.target/s390/vector/align-2.c 
> b/gcc/testsuite/gcc.target/s390/vector/align-2.c
> index e4e2fba6a58..00e09d3eadb 100644
> --- a/gcc/testsuite/gcc.target/s390/vector/align-2.c
> +++ b/gcc/testsuite/gcc.target/s390/vector/align-2.c
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O3 -mzarch -march=z14" } */
> +/* { dg-options "-O3 -mzarch -march=z13" } */
>  
>  /* The user alignment ends up in TYPE_ALIGN of the type of the
> VAR_DECL.  */
> -- 
> 2.25.3
>