Thanks Kito for comments, rebase the upstream and always goes to GPR in V2.
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/644291.html Pan -----Original Message----- From: Kito Cheng <kito.ch...@gmail.com> Sent: Monday, January 29, 2024 9:23 PM To: Li, Pan2 <pan2...@intel.com> Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; Wang, Yanzhang <yanzhang.w...@intel.com> Subject: Re: [PATCH v1] RISC-V: Bugfix for vls integer mode calling convention > @@ -4868,6 +4968,63 @@ riscv_pass_fpr_pair (machine_mode mode, unsigned > regno1, > GEN_INT (offset2)))); > } > > +static rtx > +riscv_pass_vls_aggregate_in_gpr_or_fpr (struct riscv_arg_info *info, > + machine_mode mode, unsigned gpr_base, > + unsigned fpr_base) Tried a few more clang and GCC code gen and I found VLS vector is always passed in GPR, and never passed in FPR, so I think I should update psABI rather than fix that on GCC side. > @@ -4997,9 +5170,7 @@ riscv_get_arg_info (struct riscv_arg_info *info, const > CUMULATIVE_ARGS *cum, > info->gpr_offset = cum->num_gprs; > info->fpr_offset = cum->num_fprs; > > - /* When disable vector_abi or scalable vector argument is anonymous, this > - argument is passed by reference. */ > - if (riscv_v_ext_mode_p (mode) && (!riscv_vector_abi || !named)) > + if (riscv_mode_pass_by_reference_p (mode, named)) Keep as it is fine since riscv_vector_abi is gone. > return NULL_RTX; > > if (named)