• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revision31961cfe505e11cc4ec4cfde52c851957e1bf605 (tree)
Time2022-01-21 14:52:57
AuthorLIU Zhiwei <zhiwei_liu@c-sk...>
CommiterAlistair Francis

Log Message

target/riscv: Adjust vsetvl according to XLEN

Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20220120122050.41546-17-zhiwei_liu@c-sky.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Change Summary

Incremental Difference

--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -491,6 +491,11 @@ static inline RISCVMXL cpu_recompute_xl(CPURISCVState *env)
491491 }
492492 #endif
493493
494+static inline int riscv_cpu_xlen(CPURISCVState *env)
495+{
496+ return 16 << env->xl;
497+}
498+
494499 /*
495500 * Encode LMUL to lmul as follows:
496501 * LMUL vlmul lmul
--- a/target/riscv/vector_helper.c
+++ b/target/riscv/vector_helper.c
@@ -36,8 +36,11 @@ target_ulong HELPER(vsetvl)(CPURISCVState *env, target_ulong s1,
3636 uint64_t lmul = FIELD_EX64(s2, VTYPE, VLMUL);
3737 uint16_t sew = 8 << FIELD_EX64(s2, VTYPE, VSEW);
3838 uint8_t ediv = FIELD_EX64(s2, VTYPE, VEDIV);
39- bool vill = FIELD_EX64(s2, VTYPE, VILL);
40- target_ulong reserved = FIELD_EX64(s2, VTYPE, RESERVED);
39+ int xlen = riscv_cpu_xlen(env);
40+ bool vill = (s2 >> (xlen - 1)) & 0x1;
41+ target_ulong reserved = s2 &
42+ MAKE_64BIT_MASK(R_VTYPE_RESERVED_SHIFT,
43+ xlen - 1 - R_VTYPE_RESERVED_SHIFT);
4144
4245 if (lmul & 4) {
4346 /* Fractional LMUL. */