hrydgard/ppsspp — pull request #4503 by unknownbrackets (2013-11-11 01:05:02+00:00)
Title: Retain immediates in the armjit, optimize similar imms

This also makes several other changes:
* Optimizes ORI2R to use up to 2 ORRs if possible rather than a literal.
* Uses imms in shifts, byteswaps, and multiplication.
* Implements two of the last non-vfpu instructions for x86 (byteswaps.)
* Minor optimizations to beq/bne/syscall.
* Removes the cache instruction on mobile/ppc (before, it was calling interpreter, I actually saw this in a profile at 0.5% or so.)

But mainly it keeps track of imm values in regs, and tries to "build" imms using them instead of a MOVW/MOVT pair. This also means we retain the imm so if it's reset with the same value (like 0), we can avoid flushing it again.

It could probably do a lot more to detect "nearby" imms that it can build off of. For now, I just used add/sub and an and for masking ptrs.

-[Unknown]