This allows immediate operands for load on condition.
gcc/ChangeLog:
2018-11-05 Robin Dapp <rdapp@linux.ibm.com>
* config/s390/predicates.md: Fix typo.
* config/s390/s390.md: Allow immediates for load on condition.
gcc/testsuite/ChangeLog:
2018-11-05 Robin Dapp <rdapp@linux.ibm.com>
* gcc.dg/loop-8.c: On s390, always run the test with -march=zEC12.
From-SVN: r265804
+2018-11-05 Robin Dapp <rdapp@linux.ibm.com>
+
+ * config/s390/predicates.md: Fix typo.
+ * config/s390/s390.md: Allow immediates for load on condition.
+
2018-11-05 Martin Liska <mliska@suse.cz>
* alloc-pool.h (struct pool_usage): Use SIZE_AMOUNT.
(INTVAL (op), false, GET_MODE_BITSIZE (mode), NULL, NULL);
})
-;; Return true if OP is ligitimate for any LOC instruction.
+;; Return true if OP is legitimate for any LOC instruction.
(define_predicate "loc_operand"
(ior (match_operand 0 "nonimmediate_operand")
(define_expand "mov<mode>cc"
[(set (match_operand:GPR 0 "nonimmediate_operand" "")
(if_then_else:GPR (match_operand 1 "comparison_operator" "")
- (match_operand:GPR 2 "nonimmediate_operand" "")
- (match_operand:GPR 3 "nonimmediate_operand" "")))]
+ (match_operand:GPR 2 "loc_operand" "")
+ (match_operand:GPR 3 "loc_operand" "")))]
"TARGET_Z196"
{
+ if (!TARGET_Z13 && CONSTANT_P (operands[2]))
+ operands[2] = force_reg (<MODE>mode, operands[2]);
+
+ if (!TARGET_Z13 && CONSTANT_P (operands[3]))
+ operands[3] = force_reg (<MODE>mode, operands[3]);
+
/* Emit the comparison insn in case we do not already have a comparison result. */
if (!s390_comparison (operands[1], VOIDmode))
operands[1] = s390_emit_compare (GET_CODE (operands[1]),
+2018-11-05 Robin Dapp <rdapp@linux.ibm.com>
+
+ * gcc.dg/loop-8.c: On s390, always run the test with -march=zEC12.
+
2018-11-05 Richard Biener <rguenther@suse.de>
* gcc.dg/pr41488.c: Scan ivcanon dump instead of sccp one.
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
/* { dg-skip-if "unexpected IV" { "hppa*-*-* mips*-*-* visium-*-* powerpc*-*-* riscv*-*-*" } } */
+/* Load immediate on condition is available from z13 on and prevents moving
+ the load out of the loop, so always run this test with -march=zEC12 that
+ does not have load immediate on condition. */
+/* { dg-additional-options "-march=zEC12" { target { s390*-*-* } } } */
void
f (int *a, int *b)