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

Jit_SystemRegisters: Make mfspr PIE-compliant #5144

Merged
merged 2 commits into from Apr 10, 2017

Conversation

merryhime
Copy link
Contributor

Using RCX as a base register for accessing CoreTiming globals.

const void* rcx_relative_base = &CoreTiming::g_last_OC_factor_inverted;
MOV(64, R(RCX), ImmPtr(rcx_relative_base));

// We're relying on these globals being placed close (within +/-2GB) to each other in memory.

This comment was marked as off-topic.

This comment was marked as off-topic.

const std::intptr_t target = reinterpret_cast<std::intptr_t>(ptr);
const std::ptrdiff_t offset = target - base;

_assert_(offset >= -0x80000000ll && offset <= 0x7FFFFFFFll);

This comment was marked as off-topic.

MOV(64, R(RCX), ImmPtr(rcx_relative_base));

// We're relying on these globals being placed close (within +/-2GB) to each other in memory.
const auto MRelative = [rcx_relative_base](void* ptr) -> OpArg {

This comment was marked as off-topic.

MOV(64, R(RCX), ImmPtr(rcx_relative_base));

// We're relying on these globals being placed close (within +/-2GB) to each other in memory.
const auto MRelative = [rcx_relative_base](void* ptr) {

This comment was marked as off-topic.

@merryhime
Copy link
Contributor Author

Naming the struct was difficult.

@degasus
Copy link
Member

degasus commented Apr 5, 2017

The JIT changes LGTM.

@degasus degasus merged commit 34ac749 into dolphin-emu:master Apr 10, 2017
@merryhime merryhime deleted the mfspr branch April 10, 2017 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants