On 3/11/26 18:34, WX Chen wrote:
This change adjusts the translation exit of `vsetivli`. While preserving the existing helper, state update flow, and TB boundaries, it uses the generic `gen_goto_tb()` path to reduce the overhead of repeated successor-TB lookups.`vsetivli` is used to set the vector length and type, and both its AVL and vtype encodings are provided by immediates. Given the CPU configuration and the source TB execution context, after this instruction completes normally, the vector state changes relevant to subsequent translation are deterministic. Therefore, this exit is eligible for direct TB linking. Measured on an AMD Ryzen AI 9 H 365 (x86-64) host, using qemu-riscv64 with -cpu rv64,v=true,vlen=128,elen=64. A RISC-V GCC 14.2.0 cc1 built for rv64gcv compiles the packages with -O2 -g0 -march=rv64gcv -mabi=lp64d. Only cc1 runs under emulation; make, the compiler driver, assembler and linker run on the host. Each variant is warmed up once, followed by three paired clean builds in AB/BA/AB order, using -j1 and fixed host CPU affinity (CPU 7). Median build wall times are: Before (s) After (s) Wall time reduction LZ4 1.10.0 125.017 123.060 1.57% zlib 1.3.1 71.062 70.310 1.06% In a separate untimed test, a loop executes two vsetivli instructions per iteration for 37 iterations. Host-side GDB entry breakpoints show that helper_lookup_tb_ptr() entries at the two successor PCs fall from 74 to 0. The guest still executes 74 vsetivli instructions. Initial TB dispatch and link establishment still occur through the normal dispatcher. Signed-off-by: WX Chen <[email protected]> --- target/riscv/tcg/insn_trans/trans_rvv.c.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
