Wednesday, December 31, 2008

Memory Access Optimization

I recentely commit a change to enable "MemoryAccessOptmizition". I expect this will give the better results than StackOptimization. It is by default disabled now.

StackOptmization is a optmization when dynamic recompiling the N64 code into PSP code. It will generate the less code to access memory based on the assumption that N64 will always access RAM instead of IO when using SP register.

Memory Access Optimizatioin is based on another assumption that one instruction will access either RAM, either I/O, but not both. So if we believe one instruction will only access memory, we can generate better PSP code. I believe this approach will make more instructions get benifit than stack optimization.

Most of games run well under this optimization based on my testing. However Super Mario will crash. I finally tracked down to a instruction LB. So in current version, I don't do this optimization for LB, but for LBU/LH/LW/SB/SH/SW.

No comments: