• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionb4a99d40276eb5bdfa849cc04344d9a2c4c820ef (tree)
Zeit2022-01-21 14:52:56
AutorFrank Chang <frank.chang@sifi...>
CommiterAlistair Francis

Log Message

target/riscv: rvv-1.0: Add Zve64f extension into RISC-V

Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20220118014522.13613-2-frank.chang@sifive.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Ändern Zusammenfassung

Diff

--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -609,6 +609,10 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
609609 }
610610 set_vext_version(env, vext_version);
611611 }
612+ if (cpu->cfg.ext_zve64f && !cpu->cfg.ext_f) {
613+ error_setg(errp, "Zve64f extension depends upon RVF.");
614+ return;
615+ }
612616 if (cpu->cfg.ext_j) {
613617 ext |= RVJ;
614618 }
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -340,6 +340,7 @@ struct RISCVCPU {
340340 bool ext_icsr;
341341 bool ext_zfh;
342342 bool ext_zfhmin;
343+ bool ext_zve64f;
343344
344345 char *priv_spec;
345346 char *user_spec;
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -69,12 +69,15 @@ static RISCVMXL cpu_get_xl(CPURISCVState *env)
6969 void cpu_get_tb_cpu_state(CPURISCVState *env, target_ulong *pc,
7070 target_ulong *cs_base, uint32_t *pflags)
7171 {
72+ CPUState *cs = env_cpu(env);
73+ RISCVCPU *cpu = RISCV_CPU(cs);
74+
7275 uint32_t flags = 0;
7376
7477 *pc = env->pc;
7578 *cs_base = 0;
7679
77- if (riscv_has_ext(env, RVV)) {
80+ if (riscv_has_ext(env, RVV) || cpu->cfg.ext_zve64f) {
7881 /*
7982 * If env->vl equals to VLMAX, we can use generic vector operation
8083 * expanders (GVEC) to accerlate the vector operations.
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -47,7 +47,11 @@ static RISCVException fs(CPURISCVState *env, int csrno)
4747
4848 static RISCVException vs(CPURISCVState *env, int csrno)
4949 {
50- if (env->misa_ext & RVV) {
50+ CPUState *cs = env_cpu(env);
51+ RISCVCPU *cpu = RISCV_CPU(cs);
52+
53+ if (env->misa_ext & RVV ||
54+ cpu->cfg.ext_zve64f) {
5155 #if !defined(CONFIG_USER_ONLY)
5256 if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
5357 return RISCV_EXCP_ILLEGAL_INST;
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -79,6 +79,7 @@ typedef struct DisasContext {
7979 bool ext_ifencei;
8080 bool ext_zfh;
8181 bool ext_zfhmin;
82+ bool ext_zve64f;
8283 bool hlsx;
8384 /* vector extension */
8485 bool vill;
@@ -894,6 +895,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
894895 ctx->ext_ifencei = cpu->cfg.ext_ifencei;
895896 ctx->ext_zfh = cpu->cfg.ext_zfh;
896897 ctx->ext_zfhmin = cpu->cfg.ext_zfhmin;
898+ ctx->ext_zve64f = cpu->cfg.ext_zve64f;
897899 ctx->vlen = cpu->cfg.vlen;
898900 ctx->elen = cpu->cfg.elen;
899901 ctx->mstatus_hs_fs = FIELD_EX32(tb_flags, TB_FLAGS, MSTATUS_HS_FS);