[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 02/13] target/riscv/csr.c: use 'vlenb' instead of 'vlen'
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v4 02/13] target/riscv/csr.c: use 'vlenb' instead of 'vlen' |
Date: |
Mon, 22 Jan 2024 13:10:56 -0300 |
As a bonus, we're being more idiomatic using cpu->cfg.vlenb when
reading CSR_VLENB.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
target/riscv/csr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index d666620e48..d9a010387f 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -683,7 +683,7 @@ static RISCVException read_vl(CPURISCVState *env, int csrno,
static int read_vlenb(CPURISCVState *env, int csrno, target_ulong *val)
{
- *val = riscv_cpu_cfg(env)->vlen >> 3;
+ *val = riscv_cpu_cfg(env)->vlenb;
return RISCV_EXCP_NONE;
}
@@ -738,7 +738,7 @@ static RISCVException write_vstart(CPURISCVState *env, int
csrno,
* The vstart CSR is defined to have only enough writable bits
* to hold the largest element index, i.e. lg2(VLEN) bits.
*/
- env->vstart = val & ~(~0ULL << ctzl(riscv_cpu_cfg(env)->vlen));
+ env->vstart = val & ~(~0ULL << ctzl(riscv_cpu_cfg(env)->vlenb << 3));
return RISCV_EXCP_NONE;
}
--
2.43.0
- [PATCH v4 00/13] target/riscv: add 'cpu->cfg.vlenb', remove, Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 01/13] target/riscv: add 'vlenb' field in cpu->cfg, Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 02/13] target/riscv/csr.c: use 'vlenb' instead of 'vlen',
Daniel Henrique Barboza <=
- [PATCH v4 03/13] target/riscv/gdbstub.c: use 'vlenb' instead of shifting 'vlen', Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 04/13] target/riscv/insn_trans/trans_rvbf16.c.inc: use cpu->cfg.vlenb, Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 05/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb', Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 06/13] target/riscv/insn_trans/trans_rvvk.c.inc: use 'vlenb', Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 07/13] target/riscv/vector_helper.c: use 'vlenb', Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 08/13] target/riscv/vector_helper.c: use vlenb in HELPER(vsetvl), Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 09/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' in MAXSZ(), Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 10/13] target/riscv/cpu.h: use 'vlenb' in vext_get_vlmax(), Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 11/13] target/riscv: change vext_get_vlmax() arguments, Daniel Henrique Barboza, 2024/01/22
- [PATCH v4 12/13] trans_rvv.c.inc: use vext_get_vlmax() in trans_vrgather_v*(), Daniel Henrique Barboza, 2024/01/22