From: Philipp Tomsich <ptoms...@ventanamicro.com> The Ventana-VT1 core is compatible with rv64gc and Zb[abcs]. This introduces a placeholder -mcpu=ventana-vt1, so tooling and scripts don't need to change once full support (pipeline, tuning, etc.) will become public later.
gcc/ChangeLog: * config/riscv/riscv-cores.def (RISCV_CORE): Add ventana-vt1. * config/riscv/riscv-opts.h (enum riscv_microarchitecture_type): Add ventana_vt1. * config/riscv/riscv.c: Add tune-info for ventana-vt1. * config/riscv/riscv.md (tune): Add ventana_vt1. * doc/invoke.texi: Add ventana-vt1. Signed-off-by: Philipp Tomsich <philipp.toms...@vrull.eu> --- gcc/config/riscv/riscv-cores.def | 2 ++ gcc/config/riscv/riscv-opts.h | 3 ++- gcc/config/riscv/riscv.c | 14 ++++++++++++++ gcc/config/riscv/riscv.md | 2 +- gcc/doc/invoke.texi | 4 ++-- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/gcc/config/riscv/riscv-cores.def b/gcc/config/riscv/riscv-cores.def index bf5aaba49c3..f6f225d3c5f 100644 --- a/gcc/config/riscv/riscv-cores.def +++ b/gcc/config/riscv/riscv-cores.def @@ -46,4 +46,6 @@ RISCV_CORE("sifive-s76", "rv64imafdc", "sifive-7-series") RISCV_CORE("sifive-u54", "rv64imafdc", "sifive-5-series") RISCV_CORE("sifive-u74", "rv64imafdc", "sifive-7-series") +RISCV_CORE("ventana-vt1", "rv64imafdc_zba_zbb_zbc_zbs", "ventana-vt1") + #undef RISCV_CORE diff --git a/gcc/config/riscv/riscv-opts.h b/gcc/config/riscv/riscv-opts.h index 2efc4b80f1f..32d6a9db1bd 100644 --- a/gcc/config/riscv/riscv-opts.h +++ b/gcc/config/riscv/riscv-opts.h @@ -52,7 +52,8 @@ extern enum riscv_isa_spec_class riscv_isa_spec; /* Keep this list in sync with define_attr "tune" in riscv.md. */ enum riscv_microarchitecture_type { generic, - sifive_7 + sifive_7, + ventana_vt1 }; extern enum riscv_microarchitecture_type riscv_microarchitecture; diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index df66abeb6ce..6b918db65e9 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -330,6 +330,19 @@ static const struct riscv_tune_param optimize_size_tune_info = { false, /* slow_unaligned_access */ }; +/* Costs to use when optimizing for Ventana Micro VT1. */ +static const struct riscv_tune_param ventana_vt1_tune_info = { + {COSTS_N_INSNS (4), COSTS_N_INSNS (5)}, /* fp_add */ + {COSTS_N_INSNS (4), COSTS_N_INSNS (5)}, /* fp_mul */ + {COSTS_N_INSNS (20), COSTS_N_INSNS (20)}, /* fp_div */ + {COSTS_N_INSNS (4), COSTS_N_INSNS (4)}, /* int_mul */ + {COSTS_N_INSNS (6), COSTS_N_INSNS (6)}, /* int_div */ + 4, /* issue_rate */ + 4, /* branch_cost */ + 5, /* memory_cost */ + false, /* slow_unaligned_access */ +}; + static tree riscv_handle_fndecl_attribute (tree *, tree, tree, int, bool *); static tree riscv_handle_type_attribute (tree *, tree, tree, int, bool *); @@ -366,6 +379,7 @@ static const struct riscv_tune_info riscv_tune_info_table[] = { { "sifive-5-series", generic, &rocket_tune_info }, { "sifive-7-series", sifive_7, &sifive_7_tune_info }, { "thead-c906", generic, &thead_c906_tune_info }, + { "ventana-vt1", ventana_vt1, &ventana_vt1_tune_info }, { "size", generic, &optimize_size_tune_info }, }; diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index b06a26bffb3..be7ccc753a4 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -270,7 +270,7 @@ (define_attr "cannot_copy" "no,yes" (const_string "no")) ;; Microarchitectures we know how to tune for. ;; Keep this in sync with enum riscv_microarchitecture. (define_attr "tune" - "generic,sifive_7" + "generic,sifive_7,ventana_vt1" (const (symbol_ref "((enum attr_tune) riscv_microarchitecture)"))) ;; Describe a user's asm statement. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 99cdeb90c7c..b5934183a88 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27358,14 +27358,14 @@ by particular CPU name. Permissible values for this option are: @samp{sifive-e20}, @samp{sifive-e21}, @samp{sifive-e24}, @samp{sifive-e31}, @samp{sifive-e34}, @samp{sifive-e76}, @samp{sifive-s21}, @samp{sifive-s51}, @samp{sifive-s54}, @samp{sifive-s76}, -@samp{sifive-u54}, and @samp{sifive-u74}. +@samp{sifive-u54}, @samp{sifive-u74}, and @samp{ventana-vt1} . @item -mtune=@var{processor-string} @opindex mtune Optimize the output for the given processor, specified by microarchitecture or particular CPU name. Permissible values for this option are: @samp{rocket}, @samp{sifive-3-series}, @samp{sifive-5-series}, @samp{sifive-7-series}, -@samp{size}, and all valid options for @option{-mcpu=}. +@samp{ventana-vt1}, @samp{size}, and all valid options for @option{-mcpu=}. When @option{-mtune=} is not specified, use the setting from @option{-mcpu}, the default is @samp{rocket} if both are not specified. -- 2.32.0