target/riscv: rvv-1.0: fix address index overflow bug of indexed load/store insns
Replace ETYPE from signed int to unsigned int to prevent index overflow issue, which would lead to wrong index address. Signed-off-by: Frank Chang <frank.chang@sifive.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20211210075704.23951-23-frank.chang@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
08b9d0ed4a
commit
83fcd573b1
@ -374,10 +374,10 @@ static target_ulong NAME(target_ulong base, \
|
||||
return (base + *((ETYPE *)vs2 + H(idx))); \
|
||||
}
|
||||
|
||||
GEN_VEXT_GET_INDEX_ADDR(idx_b, int8_t, H1)
|
||||
GEN_VEXT_GET_INDEX_ADDR(idx_h, int16_t, H2)
|
||||
GEN_VEXT_GET_INDEX_ADDR(idx_w, int32_t, H4)
|
||||
GEN_VEXT_GET_INDEX_ADDR(idx_d, int64_t, H8)
|
||||
GEN_VEXT_GET_INDEX_ADDR(idx_b, uint8_t, H1)
|
||||
GEN_VEXT_GET_INDEX_ADDR(idx_h, uint16_t, H2)
|
||||
GEN_VEXT_GET_INDEX_ADDR(idx_w, uint32_t, H4)
|
||||
GEN_VEXT_GET_INDEX_ADDR(idx_d, uint64_t, H8)
|
||||
|
||||
static inline void
|
||||
vext_ldst_index(void *vd, void *v0, target_ulong base,
|
||||
|
Loading…
Reference in New Issue
Block a user