The vector shift immediates happen to have the same constraints as some
of the CSR-related operands, but it's a different usage. This adds a
name for them, so I don't get confused again next time.
gcc/ChangeLog:
* config/riscv/autovec.md (shifts): Use
vector_scalar_shift_operand.
* config/riscv/predicates.md (vector_scalar_shift_operand): New
predicate.
;; -------------------------------------------------------------------------
(define_insn_and_split "<optab><mode>3"
- [(set (match_operand:V_VLSI 0 "register_operand" "=vr")
+ [(set (match_operand:V_VLSI 0 "register_operand" "=vr")
(any_shift:V_VLSI
- (match_operand:V_VLSI 1 "register_operand" " vr")
- (match_operand:<VEL> 2 "csr_operand" " rK")))]
+ (match_operand:V_VLSI 1 "register_operand" " vr")
+ (match_operand:<VEL> 2 "vector_scalar_shift_operand" " rK")))]
"TARGET_VECTOR && can_create_pseudo_p ()"
"#"
"&& 1"
(ior (match_operand 0 "const_csr_operand")
(match_operand 0 "register_operand")))
+;; V has 32-bit unsigned immediates. This happens to be the same constraint as
+;; the csr_operand, but it's not CSR related.
+(define_predicate "vector_scalar_shift_operand"
+ (match_operand 0 "csr_operand"))
+
(define_predicate "sle_operand"
(and (match_code "const_int")
(match_test "SMALL_OPERAND (INTVAL (op) + 1)")))