[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' in MA
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH 10/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' in MAXSZ() |
Date: |
Fri, 12 Jan 2024 18:38:09 -0300 |
MAXSZ() returns the value in bytes. Now that we have access to vlenb
we don't need to compensate with a '-3' in the scale to use 'vlen'.
MAXSZ() now works as follows:
LMUL lmul=scale MAXSZ (vlenb >> -scale)
1 0 vlenb
2 1 vlenb << 1
4 2 vlenb << 2
8 3 vlenb << 3
1/8 -3 vlenb >> 3
1/4 -2 vlenb >> 2
1/2 -1 vlenb >> 1
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
---
target/riscv/insn_trans/trans_rvv.c.inc | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/target/riscv/insn_trans/trans_rvv.c.inc
b/target/riscv/insn_trans/trans_rvv.c.inc
index d743675262..804cfd6c7f 100644
--- a/target/riscv/insn_trans/trans_rvv.c.inc
+++ b/target/riscv/insn_trans/trans_rvv.c.inc
@@ -1160,12 +1160,11 @@ GEN_LDST_WHOLE_TRANS(vs8r_v, 8, 1, true)
/*
* MAXSZ returns the maximum vector size can be operated in bytes,
* which is used in GVEC IR when vl_eq_vlmax flag is set to true
- * to accerlate vector operation.
+ * to accelerate vector operation.
*/
static inline uint32_t MAXSZ(DisasContext *s)
{
- int scale = s->lmul - 3;
- return s->cfg_ptr->vlen >> -scale;
+ return s->cfg_ptr->vlenb >> -s->lmul;
}
static bool opivv_check(DisasContext *s, arg_rmrr *a)
--
2.43.0
- [PATCH 06/13] target/riscv/insn_trans/trans_rvvk.c.inc: use 'vlenb', (continued)
- [PATCH 06/13] target/riscv/insn_trans/trans_rvvk.c.inc: use 'vlenb', Daniel Henrique Barboza, 2024/01/12
- [PATCH 07/13] target/riscv/vector_helper.c: use 'vlenb', Daniel Henrique Barboza, 2024/01/12
- [PATCH 08/13] target/riscv/vector_helper.c: use vlenb in HELPER(vsetvl), Daniel Henrique Barboza, 2024/01/12
- [PATCH 09/13] target/riscv/cpu.h: use 'vlenb' in vext_get_vlmax(), Daniel Henrique Barboza, 2024/01/12
- [PATCH 11/13] trans_rvv.c.inc: remove vlmax arg from vec_element_loadx(), Daniel Henrique Barboza, 2024/01/12
- [PATCH 10/13] target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' in MAXSZ(),
Daniel Henrique Barboza <=
- [PATCH 12/13] trans_rvv.c.inc: use cpu_vl in trans_vrgather_vi(), Daniel Henrique Barboza, 2024/01/12
- [PATCH 13/13] target/riscv/cpu.c: remove cpu->cfg.vlen, Daniel Henrique Barboza, 2024/01/12