RISC-V: Split arguments of expand_vec_perm
Checks
Commit Message
From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Since the following patch will calls expand_vec_perm with
splitted arguments, change the expand_vec_perm interface in
this patch.
gcc/ChangeLog:
* config/riscv/autovec.md: Split arguments.
* config/riscv/riscv-protos.h (expand_vec_perm): Ditto.
* config/riscv/riscv-v.cc (expand_vec_perm): Ditto.
---
gcc/config/riscv/autovec.md | 3 ++-
gcc/config/riscv/riscv-protos.h | 2 +-
gcc/config/riscv/riscv-v.cc | 6 +-----
3 files changed, 4 insertions(+), 7 deletions(-)
Comments
On 6/4/23 03:25, juzhe.zhong@rivai.ai wrote:
> From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
>
> Since the following patch will calls expand_vec_perm with
> splitted arguments, change the expand_vec_perm interface in
> this patch.
>
> gcc/ChangeLog:
>
> * config/riscv/autovec.md: Split arguments.
> * config/riscv/riscv-protos.h (expand_vec_perm): Ditto.
> * config/riscv/riscv-v.cc (expand_vec_perm): Ditto.
OK
jeff
Committed, thanks Jeff.
Pan
-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Jeff Law via Gcc-patches
Sent: Sunday, June 4, 2023 11:28 PM
To: juzhe.zhong@rivai.ai; gcc-patches@gcc.gnu.org
Cc: kito.cheng@sifive.com; palmer@rivosinc.com; rdapp.gcc@gmail.com
Subject: Re: [PATCH] RISC-V: Split arguments of expand_vec_perm
On 6/4/23 03:25, juzhe.zhong@rivai.ai wrote:
> From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
>
> Since the following patch will calls expand_vec_perm with splitted
> arguments, change the expand_vec_perm interface in this patch.
>
> gcc/ChangeLog:
>
> * config/riscv/autovec.md: Split arguments.
> * config/riscv/riscv-protos.h (expand_vec_perm): Ditto.
> * config/riscv/riscv-v.cc (expand_vec_perm): Ditto.
OK
jeff
@@ -96,7 +96,8 @@
(match_operand:<VINDEX> 3 "vector_perm_operand")]
"TARGET_VECTOR && GET_MODE_NUNITS (<MODE>mode).is_constant ()"
{
- riscv_vector::expand_vec_perm (operands);
+ riscv_vector::expand_vec_perm (operands[0], operands[1],
+ operands[2], operands[3]);
DONE;
}
)
@@ -241,7 +241,7 @@ opt_machine_mode get_mask_mode (machine_mode);
void expand_vec_series (rtx, rtx, rtx);
void expand_vec_init (rtx, rtx);
void expand_vcond (rtx *);
-void expand_vec_perm (rtx *);
+void expand_vec_perm (rtx, rtx, rtx, rtx);
/* Rounding mode bitfield for fixed point VXRM. */
enum vxrm_field_enum
{
@@ -2025,12 +2025,8 @@ expand_vcond (rtx *ops)
/* Implement vec_perm<mode>. */
void
-expand_vec_perm (rtx *operands)
+expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel)
{
- rtx target = operands[0];
- rtx op0 = operands[1];
- rtx op1 = operands[2];
- rtx sel = operands[3];
machine_mode data_mode = GET_MODE (target);
machine_mode sel_mode = GET_MODE (sel);