This is a patch that changes the dynamic recompiling
core in two ways.
The first is a minor change to dyn_fill_ea(), which
causes the code generation to output one less lea
instruction when either a base or index is not present
for 32-bit addresses.
The second is a change to the flags handling. A
function in the dynamic core, gen_needflags(), is used
to transfer the emulated CPU's status flags to the
native CPU, so that they will not be lost. However,
some opcodes replace all of the status flags, so a new
function gen_discardflags() has been added to avoid
outputting the slow POPF opcode for these cases (ADD,
SUB, AND, OR, XOR, CMP, TEST, SHL, SHR, SHLD, SHRD,
NEG). In addition, some instructions either do not modify
the carry flag, or modify it but require the previous
value (INC and DEC fall into the former case; ADC and
SBB in the latter). A function gen_needcarry() has been
added to help with these cases similarly.
I have not done specific profiling, however CPU usage
reports showed improvements from both changes
(though not very much from the first, as could be
Patch is against September 29 CVS, however the files
changed seemed to be current in anonCVS on October 6.