在 2025/2/7 下午8:09, Xi Ruoyao 写道:
These pattern definitions are tediously long, invoking 32 UNSPECs and
many hard-coded long const vectors. To simplify them, at first we use
the TImode vector operations instead of the UNSPECs, then we adopt an
approach in AArch64: using a special predicate to match the const
vectors for odd/even indices for define_insn's, and generate those
vectors in define_expand's.
For "backward compatibilty" we need to provide a "punned" version for
the operations invoking TImode vectors as the intrinsics still expect
DImode vectors.
The stat is "201 insertions, 905 deletions."
/* snip */
diff --git a/gcc/config/loongarch/loongarch-modes.def
b/gcc/config/loongarch/loongarch-modes.def
index e632f03636b..07cc29fceee 100644
--- a/gcc/config/loongarch/loongarch-modes.def
+++ b/gcc/config/loongarch/loongarch-modes.def
@@ -32,6 +32,7 @@ VECTOR_MODES (FLOAT, 8); /* V4HF V2SF */
/* For LARCH LSX 128 bits. */
VECTOR_MODES (INT, 16); /* V16QI V8HI V4SI V2DI */
VECTOR_MODES (FLOAT, 16); /* V4SF V2DF */
+VECTOR_MODE (INT, TI, 1); /* V1TI */
/* For LARCH LASX 256 bits. */
VECTOR_MODES (INT, 32); /* V32QI V16HI V8SI V4DI */
/* For LARCH LASX 256 bits. */
- VECTOR_MODES (INT, 32); /* V32QI V16HI V8SI V4DI */
+ VECTOR_MODES (INT, 32); /* V32QI V16HI V8SI V4DI V2TI */
Could you mark V2TI in v2?:-)
@@ -49,6 +50,7 @@ VECTOR_MODE (INT, QI, 64); /* V64QI */
VECTOR_MODE (INT, HI, 32); /* V32HI */
VECTOR_MODE (INT, SI, 16); /* V16SI */
VECTOR_MODE (INT, DI, 8); /* V8DI */
+VECTOR_MODE (INT, TI, 4); /* V4TI */
VECTOR_MODE (FLOAT, SF, 16); /* V16SF */
VECTOR_MODE (FLOAT, DF, 8); /* V8DF */