在 2025/5/23 下午7:07, Xi Ruoyao 写道:
On Fri, 2025-03-07 at 14:14 +0800, Lulu Cheng wrote:
By default, vectorization is not enabled on LoongArch,
resulting in the failure of these two test cases.
Hmm, but wouldn't every test in the vect/ directory automatically get -
mlsx (from DEFAULT_VECTCFLAGS in lib/target-supports.exp)?
This is indeed the case. The reason for the error is that the default
options are
overwritten by using 'dg-options' in these two test cases.
gcc/testsuite/ChangeLog:
* gcc.dg/vect/pr112325.c: Add the vector compilation
option '-mlsx' for LoongArch.
* gcc.dg/vect/pr117888-1.c: Likewise.
---
gcc/testsuite/gcc.dg/vect/pr112325.c | 1 +
gcc/testsuite/gcc.dg/vect/pr117888-1.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/vect/pr112325.c
b/gcc/testsuite/gcc.dg/vect/pr112325.c
index 143903beab2..8689fbfe092 100644
--- a/gcc/testsuite/gcc.dg/vect/pr112325.c
+++ b/gcc/testsuite/gcc.dg/vect/pr112325.c
@@ -4,6 +4,7 @@
/* { dg-require-effective-target vect_shift } */
/* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } }
*/
/* { dg-additional-options "--param max-completely-peeled-insns=200"
{ target powerpc64*-*-* } } */
+/* { dg-additional-options "-mlsx" { target loongarch64-*-* } } */
typedef unsigned short ggml_fp16_t;
static float table_f32_f16[1 << 16];
diff --git a/gcc/testsuite/gcc.dg/vect/pr117888-1.c
b/gcc/testsuite/gcc.dg/vect/pr117888-1.c
index 4796a7c83c1..0b31fcdc423 100644
--- a/gcc/testsuite/gcc.dg/vect/pr117888-1.c
+++ b/gcc/testsuite/gcc.dg/vect/pr117888-1.c
@@ -4,6 +4,7 @@
/* { dg-require-effective-target vect_shift } */
/* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } }
*/
/* { dg-additional-options "--param max-completely-peeled-insns=200"
{ target powerpc64*-*-* } } */
+/* { dg-additional-options "-mlsx" { target loongarch64-*-* } } */
typedef unsigned short ggml_fp16_t;
static float table_f32_f16[1 << 16];