From e0bb76813d0129abfd0da51701acd4d6af080baa Mon Sep 17 00:00:00 2001 From: linzhida Date: Thu, 26 Sep 2024 19:59:54 +0800 Subject: [PATCH] Fix vleff: reduce VL if trigger fired on a later element. --- riscv/v_ext_macros.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/riscv/v_ext_macros.h b/riscv/v_ext_macros.h index b6365aa561..7bfed09ae0 100644 --- a/riscv/v_ext_macros.h +++ b/riscv/v_ext_macros.h @@ -1331,6 +1331,13 @@ reg_t index[P.VU.vlmax]; \ early_stop = true; \ P.VU.vl->write_raw(i); \ break; \ + } catch (triggers::matched_t& t) { \ + if (i == 0) \ + throw; /* Only take exception on zeroth element */ \ + /* Reduce VL if an exception occurs on a later element */ \ + early_stop = true; \ + P.VU.vl->write_raw(i); \ + break; \ } \ p->VU.elt(rd_num + fn * emul, vreg_inx, true) = val; \ } \