return false;
if (IS_VPR_REGNUM (regno))
- return mode == HImode
- || mode == V16BImode
- || mode == V8BImode
- || mode == V4BImode;
+ return VALID_MVE_PRED_MODE (mode);
if (TARGET_THUMB1)
/* For the Thumb we only allow values bigger than SImode in
if (GET_MODE_CLASS (mode1) == GET_MODE_CLASS (mode2))
return true;
+ if (TARGET_HAVE_MVE
+ && (VALID_MVE_PRED_MODE (mode1) && VALID_MVE_PRED_MODE (mode2)))
+ return true;
+
/* We specifically want to allow elements of "structure" modes to
be tieable to the structure. This more general condition allows
other rarer situations too. */
|| (MODE) == V16QImode || (MODE) == V8HFmode || (MODE) == V4SFmode \
|| (MODE) == V2DFmode)
+#define VALID_MVE_PRED_MODE(MODE) \
+ ((MODE) == HImode \
+ || (MODE) == V16BImode || (MODE) == V8BImode || (MODE) == V4BImode)
+
#define VALID_MVE_SI_MODE(MODE) \
((MODE) == V2DImode ||(MODE) == V4SImode || (MODE) == V8HImode \
|| (MODE) == V16QImode)
}
}
+ /* Try simplifying a SUBREG expression of a non-integer OUTERMODE by using a
+ NEW_OUTERMODE of the same size instead, other simplifications rely on
+ integer to integer subregs and we'd potentially miss out on optimizations
+ otherwise. */
+ if (known_gt (GET_MODE_SIZE (innermode),
+ GET_MODE_SIZE (outermode))
+ && SCALAR_INT_MODE_P (innermode)
+ && !SCALAR_INT_MODE_P (outermode)
+ && int_mode_for_size (GET_MODE_BITSIZE (outermode),
+ 0).exists (&int_outermode))
+ {
+ rtx tem = simplify_subreg (int_outermode, op, innermode, byte);
+ if (tem)
+ return simplify_gen_subreg (outermode, tem, GET_MODE (tem), 0);
+ }
+
/* If OP is a vector comparison and the subreg is not changing the
number of elements or the size of the elements, change the result
of the comparison to the new mode. */
** vldrb.8 q[0-9]+, \[r[0-9]+\]
** vldrb.8 q[0-9]+, \[r[0-9]+\]
** vcmp.i8 eq, q[0-9]+, q[0-9]+
-** vmrs (r[0-9]+), p0 @ movhi
-** uxth \1, \1
-** vmsr p0, \1 @ movhi
** vpst
** vaddt.i8 (q[0-9]+), q[0-9]+, q[0-9]+
** vpst
-** vstrbt.8 \2, \[r[0-9]+\]
+** vstrbt.8 \1, \[r[0-9]+\]
** bx lr
*/