diff options
author | Pan Li <pan2.li@intel.com> | 2025-05-06 16:26:06 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2025-05-06 20:31:27 +0800 |
commit | 17c1602d5e7b237357b94808399a68ab77d42640 (patch) | |
tree | 2d34983765b0d151a458f84ad81dc2c4ca69b177 | |
parent | ac9fec014df8d75c2185981c9d191d1080e98094 (diff) | |
download | gcc-17c1602d5e7b237357b94808399a68ab77d42640.zip gcc-17c1602d5e7b237357b94808399a68ab77d42640.tar.gz gcc-17c1602d5e7b237357b94808399a68ab77d42640.tar.bz2 |
RISC-V: Add new option --param=gpr2vr-cost= for rvv insn
During investigate the combine from vec_dup and vop.vv into
vop.vx, we need to depend on the cost of the insn operate
from the gpr to vr, for example, vadd.vx. Thus, for better
control and test, we introduce a new option, aka below:
--param=gpr2vr-cost=<unsigned int>
To specific the cost value of the insn that operate from
the gpr to vr.
gcc/ChangeLog:
* config/riscv/riscv-opts.h (RVV_GR2VR_COST_UNPROVIDED): Add
new macro to indicate the param is not provided.
* config/riscv/riscv.opt: Add new option --pararm=gpr2vr-cost.
Signed-off-by: Pan Li <pan2.li@intel.com>
-rw-r--r-- | gcc/config/riscv/riscv-opts.h | 2 | ||||
-rw-r--r-- | gcc/config/riscv/riscv.opt | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/riscv/riscv-opts.h b/gcc/config/riscv/riscv-opts.h index 26fe228..9766b89 100644 --- a/gcc/config/riscv/riscv-opts.h +++ b/gcc/config/riscv/riscv-opts.h @@ -162,4 +162,6 @@ enum riscv_tls_type { #define TARGET_VECTOR_AUTOVEC_SEGMENT \ (TARGET_VECTOR && riscv_mautovec_segment) +#define GPR2VR_COST_UNPROVIDED -1 + #endif /* ! GCC_RISCV_OPTS_H */ diff --git a/gcc/config/riscv/riscv.opt b/gcc/config/riscv/riscv.opt index 7515c8e..7102480 100644 --- a/gcc/config/riscv/riscv.opt +++ b/gcc/config/riscv/riscv.opt @@ -579,6 +579,10 @@ Inline strlen calls if possible. Target RejectNegative Joined UInteger Var(riscv_strcmp_inline_limit) Init(64) Max number of bytes to compare as part of inlined strcmp/strncmp routines (default: 64). +-param=gpr2vr-cost= +Target RejectNegative Joined UInteger Var(gpr2vr_cost) Init(GPR2VR_COST_UNPROVIDED) +Set the cost value of the rvv instruction when operate from GPR to VR. + Enum Name(rvv_max_lmul) Type(enum rvv_max_lmul_enum) The RVV possible LMUL (-mrvv-max-lmul=): |