mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
JIT: flush a register if it won't be used for the rest of the block
This should dramatically reduce code size in the case of blocks with lots of branches, and certainly doesn't hurt elsewhere either. This can probably be improved a good bit through smarter tracking of register usage, e.g. discarding registers that are going to be overwritten, but this is a good start and should help reduce code size and register pressure. Unlike that sort of change, this is a "safe" patch; it only flushes registers, which can't affect correctness, unlike actually discarding data. As part of this, refactor PPCAnalyst to support distinguishing between float and integer registers (to properly handle instructions that access both, like floating-point loads and stores). Also update every instruction in the interpreter flags table I could find that didn't have all the correct flags.
This commit is contained in:
@ -24,6 +24,8 @@ enum
|
||||
FL_IN_C = (1<<11),
|
||||
FL_IN_S = (1<<12),
|
||||
FL_IN_AB = FL_IN_A | FL_IN_B,
|
||||
FL_IN_AC = FL_IN_A | FL_IN_C,
|
||||
FL_IN_ABC = FL_IN_A | FL_IN_B | FL_IN_C,
|
||||
FL_IN_SB = FL_IN_S | FL_IN_B,
|
||||
FL_IN_A0B = FL_IN_A0 | FL_IN_B,
|
||||
FL_IN_A0BC = FL_IN_A0 | FL_IN_B | FL_IN_C,
|
||||
@ -39,6 +41,18 @@ enum
|
||||
FL_SET_FPRF = (1<<20),
|
||||
FL_READ_FPRF = (1<<21),
|
||||
FL_SET_OE = (1<<22),
|
||||
FL_IN_FLOAT_A = (1<<23),
|
||||
FL_IN_FLOAT_B = (1<<24),
|
||||
FL_IN_FLOAT_C = (1<<25),
|
||||
FL_IN_FLOAT_S = (1<<26),
|
||||
FL_IN_FLOAT_D = (1<<27),
|
||||
FL_IN_FLOAT_AB = FL_IN_FLOAT_A | FL_IN_FLOAT_B,
|
||||
FL_IN_FLOAT_AC = FL_IN_FLOAT_A | FL_IN_FLOAT_C,
|
||||
FL_IN_FLOAT_ABC = FL_IN_FLOAT_A | FL_IN_FLOAT_B | FL_IN_FLOAT_C,
|
||||
FL_OUT_FLOAT_D = (1<<28),
|
||||
FL_OUT_FLOAT_S = (1<<29),
|
||||
// Used in the case of double ops (they don't modify the top half of the output)
|
||||
FL_INOUT_FLOAT_D = FL_IN_FLOAT_D | FL_OUT_FLOAT_D,
|
||||
};
|
||||
|
||||
enum
|
||||
@ -54,7 +68,8 @@ enum
|
||||
OPTYPE_STORE ,
|
||||
OPTYPE_LOADFP ,
|
||||
OPTYPE_STOREFP ,
|
||||
OPTYPE_FPU ,
|
||||
OPTYPE_DOUBLEFP,
|
||||
OPTYPE_SINGLEFP,
|
||||
OPTYPE_PS ,
|
||||
OPTYPE_DCACHE ,
|
||||
OPTYPE_ICACHE ,
|
||||
|
Reference in New Issue
Block a user