+2019-07-08 Robin Dapp <rdapp@linux.ibm.com>
+
+ * config/s390/s390.c (s390_shift_truncation_mask): Define.
+ (TARGET_SHIFT_TRUNCATION_MASK): Define.
+
2019-07-08 Robin Dapp <rdapp@linux.ibm.com>
* config/s390/constraints.md: Add new jsc constraint.
add_dependence (r11_restore, r15_restore, REG_DEP_ANTI);
}
+/* Implement TARGET_SHIFT_TRUNCATION_MASK for integer shifts. */
+static unsigned HOST_WIDE_INT
+s390_shift_truncation_mask (machine_mode mode)
+{
+ return mode == DImode || mode == SImode ? 63 : 0;
+}
/* Initialize GCC target structure. */
#define TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK \
s390_sched_dependencies_evaluation
+#undef TARGET_SHIFT_TRUNCATION_MASK
+#define TARGET_SHIFT_TRUNCATION_MASK s390_shift_truncation_mask
/* Use only short displacement, since long displacement is not available for
the floating point instructions. */
+2019-07-08 Robin Dapp <rdapp@linux.ibm.com>
+
+ * gcc.target/s390/rotate-truncation-mask.c: New test.
+
2019-07-08 Robin Dapp <rdapp@linux.ibm.com>
* gcc.target/s390/combine-rotate-modulo.c: New test.
--- /dev/null
+/* Check that we do not use (64 - sh) for rotating. */
+
+/* { dg-options "-O1 -m64" } */
+
+/* { dg-final { scan-assembler "lcr\t%r.+,%r.+" } } */
+/* { dg-final { scan-assembler-not "lhi\t%r.+,64" } } */
+/* { dg-final { scan-assembler-not "sr\t%r.+,%r.+" } } */
+unsigned long rotr (unsigned long in, unsigned long sh)
+{
+ return (in >> sh) | (in << (64 - sh));
+}