return mips_build_integer (codes, INTVAL (x));
case CONST_VECTOR:
- if (ISA_HAS_MSA
+ if (MSA_SUPPORTED_MODE_P (GET_MODE (x))
&& mips_const_vector_same_int_p (x, GET_MODE (x), -512, 511))
return 1;
/* Fall through. */
rtx (*cmpFunc) (rtx, rtx, rtx);
rtx tmp, dest, zero;
- if (ISA_HAS_MSA)
+ if (MSA_SUPPORTED_MODE_P (imode))
{
switch (imode)
{
all_same = false;
}
- if (ISA_HAS_MSA)
+ if (MSA_SUPPORTED_MODE_P (vmode))
{
if (all_same)
{
--- /dev/null
+/* PR target/100760
+ This was triggering an ICE with "maximum number of generated reload
+ insns per insn achieved (90)" when compiled with -mmsa -mloongson-mmi. */
+
+/* { dg-do compile } */
+/* { dg-options "-mmsa -mloongson-mmi" } */
+
+typedef __INT32_TYPE__ int32_t;
+typedef int32_t a __attribute__((__vector_size__(8)));
+void b() { a x = (a){1, 1}; }
--- /dev/null
+/* PR target/100761
+ This was triggering an ICE in mips_expand_vec_unpack when compiled with
+ -mmsa -mloongson-mmi. */
+
+/* { dg-do compile } */
+/* { dg-options "-mmsa -mloongson-mmi" } */
+
+typedef __INT8_TYPE__ int8_t;
+typedef __INT16_TYPE__ int16_t;
+typedef int8_t i8x8 __attribute__((__vector_size__(8)));
+typedef int16_t i16x8 __attribute__((__vector_size__(16)));
+
+i8x8 a;
+
+void f() {
+ i16x8 b = __builtin_convertvector (a, i16x8);
+}
--- /dev/null
+/* PR target/100762
+ This was triggering an ICE in mips_expand_vector_init when compiled with
+ -mmsa -mloongson-mmi. */
+
+/* { dg-do compile } */
+/* { dg-options "-mmsa -mloongson-mmi" } */
+
+typedef __INT32_TYPE__ int32_t;
+typedef int32_t i32x2 __attribute__((__vector_size__(8)));
+
+i32x2 cmp(i32x2 a, i32x2 b) {
+ return a >= b;
+}
+
+i32x2 shift(i32x2 a, i32x2 b) {
+ return a >> b;
+}
+
+i32x2 mul(i32x2 a, i32x2 b) {
+ return a * b;
+}
+
+i32x2 div(i32x2 a, i32x2 b) {
+ return a / b;
+}