This patch aims at optimizing the helper function that emulates the fault-only-first load instructions of the RISC-V vector extension.
The current patch removes redundant memory probing from the common execution path where we don't get exceptions. The previous version of this emulation always probed the memory with an element-wise loop over the memory area covered by the load operation and updated the vl parameter with the element index causing the exception (if any exception happened). In this patch we do a probe of the whole memory area covered by the load instruction and only if a flag other than a watchpoint flag is raised we do the element-wise probing to find the index of the element causing the exception. As stated in the standard we don't change vl for watchpoints otherwise the debug watchpoint events might be lost. Cc: Richard Handerson <richard.hender...@linaro.org> Cc: Palmer Dabbelt <pal...@dabbelt.com> Cc: Alistair Francis <alistair.fran...@wdc.com> Cc: Bin Meng <bmeng...@gmail.com> Cc: Weiwei Li <liwei1...@gmail.com> Cc: Daniel Henrique Barboza <dbarb...@ventanamicro.com> Cc: Liu Zhiwei <zhiwei_...@linux.alibaba.com> Cc: Helene Chelin <helene.che...@embecosm.com> Cc: Nathan Egge <ne...@google.com> Cc: Max Chou <max.c...@sifive.com> Cc: Jeremy Bennett <jeremy.benn...@embecosm.com> Cc: Craig Blackmore <craig.blackm...@embecosm.com> Paolo Savini (1): target/riscv: optimize the memory probing for vector fault-only-first loads. target/riscv/vector_helper.c | 91 ++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 35 deletions(-) -- 2.34.1