void emit_avltype_insn (unsigned, unsigned, rtx *, avl_type, rtx = nullptr);
void emit_vlmax_insn_lra (unsigned, unsigned, rtx *, rtx);
enum vlmul_type get_vlmul (machine_mode);
+bool is_frac_vlmul_p (machine_mode);
rtx get_vlmax_rtx (machine_mode);
unsigned int get_ratio (machine_mode);
unsigned int get_nf (machine_mode);
return mode_vtype_infos.vlmul[mode];
}
+bool
+is_frac_vlmul_p (machine_mode mode)
+{
+ switch (get_vlmul (mode))
+ {
+ case LMUL_1:
+ case LMUL_2:
+ case LMUL_4:
+ case LMUL_8:
+ return false;
+ case LMUL_F8:
+ case LMUL_F4:
+ case LMUL_F2:
+ return true;
+ default:
+ break;
+ }
+
+ gcc_unreachable ();
+}
+
/* Return the VLMAX rtx of vector mode MODE. */
rtx
get_vlmax_rtx (machine_mode mode)
unsigned int wide_nregs = riscv_hard_regno_nregs (wide_regno, wide_mode);
unsigned int nregs = riscv_hard_regno_nregs (regno, mode);
- if (wide_nregs == nregs) /* Source LMUL < 1. */
+ if (wide_nregs == nregs) /* Dest LMUL <= 1. */
{
gcc_checking_assert (nregs == 1);
if (regno + nregs <= wide_regno || wide_regno + wide_nregs <= regno)
return true;
+ if (is_frac_vlmul_p (mode)) /* Source LMUL < 1. */
+ return false;
+
unsigned int highest_num = wide_nregs - nregs;
return (regno % wide_nregs) == highest_num;
;; Vector Quad-Widening Sign-extend and Zero-extend.
(define_insn "@pred_<optab><mode>_vf4"
- [(set (match_operand:VQEXTI 0 "register_operand" "=&vr,&vr")
+ [(set (match_operand:VQEXTI 0 "register_operand" "=vr, vr, vd, vd")
(if_then_else:VQEXTI
(unspec:<VM>
- [(match_operand:<VM> 1 "vector_mask_operand" "vmWc1,vmWc1")
- (match_operand 4 "vector_length_operand" " rvl, rvl")
- (match_operand 5 "const_int_operand" " i, i")
- (match_operand 6 "const_int_operand" " i, i")
- (match_operand 7 "const_int_operand" " i, i")
+ [(match_operand:<VM> 1 "vector_mask_operand" "Wc1, Wc1, vm, vm")
+ (match_operand 4 "vector_length_operand" "rvl, rvl, rvl, rvl")
+ (match_operand 5 "const_int_operand" " i, i, i, i")
+ (match_operand 6 "const_int_operand" " i, i, i, i")
+ (match_operand 7 "const_int_operand" " i, i, i, i")
(reg:SI VL_REGNUM)
(reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)
(any_extend:VQEXTI
- (match_operand:<V_QUAD_TRUNC> 3 "register_operand" " vr, vr"))
- (match_operand:VQEXTI 2 "vector_merge_operand" " vu, 0")))]
+ (match_operand:<V_QUAD_TRUNC> 3 "register_operand" "Wvr, Wvr, Wvr, Wvr"))
+ (match_operand:VQEXTI 2 "vector_merge_operand" " vu, 0, vu, 0")))]
"TARGET_VECTOR && !TARGET_XTHEADVECTOR"
"v<sz>ext.vf4\t%0,%3%p1"
[(set_attr "type" "vext")