From 08afafccfd3ceaf6e158fc6a040bb0c931caa51b Mon Sep 17 00:00:00 2001 From: Chih-Min Chao Date: Wed, 11 May 2022 02:37:24 -0700 Subject: rvv: fix the checking eew and elen for index load eew of index register can't be larger than elen ex: elen = 32, vloxei64.v is illegal Signed-off-by: Chih-Min Chao --- riscv/v_ext_macros.h | 1 + 1 file changed, 1 insertion(+) diff --git a/riscv/v_ext_macros.h b/riscv/v_ext_macros.h index 2a32979..4df6813 100644 --- a/riscv/v_ext_macros.h +++ b/riscv/v_ext_macros.h @@ -84,6 +84,7 @@ static inline bool is_aligned(const unsigned val, const unsigned pos) #define VI_CHECK_ST_INDEX(elt_width) \ require_vector(false); \ + require(elt_width <= P.VU.ELEN); \ float vemul = ((float)elt_width / P.VU.vsew * P.VU.vflmul); \ require(vemul >= 0.125 && vemul <= 8); \ reg_t emul = vemul < 1 ? 1 : vemul; \ -- cgit v1.1