> +/* Return true it is whole register-register move.  */
> +bool
> +whole_reg_to_reg_move_p (rtx *ops, machine_mode mode)
> +{
> +  if (register_operand (ops[0], mode)
> +      && register_operand (ops[3], mode)
> +      && satisfies_constraint_vu (ops[2])
> +      && satisfies_constraint_Wc1 (ops[1]))
> +    {
> +      int vlmax_index = GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL ? 5 : 7;
> +      if (INTVAL (ops[vlmax_index]) == VLMAX)
> +     return true;

Is that indent correct?  Looks odd on my screen but I didn't verify.

> +      /* AVL propagation PASS will transform FIXED-VLMAX with NUNITS < 32
> +      into NON-VLMAX with LEN = NUNITS.  */
> +      else if (CONST_INT_P (ops[4])
> +            && known_eq (INTVAL (ops[4]), GET_MODE_NUNITS (mode)))
> +     return true;
> +    }
> +  return false;
> +}

I would prefer having the vlmax_index as a parameter.  Even though
it's clear that a mask set operation has two operands less I don't
find it particularly intuitive to check that in the function.

Also explain both cases in the function-level comment and mention
the preconditions for calling the function.  Something like:
 "An operation is a whole-register move if either
   (1) Its vlmax operand equals VLMAX
   (2) Its vl operand equals the number of units of its mode."

Maybe some more asserts or checks wouldn't hurt either so the function
can't accidentally be called on other operations than vlde/vste/vimov.

Regards
 Robin

Reply via email to