summaryrefslogtreecommitdiff
path: root/Source/Core/Common/x64Emitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/x64Emitter.cpp')
-rw-r--r--Source/Core/Common/x64Emitter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/Common/x64Emitter.cpp b/Source/Core/Common/x64Emitter.cpp
index 947e6e5614..169ffdc519 100644
--- a/Source/Core/Common/x64Emitter.cpp
+++ b/Source/Core/Common/x64Emitter.cpp
@@ -323,7 +323,11 @@ void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg,
// Okay, we're fine. Just disp encoding.
// We need displacement. Which size?
int ioff = (int)(s64)offset;
- if (ioff < -128 || ioff > 127)
+ if (ioff == 0 && (_offsetOrBaseReg & 7) != 5)
+ {
+ mod = 0;
+ }
+ else if (ioff < -128 || ioff > 127)
{
mod = 2; // 32-bit displacement
}