public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: dengjianbo <dengjianbo@loongson.cn>, libc-alpha@sourceware.org
Cc: adhemerval.zanella@linaro.org, caiyinyu@loongson.cn,
	xuchenghua@loongson.cn,  huangpei@loongson.cn
Subject: Re: [PATCH v3 2/3] LoongArch: Add minuimum binutils required version
Date: Mon, 07 Aug 2023 13:31:10 +0800	[thread overview]
Message-ID: <97225a65ac67656f7881f30df44c42d0e8829f95.camel@xry111.site> (raw)
In-Reply-To: <20230804095359.2384557-2-dengjianbo@loongson.cn>

On Fri, 2023-08-04 at 17:53 +0800, dengjianbo wrote:
> LoongArch glibc can add some LASX/LSX vector instructions codes,
> change the
> required minimum binutils version to 2.41 which could support vector
> instructions. HAVE_LOONGARCH_VEC_ASM is removed accordingly.

I guess we need a NEWS entry for this.

> ---
>  config.h.in                       | 5 -----
>  sysdeps/loongarch/configure       | 5 ++---
>  sysdeps/loongarch/configure.ac    | 4 ++--
>  sysdeps/loongarch/dl-machine.h    | 4 ++--
>  sysdeps/loongarch/dl-trampoline.S | 2 +-
>  5 files changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/config.h.in b/config.h.in
> index 0dedc124f7..44a34072a4 100644
> --- a/config.h.in
> +++ b/config.h.in
> @@ -141,11 +141,6 @@
>  /* LOONGARCH floating-point ABI for ld.so.  */
>  #undef LOONGARCH_ABI_FRLEN
>  
> -/* Assembler support LoongArch LASX/LSX vector instructions.
> -   This macro becomes obsolete when glibc increased the minimum
> -   required version of GNU 'binutils' to 2.41 or later. */
> -#define HAVE_LOONGARCH_VEC_ASM 0
> -
>  /* Linux specific: minimum supported kernel version.  */
>  #undef __LINUX_KERNEL_VERSION
>  
> diff --git a/sysdeps/loongarch/configure b/sysdeps/loongarch/configure
> index 5843c7cf90..395ddc92ca 100644
> --- a/sysdeps/loongarch/configure
> +++ b/sysdeps/loongarch/configure
> @@ -128,8 +128,7 @@ rm -f conftest*
>  fi
>  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
> $libc_cv_loongarch_vec_asm" >&5
>  printf "%s\n" "$libc_cv_loongarch_vec_asm" >&6; }
> -if test $libc_cv_loongarch_vec_asm = yes; then
> -  printf "%s\n" "#define HAVE_LOONGARCH_VEC_ASM 1" >>confdefs.h
> -
> +if test $libc_cv_loongarch_vec_asm = no; then
> +  as_fn_error $? "binutils version is too old, use 2.41 or newer
> version" "$LINENO" 5
>  fi
>  
> diff --git a/sysdeps/loongarch/configure.ac
> b/sysdeps/loongarch/configure.ac
> index ba89d8346d..989287c6d2 100644
> --- a/sysdeps/loongarch/configure.ac
> +++ b/sysdeps/loongarch/configure.ac
> @@ -74,6 +74,6 @@ else
>    libc_cv_loongarch_vec_asm=no
>  fi
>  rm -f conftest*])
> -if test $libc_cv_loongarch_vec_asm = yes; then
> -  AC_DEFINE(HAVE_LOONGARCH_VEC_ASM)
> +if test $libc_cv_loongarch_vec_asm = no; then
> +  AC_MSG_ERROR([binutils version is too old, use 2.41 or newer
> version])
>  fi
> diff --git a/sysdeps/loongarch/dl-machine.h b/sysdeps/loongarch/dl-
> machine.h
> index 51ce9af84b..066bb233ac 100644
> --- a/sysdeps/loongarch/dl-machine.h
> +++ b/sysdeps/loongarch/dl-machine.h
> @@ -270,7 +270,7 @@ elf_machine_runtime_setup (struct link_map *l,
> struct r_scope_elem *scope[],
>    /* If using PLTs, fill in the first two entries of .got.plt.  */
>    if (l->l_info[DT_JMPREL])
>      {
> -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float
> +#if !defined __loongarch_soft_float
>        extern void _dl_runtime_resolve_lasx (void) attribute_hidden;
>        extern void _dl_runtime_resolve_lsx (void) attribute_hidden;
>  #endif
> @@ -300,7 +300,7 @@ elf_machine_runtime_setup (struct link_map *l,
> struct r_scope_elem *scope[],
>           /* This function will get called to fix up the GOT entry
>              indicated by the offset on the stack, and then jump to
>              the resolved address.  */
> -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float
> +#if !defined __loongarch_soft_float
>           if (SUPPORT_LASX)
>             gotplt[0] = (ElfW(Addr)) &_dl_runtime_resolve_lasx;
>           else if (SUPPORT_LSX)
> diff --git a/sysdeps/loongarch/dl-trampoline.S b/sysdeps/loongarch/dl-
> trampoline.S
> index f6ba5e443c..8fd9146978 100644
> --- a/sysdeps/loongarch/dl-trampoline.S
> +++ b/sysdeps/loongarch/dl-trampoline.S
> @@ -19,7 +19,7 @@
>  #include <sysdep.h>
>  #include <sys/asm.h>
>  
> -#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float
> +#if !defined __loongarch_soft_float
>  #define USE_LASX
>  #define _dl_runtime_resolve _dl_runtime_resolve_lasx
>  #include "dl-trampoline.h"

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2023-08-07  5:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04  9:53 [PATCH v3 1/3] LoongArch: Redefine macro LEAF/ENTRY dengjianbo
2023-08-04  9:53 ` [PATCH v3 2/3] LoongArch: Add minuimum binutils required version dengjianbo
2023-08-07  5:31   ` Xi Ruoyao [this message]
2023-08-08  6:27     ` dengjianbo
2023-08-04  9:53 ` [PATCH v3 3/3] Loongarch: Add ifunc support and add different versions of strlen dengjianbo
2023-08-07  1:04   ` caiyinyu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97225a65ac67656f7881f30df44c42d0e8829f95.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=adhemerval.zanella@linaro.org \
    --cc=caiyinyu@loongson.cn \
    --cc=dengjianbo@loongson.cn \
    --cc=huangpei@loongson.cn \
    --cc=libc-alpha@sourceware.org \
    --cc=xuchenghua@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).