]> git.ipfire.org Git - thirdparty/qemu.git/commit
optimize the memory probing for vector fault-only-first loads.
authorPaolo Savini <paolo.savini@embecosm.com>
Fri, 21 Feb 2025 15:53:20 +0000 (15:53 +0000)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 19 Mar 2025 06:31:43 +0000 (16:31 +1000)
commit17288e38bebf20121c4aa20b264e661a7fa50ed8
tree9b3d00ebf838d68924ccb280791bd927bc28a77e
parent672cb29d1e811180bf1aeefbcb0936ecd5bd3853
optimize the memory probing for vector fault-only-first loads.

Fault-only-first loads in the RISC-V vector extension need to update
the vl with the element index that causes an exception.
In order to ensure this the emulation of this instruction used to probe the
memory covered by the load operation with a loop that iterated over each element
so that when a flag was raised it was possible to set the vl to the
corresponding element index.
This loop was executed every time whether an exception happened or not.

This commit removes the per element memory probing from the main execution path
and adds a broad memory probing first. If this probing raises any flag that is
not a watchpoint flag (that per standard is allowed by this instruction) we
proceed with the per element probing to find the index of the element causing
the exception and set vl to such index.

Signed-off-by: Paolo Savini <paolo.savini@embecosm.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20250221155320.59159-2-paolo.savini@embecosm.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/vector_helper.c