hrydgard/ppsspp — pull request #2647 by unknownbrackets (2013-07-06 09:58:27+00:00)
Title: Fix x64 jit bugs (memchecks and lwl/lwr/swl/swr)

I didn't realize the `ABI_CallFunctionCCC(thunks.ProtectFunction(...))` did not preserve ECX, EDX, or R8 on x64. This was why lwl/lwr were broken on x64. Luckily, RCX and RDX are not in the regcache, but R8 is, so the memchecks which used 3 args could have been corrupting regs.

At first, I tried just calling the thunk save/load directly around the func (without the actual thunk), but this actually hurt performance, though it worked fine. So I decided to only do that for the case where it affected the regcache regs (R8/R9.)

Then I changed the left/right load/store ops not to trust RCX.

-[Unknown]