mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-08 21:09:49 +00:00
Cache simulation requires strict INCEIP updating so that the boundaries between
individual x86 instructions can be found when instrumenting UCode. However, EIP is not needed during execution, because the x86 instr addresses are copied into the cost-centres. So now they INCEIPs are removed during the instrumentation step once their task is done. This reduces running times by about 3--7%, and translation sizes by about 9% (code expansion reduced from about 11x to about 10x). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@550
This commit is contained in:
@@ -654,7 +654,14 @@ UCodeBlock* VG_(cachesim_instrument)(UCodeBlock* cb_in, Addr orig_addr)
|
||||
uLiteral(cb, VGOFF_(cachesim_log_mem_instr));
|
||||
}
|
||||
|
||||
VG_(copyUInstr)(cb, u_in);
|
||||
/* Strict INCEIP updating is required so each x86 instruction's
|
||||
* UCode is clearly marked. But once we're here, we've found the
|
||||
* end of the x86 instruction and the INCEIP isn't needed any
|
||||
* more -- EIP is never referenced during operation, because the
|
||||
* x86 instr addresses have been squirreled away in the CC. So
|
||||
* chop it out to save time and space. */
|
||||
if (INCEIP != u_in->opcode)
|
||||
VG_(copyUInstr)(cb, u_in);
|
||||
|
||||
/* Update BBCC_ptr, EIP, de-init read/write temps for next instr */
|
||||
BBCC_ptr += CC_size;
|
||||
|
||||
@@ -654,7 +654,14 @@ UCodeBlock* VG_(cachesim_instrument)(UCodeBlock* cb_in, Addr orig_addr)
|
||||
uLiteral(cb, VGOFF_(cachesim_log_mem_instr));
|
||||
}
|
||||
|
||||
VG_(copyUInstr)(cb, u_in);
|
||||
/* Strict INCEIP updating is required so each x86 instruction's
|
||||
* UCode is clearly marked. But once we're here, we've found the
|
||||
* end of the x86 instruction and the INCEIP isn't needed any
|
||||
* more -- EIP is never referenced during operation, because the
|
||||
* x86 instr addresses have been squirreled away in the CC. So
|
||||
* chop it out to save time and space. */
|
||||
if (INCEIP != u_in->opcode)
|
||||
VG_(copyUInstr)(cb, u_in);
|
||||
|
||||
/* Update BBCC_ptr, EIP, de-init read/write temps for next instr */
|
||||
BBCC_ptr += CC_size;
|
||||
|
||||
Reference in New Issue
Block a user