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
Conversation
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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
This comment was marked as off-topic.
Sorry, something went wrong.
Naming the |
The JIT changes LGTM. |
Using RCX as a base register for accessing CoreTiming globals.