Re: Re: [PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization

2023-06-21 Thread 钟居哲
plementation is more reasonable, I will send a separate patch to adjust integer ternary autovec patterns. juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-06-21 23:32 To: 钟居哲; gcc-patches CC: kito.cheng; kito.cheng; palmer; palmer; rdapp.gcc Subject: Re: [PATCH] RISC-V: Support RVV floating-

Re: [PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization

2023-06-21 Thread Jeff Law via Gcc-patches
On 6/21/23 09:28, 钟居哲 wrote: I have tried: (define_expand "fms4"   [(parallel     [(set (match_operand:VF_AUTO 0 "register_operand")     (fma:VF_AUTO       (match_operand:VF_AUTO 1 "register_operand")       (match_operand:VF_AUTO 2 "register_operand")       (neg:VF_AUTO         (match_o

Re: Re: [PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization

2023-06-21 Thread 钟居哲
rtx ops[] = {operands[0], operands[1], operands[2], operands[3], operands[0]}; riscv_vector::emit_vlmax_fp_ternary_insn (code_for_pred_mul (MINUS, mode), riscv_vector::RVV_TERNOP, ops, operands[4]); DONE; } [(set_attr "type" "vfmuladd") (set_

Re: [PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization

2023-06-21 Thread Jeff Law via Gcc-patches
On 6/21/23 09:20, 钟居哲 wrote: I failed to make Pmode of the of operand. I have tried the following clobber (match_dup_4) But it causes to many issues. I do many tries turns out only the current solution can work. Can you describe more concretely what failed? Offhand I can't think of a reas

Re: Re: [PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization

2023-06-21 Thread 钟居哲
; kito.cheng; palmer; palmer; rdapp.gcc Subject: Re: [PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization On 6/21/23 05:12, Juzhe-Zhong wrote: > This patch adds RVV floating-point auto-vectorization. > Also, fix attribute bug of floating-point ternary operations in vec

Re: [PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization

2023-06-21 Thread Jeff Law via Gcc-patches
On 6/21/23 05:12, Juzhe-Zhong wrote: This patch adds RVV floating-point auto-vectorization. Also, fix attribute bug of floating-point ternary operations in vector.md. gcc/ChangeLog: * config/riscv/autovec.md (fma4): New pattern. (*fma): Ditto. (fnma4): Ditto.

Re: [PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization

2023-06-21 Thread Robin Dapp via Gcc-patches
Hi Juzhe, LGTM apart from a tiny nit: > + /* We have a maximum of 11 operands for RVV instruction patterns according > to > + * vector.md. */ > + insn_expander<11> e (/*OP_NUM*/ op_num, /*HAS_DEST_P*/ true, Seems like you copied this from the non-fp ternary part but the rest of the file us

[PATCH] RISC-V: Support RVV floating-point ternary auto-vectorization

2023-06-21 Thread Juzhe-Zhong
This patch adds RVV floating-point auto-vectorization. Also, fix attribute bug of floating-point ternary operations in vector.md. gcc/ChangeLog: * config/riscv/autovec.md (fma4): New pattern. (*fma): Ditto. (fnma4): Ditto. (*fnma): Ditto. (fms4): Ditto.