summaryrefslogtreecommitdiff
path: root/gcc/config/s390/predicates.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/s390/predicates.md')
-rw-r--r--gcc/config/s390/predicates.md18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/config/s390/predicates.md b/gcc/config/s390/predicates.md
index 4d3fd97a1e2..eeaf1aef9f8 100644
--- a/gcc/config/s390/predicates.md
+++ b/gcc/config/s390/predicates.md
@@ -24,16 +24,20 @@
;; operands --------------------------------------------------------------
-;; Return true if OP a (const_int 0) operand.
-
+;; Return true if OP a const 0 operand (int/float/vector).
(define_predicate "const0_operand"
- (and (match_code "const_int, const_double")
+ (and (match_code "const_int,const_double,const_vector")
(match_test "op == CONST0_RTX (mode)")))
+;; Return true if OP an all ones operand (int/float/vector).
+(define_predicate "constm1_operand"
+ (and (match_code "const_int, const_double,const_vector")
+ (match_test "op == CONSTM1_RTX (mode)")))
+
;; Return true if OP is constant.
(define_special_predicate "consttable_operand"
- (and (match_code "symbol_ref, label_ref, const, const_int, const_double")
+ (and (match_code "symbol_ref, label_ref, const, const_int, const_double, const_vector")
(match_test "CONSTANT_P (op)")))
;; Return true if OP is a valid S-type operand.
@@ -75,7 +79,7 @@
(and (match_test "mode == Pmode")
(match_test "!legitimate_la_operand_p (op)"))))
-;; Return true if OP is a valid operand as shift count or setmem.
+;; Return true if OP is a valid operand as scalar shift count or setmem.
(define_predicate "shift_count_or_setmem_operand"
(match_code "reg, subreg, plus, const_int")
@@ -83,6 +87,10 @@
HOST_WIDE_INT offset;
rtx base;
+ if (GET_MODE (op) != VOIDmode
+ && GET_MODE_CLASS (GET_MODE (op)) != MODE_INT)
+ return false;
+
/* Extract base register and offset. */
if (!s390_decompose_shift_count (op, &base, &offset))
return false;