diff --git a/Source/Core/Common/x64ABI.h b/Source/Core/Common/x64ABI.h index ee8e596756..66abeee5ef 100644 --- a/Source/Core/Common/x64ABI.h +++ b/Source/Core/Common/x64ABI.h @@ -30,10 +30,11 @@ #define ABI_PARAM3 R8 #define ABI_PARAM4 R9 +// xmm0-xmm15 use the upper 16 bits in the functions that push/pop registers. #define ABI_ALL_CALLER_SAVED ((1 << RAX) | (1 << RCX) | (1 << RDX) | (1 << R8) | \ (1 << R9) | (1 << R10) | (1 << R11) | \ - (1 << XMM0) | (1 << XMM1) | (1 << XMM2) | (1 << XMM3) | \ - (1 << XMM4) | (1 << XMM5)) + (1 << (XMM0+16)) | (1 << (XMM1+16)) | (1 << (XMM2+16)) | (1 << (XMM3+16)) | \ + (1 << (XMM4+16)) | (1 << (XMM5+16))) #else //64-bit Unix / OS X @@ -44,6 +45,8 @@ #define ABI_PARAM5 R8 #define ABI_PARAM6 R9 +// FIXME: avoid pushing all 16 XMM registers when possible? most functions we call probably +// don't actually clobber them. #define ABI_ALL_CALLER_SAVED ((1 << RAX) | (1 << RCX) | (1 << RDX) | (1 << RDI) | \ (1 << RSI) | (1 << R8) | (1 << R9) | (1 << R10) | (1 << R11) | \ 0xffff0000 /* xmm0..15 */) diff --git a/Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp b/Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp index 81327d36ea..3875acaa27 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp @@ -9,7 +9,7 @@ #include "Core/PowerPC/JitCommon/JitBase.h" #define QUANTIZED_REGS_TO_SAVE (ABI_ALL_CALLER_SAVED & ~((1 << RAX) | (1 << RCX) | (1 << RDX) | \ - (1 << XMM0) | (1 << XMM1))) + (1 << (XMM0+16)) | (1 << (XMM1+16)))) using namespace Gen;