On Thu, 5 Nov 2026 03:41:19 +0800 Max Chou <[email protected]> wrote:
> Add CPU configuration for the Zvqwdota8i extension which depends on the > Zve32x extension per the specification. > > Signed-off-by: Max Chou <[email protected]> Reviewed-by: Chao Liu <[email protected]> Thanks, Chao > --- > target/riscv/cpu.c | 2 ++ > target/riscv/cpu_cfg_fields.h.inc | 1 + > target/riscv/tcg/tcg-cpu.c | 5 +++++ > target/riscv/tcg/vector_helper.c | 6 ++++-- > 4 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c > index 53ecce8c398..96a1d76c5a2 100644 > --- a/target/riscv/cpu.c > +++ b/target/riscv/cpu.c > @@ -250,6 +250,8 @@ const RISCVIsaExtData isa_edata_arr[] = { > ISA_EXT_DATA_ENTRY(zvksg, PRIV_VERSION_1_12_0, ext_zvksg), > ISA_EXT_DATA_ENTRY(zvksh, PRIV_VERSION_1_12_0, ext_zvksh), > ISA_EXT_DATA_ENTRY(zvkt, PRIV_VERSION_1_12_0, ext_zvkt), > + ISA_EXPERIMENTAL_EXT_DATA_ENTRY(zvqwdota8i, PRIV_VERSION_1_13_0, > + ext_zvqwdota8i), > ISA_EXT_DATA_ENTRY(zhinx, PRIV_VERSION_1_12_0, ext_zhinx), > ISA_EXT_DATA_ENTRY(zhinxmin, PRIV_VERSION_1_12_0, ext_zhinxmin), > ISA_EXT_DATA_ENTRY(sdext, PRIV_VERSION_1_12_0, ext_sdext), > diff --git a/target/riscv/cpu_cfg_fields.h.inc > b/target/riscv/cpu_cfg_fields.h.inc > index 85fc3ad8bb8..0c08d688ac1 100644 > --- a/target/riscv/cpu_cfg_fields.h.inc > +++ b/target/riscv/cpu_cfg_fields.h.inc > @@ -106,6 +106,7 @@ BOOL_FIELD(ext_zvfbfmin) > BOOL_FIELD(ext_zvfbfwma) > BOOL_FIELD(ext_zvfh) > BOOL_FIELD(ext_zvfhmin) > +BOOL_FIELD(ext_zvqwdota8i) > BOOL_FIELD(ext_sdext) > BOOL_FIELD(ext_sdtrig) > BOOL_FIELD(ext_smaia) > diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c > index 5834ec1524f..1c51ea94489 100644 > --- a/target/riscv/tcg/tcg-cpu.c > +++ b/target/riscv/tcg/tcg-cpu.c > @@ -691,6 +691,11 @@ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, > Error **errp) > } > } > > + if (cpu->cfg.ext_zvqwdota8i && !cpu->cfg.ext_zve32x) { > + error_setg(errp, "Zvqwdota8i extension depends on Zve32x extension"); > + return; > + } > + > if ((cpu->cfg.ext_zdinx || cpu->cfg.ext_zhinxmin) && > !cpu->cfg.ext_zfinx) { > error_setg(errp, "Zdinx/Zhinx/Zhinxmin extensions require Zfinx"); > return; > diff --git a/target/riscv/tcg/vector_helper.c > b/target/riscv/tcg/vector_helper.c > index 172ae0f11dc..4ba0a89f4b5 100644 > --- a/target/riscv/tcg/vector_helper.c > +++ b/target/riscv/tcg/vector_helper.c > @@ -39,7 +39,8 @@ static target_ulong vtype_reserved(CPURISCVState *env, > target_ulong vtype) > int xlen = riscv_cpu_xlen(env); > target_ulong reserved = 0; > > - if (riscv_cpu_cfg(env)->ext_zvfbfa) { > + if (riscv_cpu_cfg(env)->ext_zvfbfa || > + riscv_cpu_cfg(env)->ext_zvqwdota8i) { > reserved = vtype & MAKE_64BIT_MASK(R_VTYPE_RESERVED_SHIFT, > xlen - 1 - > R_VTYPE_RESERVED_SHIFT); > } else { > @@ -88,7 +89,8 @@ target_ulong HELPER(vsetvl)(CPURISCVState *env, > target_ulong s1, > > switch (vsew) { > case MO_8: > - ill_altfmt &= !(cpu->cfg.ext_zvfbfa); > + ill_altfmt &= !(cpu->cfg.ext_zvfbfa || > + cpu->cfg.ext_zvqwdota8i); > break; > case MO_16: > ill_altfmt &= !(cpu->cfg.ext_zvfbfa); > -- > 2.56.0 > > > Sent using hkml (https://github.com/sjp38/hackermail)
