x64 backend: Save nonvolatile XMM registers on host -> guest transitions

Define the context and membase registers in the x64 emitter.
This commit is contained in:
Dr. Chat
2016-08-22 14:55:16 -05:00
parent e3fdb08ad7
commit 5f4416ee2f
5 changed files with 139 additions and 139 deletions

View File

@@ -29,68 +29,68 @@ namespace x64 {
* | |
* | |
* +------------------+
* | scratch, 16b | rsp + 32
* | scratch, 16b | rsp + 24
* | |
* +------------------+
* | rbx | rsp + 48
* | rbx | rsp + 40
* +------------------+
* | rcx / context | rsp + 56
* | rcx / context | rsp + 48
* +------------------+
* | rbp | rsp + 64
* | rbp | rsp + 56
* +------------------+
* | rsi | rsp + 72
* | rsi | rsp + 64
* +------------------+
* | rdi | rsp + 80
* | rdi | rsp + 72
* +------------------+
* | r12 | rsp + 88
* | r12 | rsp + 80
* +------------------+
* | r13 | rsp + 96
* | r13 | rsp + 88
* +------------------+
* | r14 | rsp + 104
* | r14 | rsp + 96
* +------------------+
* | r15 | rsp + 112
* | r15 | rsp + 104
* +------------------+
* | (return address) | rsp + 120
* | xmm6/0 | rsp + 112
* | |
* +------------------+
* | (rcx home) | rsp + 128
* | xmm7/1 | rsp + 128
* | |
* +------------------+
* | (rdx home) | rsp + 136
* | xmm8/2 | rsp + 144
* | |
* +------------------+
* | xmm9/3 | rsp + 160
* | |
* +------------------+
* | xmm10/4 | rsp + 176
* | |
* +------------------+
* | xmm11/5 | rsp + 192
* | |
* +------------------+
* | xmm12 | rsp + 208
* | |
* +------------------+
* | xmm13 | rsp + 224
* | |
* +------------------+
* | xmm14 | rsp + 240
* | |
* +------------------+
* | xmm15 | rsp + 256
* | |
* +------------------+
* | scratch, 8b | rsp + 272
* | |
* +------------------+
* | (return address) | rsp + 280
* +------------------+
* | (rcx home) | rsp + 288
* +------------------+
* | (rdx home) | rsp + 296
* +------------------+
*
*
* TODO:
* +------------------+
* | xmm6 | rsp + 128
* | |
* +------------------+
* | xmm7 | rsp + 144
* | |
* +------------------+
* | xmm8 | rsp + 160
* | |
* +------------------+
* | xmm9 | rsp + 176
* | |
* +------------------+
* | xmm10 | rsp + 192
* | |
* +------------------+
* | xmm11 | rsp + 208
* | |
* +------------------+
* | xmm12 | rsp + 224
* | |
* +------------------+
* | xmm13 | rsp + 240
* | |
* +------------------+
* | xmm14 | rsp + 256
* | |
* +------------------+
* | xmm15 | rsp + 272
* | |
* +------------------+
*
* Guest stack:
* +------------------+
* | arg temp, 3 * 8 | rsp + 0
@@ -115,10 +115,10 @@ namespace x64 {
class StackLayout {
public:
static const size_t THUNK_STACK_SIZE = 120;
static const size_t THUNK_STACK_SIZE = 280;
static const size_t GUEST_STACK_SIZE = 104;
static const size_t GUEST_RCX_HOME = 80;
static const size_t GUEST_CTX_HOME = 80;
static const size_t GUEST_RET_ADDR = 88;
static const size_t GUEST_CALL_RET_ADDR = 96;
};