mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-21 17:11:57 -06:00
target/riscv/insn_trans/trans_rvv.c.inc: use 'vlenb' in MAXSZ()
Calculate the maximum vector size possible, 'max_sz', which is the size in bytes 'vlenb' multiplied by the max value of LMUL (LMUL = 8, when s->lmul = 3). 'max_sz' is then shifted right by 'scale', expressed as '3 - s->lmul', which is clearer than doing 'scale = lmul - 3' and then using '-scale' in the shift right. 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> Message-ID: <20240122161107.26737-10-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
7aa4d519cb
commit
bd2c82283d
1 changed files with 3 additions and 3 deletions
|
@ -1160,12 +1160,12 @@ GEN_LDST_WHOLE_TRANS(vs8r_v, 8, 1, true)
|
||||||
/*
|
/*
|
||||||
* MAXSZ returns the maximum vector size can be operated in bytes,
|
* 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
|
* 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)
|
static inline uint32_t MAXSZ(DisasContext *s)
|
||||||
{
|
{
|
||||||
int scale = s->lmul - 3;
|
int max_sz = s->cfg_ptr->vlenb * 8;
|
||||||
return s->cfg_ptr->vlen >> -scale;
|
return max_sz >> (3 - s->lmul);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool opivv_check(DisasContext *s, arg_rmrr *a)
|
static bool opivv_check(DisasContext *s, arg_rmrr *a)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue