On 2/22/23 21:50, Michael Collison wrote:
Hi Jeff,

We do not have two independent implementations: my work is 100% based on the vector intrinsic foundation in upstream GCC.
Phew!  That's good news.  I totally misunderstood.


In fact I have only added two core patterns, vector add and subtract, that are based on the existing vector intrinsics implementation:

(define_expand "add<mode>3"
   [(match_operand:VI 0 "register_operand")
    (match_operand:VI 1 "register_operand")
    (match_operand:VI 2 "vector_arith_operand")]
   "TARGET_VECTOR"
{
   using namespace riscv_vector;

  rtx merge = gen_rtx_UNSPEC (<MODE>mode, gen_rtvec (1, const0_rtx), UNSPEC_VUNDEF);
   rtx vl = emit_vlmax_vsetvl (<MODE>mode);
   rtx mask_policy = get_mask_policy_no_pred();
   rtx tail_policy = get_tail_policy_no_pred();
   rtx mask = CONSTM1_RTX(<VM>mode);
   rtx vlmax_avl_p = get_avl_type_rtx(NONVLMAX);

  emit_insn(gen_pred_add<mode>(operands[0], mask, merge, operands[1], operands[2],
                 vl, tail_policy, mask_policy, vlmax_avl_p));

   DONE;
})

This pattern leverages the existing vector intrinsics framework. The bulk of the changes are the cost model, and target macros. The cost model is based on Juzhe's work.
Understood.


The point I am making is the auto-vectorization work is no more experimental than the intrinsics work which is still being merged.
I would disagree, though I do see your point. It's unfortunate that intrinsics work is still being merged -- I certainly wish that were not the case, but having agreed to the compromise earlier I personally feel that I need to let that process play out per that agreement.

--

What I'd been planning to do internally at Ventana was to update our codebase to gcc-13 once it's released. Then I'd backport RVV autovec work from the gcc-14 dev tree into that Ventana branch.

Instead, but along the same lines, we could have a public gcc-13 based branch which follows that same process and where Rivos, SiFive, Rivai, Ventana (and potentially others with an interest in this space) could collaborate. Essentially it'd be gcc-13 + RVV autovec support. We'd probably have to hash out a bit of policy with the shared branch, but I'd like to think we could make it work.


Thoughts?

jeff

Reply via email to