RISC-V: Add vectorized binops and insn_expander helpers.
commitb75c9e10379481b1b1e9dfdcc6aa81c9ba58cb1a
authorRobin Dapp <rdapp@ventanamicro.com>
Mon, 24 Apr 2023 06:27:52 +0000 (24 08:27 +0200)
committerRobin Dapp <rdapp@ventanamicro.com>
Thu, 11 May 2023 12:23:26 +0000 (11 14:23 +0200)
tree855691579e37a3a48cc41b8d9b1dcca3dc860c2f
parentaf595613acbd9863198ae69c7b1c9e856bca9e4f
RISC-V: Add vectorized binops and insn_expander helpers.

This patch adds basic binary integer operations support.  It is based
on Michael Collison's work and makes use of the existing helpers in
riscv-c.cc.  It introduces emit_nonvlmax_binop which, in turn, uses
emit_pred_binop.  Setting the destination as well as the mask and the
length are factored out into separate functions.

gcc/ChangeLog:

* config/riscv/autovec.md (<optab><mode>3): Add integer binops.
* config/riscv/riscv-protos.h (emit_nonvlmax_binop): Declare.
* config/riscv/riscv-v.cc (emit_pred_op): New function.
(set_expander_dest_and_mask): New function.
(emit_pred_binop): New function.
(emit_nonvlmax_binop): New function.

Co-authored-by: Michael Collison <collison@rivosinc.com>
gcc/config/riscv/autovec.md
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv-v.cc