Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jit64Common: Split Jit64Util contents into separate files #4522

Merged
merged 1 commit into from Dec 19, 2016

Conversation

lioncash
Copy link
Member

Much of Jit64Util consists of essentials, not utilities. Breaking these out into their own files also prevents unrelated includes from being present near other classes.

This also makes it easier to find and change certain components of the x86-64 JIT, should it be necessary.

This is essentially a preliminary cleanup before I make a few of the memory routines for Jit64 not rely on the jit global variable. Eliminating reliance on the global will also allow me to rework #4518 without the need for downcasting.

@iwubcode
Copy link
Contributor

Looks good, should Jit64Util.h be renamed to something more appropriate like PowerPCState?

@lioncash
Copy link
Member Author

lioncash commented Dec 18, 2016

Looks good, should Jit64Util.h be renamed to something more appropriate like PowerPCState?

PowerPCState is a thing that already exists in an unrelated (in the sense it would introduce x86 dependencies in generic code if moved into the same file) header. So I've left it as Jit64Util.

@iwubcode
Copy link
Contributor

Jit64PPCStates then? Jit64Util doesn't really tell me a whole lot.

What exactly are those defines for?

@lioncash
Copy link
Member Author

They generate an operand argument that uses RPPCState (an actual x86 register for tracking the live PowerPCState) and contains the offset to the relevant entity in the PowerPCState struct.

Much of Jit64Util consists of essentials, not utilities. Breaking these
out into their own files also prevents unrelated includes from being
present near other classes.

This also makes it easier to find and change certain components of the
x86-64 JIT, should it be necessary.
@iwubcode
Copy link
Contributor

iwubcode commented Dec 18, 2016

Ah ok, thanks for the explanation. I see you've updated the filename as well, appreciate it!

LGTM

// We offset by 0x80 because the range of one byte memory offsets is
// -0x80..0x7f.
#define PPCSTATE(x) \
MDisp(RPPCSTATE, (int)((char*)&PowerPC::ppcState.x - (char*)&PowerPC::ppcState) - 0x80)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@lioncash lioncash merged commit 10862cd into dolphin-emu:master Dec 19, 2016
@lioncash lioncash deleted the jitutil branch December 19, 2016 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants