On Thu, 5 Nov 2026 03:41:23 +0800 Max Chou <[email protected]> wrote:
> Add CPU configuration property of Zvqwdota16i extension which depends on > the Zve64x 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 | 4 +++- > 4 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c > index 08b14782451..7873e67c053 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(zvqwdota16i, PRIV_VERSION_1_13_0, > + ext_zvqwdota16i), > 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), > diff --git a/target/riscv/cpu_cfg_fields.h.inc > b/target/riscv/cpu_cfg_fields.h.inc > index 0c08d688ac1..8bac69a17f7 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_zvqwdota16i) > BOOL_FIELD(ext_zvqwdota8i) > BOOL_FIELD(ext_sdext) > BOOL_FIELD(ext_sdtrig) > diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c > index 1c51ea94489..54749125acf 100644 > --- a/target/riscv/tcg/tcg-cpu.c > +++ b/target/riscv/tcg/tcg-cpu.c > @@ -696,6 +696,11 @@ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, > Error **errp) > return; > } > > + if (cpu->cfg.ext_zvqwdota16i && !cpu->cfg.ext_zve64x) { > + error_setg(errp, "Zvqwdota16i extension depends on Zve64x > 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 6abcf522648..6d79fb5d299 100644 > --- a/target/riscv/tcg/vector_helper.c > +++ b/target/riscv/tcg/vector_helper.c > @@ -40,6 +40,7 @@ static target_ulong vtype_reserved(CPURISCVState *env, > target_ulong vtype) > target_ulong reserved = 0; > > if (riscv_cpu_cfg(env)->ext_zvfbfa || > + riscv_cpu_cfg(env)->ext_zvqwdota16i || > riscv_cpu_cfg(env)->ext_zvqwdota8i) { > reserved = vtype & MAKE_64BIT_MASK(R_VTYPE_RESERVED_SHIFT, > xlen - 1 - > R_VTYPE_RESERVED_SHIFT); > @@ -93,7 +94,8 @@ target_ulong HELPER(vsetvl)(CPURISCVState *env, > target_ulong s1, > cpu->cfg.ext_zvqwdota8i); > break; > case MO_16: > - ill_altfmt &= !(cpu->cfg.ext_zvfbfa); > + ill_altfmt &= !(cpu->cfg.ext_zvfbfa || > + cpu->cfg.ext_zvqwdota16i); > break; > default: > break; > -- > 2.56.0 > > > Sent using hkml (https://github.com/sjp38/hackermail)
