diff options
author | caiyinyu <caiyinyu@loongson.cn> | 2023-07-06 16:30:52 +0800 |
---|---|---|
committer | caiyinyu <caiyinyu@loongson.cn> | 2023-07-11 10:56:01 +0800 |
commit | 0d341d09f27fdc48a0e65242f3701ba8ea980b37 (patch) | |
tree | c89c6e11a2113b10a302c840b15f8b3d4bc9f7dc /sysdeps/loongarch/configure.ac | |
parent | 19f9f7f9d5064ad6608e6d40a3aa1b3db8a4a1ae (diff) | |
download | glibc-0d341d09f27fdc48a0e65242f3701ba8ea980b37.tar glibc-0d341d09f27fdc48a0e65242f3701ba8ea980b37.tar.gz glibc-0d341d09f27fdc48a0e65242f3701ba8ea980b37.tar.bz2 glibc-0d341d09f27fdc48a0e65242f3701ba8ea980b37.zip |
LoongArch: config: Added HAVE_LOONGARCH_VEC_ASM.
This patch checks if assembler supports vector instructions to
generate LASX/LSX code or not, and then define HAVE_LOONGARCH_VEC_ASM macro
We have added support for vector instructions in binutils-2.41
See:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=75b2f521b101d974354f6ce9ed7c054d8b2e3b7a
commit 75b2f521b101d974354f6ce9ed7c054d8b2e3b7a
Author: mengqinggang <mengqinggang@loongson.cn>
Date: Thu Jun 22 10:35:28 2023 +0800
LoongArch: gas: Add lsx and lasx instructions support
gas/ChangeLog:
* config/tc-loongarch.c (md_parse_option): Add lsx and lasx option.
(loongarch_after_parse_args): Add lsx and lasx option.
opcodes/ChangeLog:
* loongarch-opc.c (struct loongarch_ase): Add lsx and lasx
instructions.
Diffstat (limited to 'sysdeps/loongarch/configure.ac')
-rw-r--r-- | sysdeps/loongarch/configure.ac | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sysdeps/loongarch/configure.ac b/sysdeps/loongarch/configure.ac index cdd95fa512..39efccfd8f 100644 --- a/sysdeps/loongarch/configure.ac +++ b/sysdeps/loongarch/configure.ac @@ -62,3 +62,18 @@ AC_CACHE_CHECK(whether $CC supports option -mcmodel=medium, libc_cv_loongarch_cmodel_medium=no fi]) LIBC_CONFIG_VAR([have-cmodel-medium], [$libc_cv_loongarch_cmodel_medium]) + +# Check if asm support vector instructions. +AC_CACHE_CHECK(for vector support in assembler, libc_cv_loongarch_vec_asm, [dnl +cat > conftest.s <<\EOF + vld $vr0, $sp, 0 +EOF +if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s -o conftest 1>&AS_MESSAGE_LOG_FD); then + libc_cv_loongarch_vec_asm=yes +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) +fi |