LGTM, thanks :)

On Tue, Jul 30, 2024 at 10:53 AM Patrick O'Neill <patr...@rivosinc.com> wrote:
>
> This patch removes the zabha configure check since it's not a breaking change
> and updates the existing zaamo/zalrsc comment.
>
> gcc/ChangeLog:
>
>         * common/config/riscv/riscv-common.cc
>           (riscv_subset_list::to_string): Remove zabha configure check
>           handling and clarify zaamo/zalrsc comment.
>         * config.in: Regenerate.
>         * configure: Regenerate.
>         * configure.ac: Remove zabha configure check.
>
> Signed-off-by: Patrick O'Neill <patr...@rivosinc.com>
> ---
> The user has to specify zabha in order for binutils to throw an error.
> This is in contrast to zaamo/zalrsc which are expanded from 'a' without being
> specified.
>
> Relying on precommit to do testing.
> ---
>  gcc/common/config/riscv/riscv-common.cc | 12 +++-------
>  gcc/config.in                           |  6 -----
>  gcc/configure                           | 31 -------------------------
>  gcc/configure.ac                        |  5 ----
>  4 files changed, 3 insertions(+), 51 deletions(-)
>
> diff --git a/gcc/common/config/riscv/riscv-common.cc 
> b/gcc/common/config/riscv/riscv-common.cc
> index 682826c0e34..d2912877784 100644
> --- a/gcc/common/config/riscv/riscv-common.cc
> +++ b/gcc/common/config/riscv/riscv-common.cc
> @@ -855,7 +855,6 @@ riscv_subset_list::to_string (bool version_p) const
>
>    bool skip_zifencei = false;
>    bool skip_zaamo_zalrsc = false;
> -  bool skip_zabha = false;
>    bool skip_zicsr = false;
>    bool i2p0 = false;
>
> @@ -884,13 +883,11 @@ riscv_subset_list::to_string (bool version_p) const
>    skip_zifencei = true;
>  #endif
>  #ifndef HAVE_AS_MARCH_ZAAMO_ZALRSC
> -  /* Skip since binutils 2.42 and earlier don't recognize zaamo/zalrsc.  */
> +  /* Skip since binutils 2.42 and earlier don't recognize zaamo/zalrsc.
> +     Expanding 'a' to zaamo/zalrsc would otherwise break compilations
> +     for users with an older version of binutils.  */
>    skip_zaamo_zalrsc = true;
>  #endif
> -#ifndef HAVE_AS_MARCH_ZABHA
> -  /* Skip since binutils 2.42 and earlier don't recognize zabha.  */
> -  skip_zabha = true;
> -#endif
>
>    for (subset = m_head; subset != NULL; subset = subset->next)
>      {
> @@ -908,9 +905,6 @@ riscv_subset_list::to_string (bool version_p) const
>        if (skip_zaamo_zalrsc && subset->name == "zalrsc")
>         continue;
>
> -      if (skip_zabha && subset->name == "zabha")
> -       continue;
> -
>        /* For !version_p, we only separate extension with underline for
>          multi-letter extension.  */
>        if (!first &&
> diff --git a/gcc/config.in b/gcc/config.in
> index bc819005bd6..3af153eaec5 100644
> --- a/gcc/config.in
> +++ b/gcc/config.in
> @@ -635,12 +635,6 @@
>  #endif
>
>
> -/* Define if the assembler understands -march=rv*_zabha. */
> -#ifndef USED_FOR_TARGET
> -#undef HAVE_AS_MARCH_ZABHA
> -#endif
> -
> -
>  /* Define if the assembler understands -march=rv*_zifencei. */
>  #ifndef USED_FOR_TARGET
>  #undef HAVE_AS_MARCH_ZIFENCEI
> diff --git a/gcc/configure b/gcc/configure
> index 01acca7fb5c..7541bdeb724 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -30882,37 +30882,6 @@ if test $gcc_cv_as_riscv_march_zaamo_zalrsc = yes; 
> then
>
>  $as_echo "#define HAVE_AS_MARCH_ZAAMO_ZALRSC 1" >>confdefs.h
>
> -fi
> -
> -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for 
> -march=rv32i_zabha support" >&5
> -$as_echo_n "checking assembler for -march=rv32i_zabha support... " >&6; }
> -if ${gcc_cv_as_riscv_march_zabha+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  gcc_cv_as_riscv_march_zabha=no
> -  if test x$gcc_cv_as != x; then
> -    $as_echo '' > conftest.s
> -    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -march=rv32i_zabha -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_riscv_march_zabha=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_riscv_march_zabha" >&5
> -$as_echo "$gcc_cv_as_riscv_march_zabha" >&6; }
> -if test $gcc_cv_as_riscv_march_zabha = yes; then
> -
> -$as_echo "#define HAVE_AS_MARCH_ZABHA 1" >>confdefs.h
> -
>  fi
>
>      ;;
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 3f20c107b6a..52c1780379d 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -5461,11 +5461,6 @@ configured with --enable-newlib-nano-formatted-io.])
>        [-march=rv32i_zaamo_zalrsc],,,
>        [AC_DEFINE(HAVE_AS_MARCH_ZAAMO_ZALRSC, 1,
>                  [Define if the assembler understands 
> -march=rv*_zaamo_zalrsc.])])
> -    gcc_GAS_CHECK_FEATURE([-march=rv32i_zabha support],
> -      gcc_cv_as_riscv_march_zabha,
> -      [-march=rv32i_zabha],,,
> -      [AC_DEFINE(HAVE_AS_MARCH_ZABHA, 1,
> -                [Define if the assembler understands -march=rv*_zabha.])])
>      ;;
>      loongarch*-*-*)
>      gcc_GAS_CHECK_FEATURE([.dtprelword support],
> --
> 2.34.1
>

Reply via email to