CPU Backends: Make instruction table initialization private #4862

Merged
merged 2 commits into from Feb 15, 2017

Projects

None yet

2 participants

@lioncash
Member
lioncash commented Feb 8, 2017

Previously, all of the internals that handled how the instruction tables are initialized were exposed externally. However, this can all be made private to each CPU backend.

If each backend has an Init() function, then this is where the instruction tables should be initialized, it shouldn't be the responsibility of external code to ensure internal validity.

This allows for getting rid of all the table initialization shenanigans within JitInterface and PPCTables

-void CompileInstruction(Jit64& jit, PPCAnalyst::CodeOp& op)
-{
- (jit.*dynaOpTable[op.inst.OPCD])(op.inst);
+ (this->*dynaOpTable[op.inst.OPCD])(op.inst);
@degasus
degasus Feb 8, 2017 Member

is "this" still required?

@lioncash
lioncash Feb 8, 2017 Member

Yeah, it's still required

@degasus
Member
degasus commented Feb 8, 2017

LGTM, nice cleanup.

lioncash added some commits Feb 8, 2017
@lioncash lioncash JIT: Make compilation functions a part of the JIT classes 5da7d70
@lioncash lioncash CPU Backends: Make each CPU backend responsible for initializing its own
instruction tables

Previously, all of the internals that handled how the instruction tables
are initialized were exposed externally. However, this can all be made
private to each CPU backend.

If each backend has an Init() function, then this is where the instruction
tables should be initialized, it shouldn't be the responsibility of
external code to ensure internal validity.

This allows for getting rid of all the table initialization shenanigans
within JitInterface and PPCTables.
1ce1304
@lioncash lioncash merged commit 6f272b3 into dolphin-emu:master Feb 15, 2017

10 checks passed

default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-freebsd-x64 Build succeeded on builder pr-freebsd-x64
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details
@lioncash lioncash deleted the lioncash:compile branch Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment