Skip to content

Commit

Permalink
Merge pull request #923 from FioraAeterna/fixcallersave
Browse files Browse the repository at this point in the history
JIT: Fix caller-save registers on WIN64
  • Loading branch information
comex committed Sep 3, 2014
2 parents e2dfa60 + 6655c77 commit 64575d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Source/Core/Common/x64ABI.h
Expand Up @@ -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

Expand All @@ -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 */)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/JitCommon/JitAsmCommon.cpp
Expand Up @@ -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;

Expand Down

0 comments on commit 64575d5

Please sign in to comment.