Hello, this patch is a proposal to use globals for the 8 or 16 CPU registers on i386 and x86_64. I measured the improvement in the following conditions: - Machine: i7 920 - Software: Fedora11 x86_64 gcc 4.4.1 - Benchmark: SPEC2000 gcc with expr.i input - User mode - i386 and x86_64 hosts and targets, with and without the patch (8 combinations) The results are: qemu-i386_on-i386 15.82user 0.05system 0:15.91elapsed qemu-i386_on-i386-reg 15.40user 0.02system 0:15.43elapsed qemu-i386_on-x86_64 15.65user 0.05system 0:15.71elapsed qemu-i386_on-x86_64-reg 15.11user 0.03system 0:15.15elapsed qemu-x86_64_on-i386 mmap: No such device or address qemu-x86_64_on-i386-reg mmap: No such device or address qemu-x86_64_on-x86_64 18.42user 0.07system 0:18.49elapsed qemu-x86_64_on-x86_64-reg 13.22user 0.06system 0:13.31elapsed Given my lack of knowledge of system QEMU, I will leave it to someone else to measure the speedup. A previous version of that patch, that only handled i386 target, was tested by Malc who got speedup running OpenSSL on his G4. It was also sent to Fabrice who asked me to send it to the mailing list. The usage of globals is controlled by USE_REGS so that reviewers can quickly test the benefit (or the lack of it). Comments are welcome (except for the obvious presence of // which is only temporary). I need to optimize a few things once I'm sure the temporaries (cpu_tmp0, ...) are not used outside of the modified functions. x86_64 was coded in a hurry and is perhaps buggy. Laurent Signed-off-by: Laurent Desnogues