[v7,1/2] RISC-V: check rvv support in asm at sysdeps/riscv
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Test passed
|
Commit Message
From: daichengrong <daichengrong@iscas.ac.cn>
Changes in v7:
update asm rvv support check with option,+v
Changes in v5:
update riscv vector support check in assembler
update vector support macro to HAVE_RISCV_ASM_VECTOR_SUPPORT
---
config.h.in | 3 +++
sysdeps/riscv/configure | 35 +++++++++++++++++++++++++++++++++++
sysdeps/riscv/configure.ac | 25 +++++++++++++++++++++++++
3 files changed, 63 insertions(+)
mode change 100644 => 100755 sysdeps/riscv/configure
@@ -139,6 +139,9 @@
/* RISC-V floating-point ABI for ld.so. */
#undef RISCV_ABI_FLEN
+/* Define if assembler supports vector instructions on RISC-V. */
+#undef HAVE_RISCV_ASM_VECTOR_SUPPORT
+
/* LOONGARCH integer ABI for ld.so. */
#undef LOONGARCH_ABI_GRLEN
old mode 100644
new mode 100755
@@ -83,3 +83,38 @@ if test "$libc_cv_static_pie_on_riscv" = yes; then
fi
+# Check if assembler supports attribute riscv vector macro.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc attribute riscv vector support" >&5
+printf %s "checking for gcc attribute riscv vector support... " >&6; }
+if test ${libc_cv_gcc_rvv+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat > conftest.S <<EOF
+foo:
+ .option push
+ .option arch, +v
+ vsetivli t0, 8, e8, m8, ta, ma
+ .option pop
+ ret
+EOF
+libc_cv_gcc_rvv=no
+if ${CC-asm} -c conftest.S -o conftest.o 1>&5 \
+ 2>&5 ; then
+ libc_cv_gcc_rvv=yes
+fi
+rm -f conftest* ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_rvv" >&5
+printf "%s\n" "$libc_cv_gcc_rvv" >&6; }
+
+if test x"$libc_cv_gcc_rvv" = xyes; then
+ printf "%s\n" "#define HAVE_RISCV_ASM_VECTOR_SUPPORT 1" >>confdefs.h
+
+fi
+
+config_vars="$config_vars
+have-gcc-riscv-rvv = $libc_cv_gcc_rvv"
+
+
@@ -43,3 +43,28 @@ EOF
if test "$libc_cv_static_pie_on_riscv" = yes; then
AC_DEFINE(SUPPORT_STATIC_PIE)
fi
+
+# Check if assembler supports attribute riscv vector macro.
+AC_CACHE_CHECK([for gcc attribute riscv vector support],
+ libc_cv_gcc_rvv, [dnl
+cat > conftest.S <<EOF
+foo:
+ .option push
+ .option arch, +v
+ vsetivli t0, 8, e8, m8, ta, ma
+ .option pop
+ ret
+EOF
+libc_cv_gcc_rvv=no
+if ${CC-asm} -c conftest.S -o conftest.o 1>&AS_MESSAGE_LOG_FD \
+ 2>&AS_MESSAGE_LOG_FD ; then
+ libc_cv_gcc_rvv=yes
+fi
+rm -f conftest*])
+
+if test x"$libc_cv_gcc_rvv" = xyes; then
+ AC_DEFINE(HAVE_RISCV_ASM_VECTOR_SUPPORT)
+fi
+
+LIBC_CONFIG_VAR([have-gcc-riscv-rvv], [$libc_cv_gcc_rvv])
+