summary refs log tree commit diff
path: root/src/rt/arch/x86_64/gpr.cpp
blob: 2533e826d4bd644d312a8a5fc9d9541ffe6adb0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "gpr.h"

#define LOAD(rn) do { \
    uintptr_t tmp; \
    asm("movq %%" #rn ",%0" : "=r" (tmp) :); \
    this->rn = tmp; \
} while (0)

void rust_gpr::load() {
    LOAD(rax); LOAD(rbx); LOAD(rcx); LOAD(rdx);
    LOAD(rsi); LOAD(rdi); LOAD(rbp); LOAD(rsi);
    LOAD(r8);  LOAD(r9);  LOAD(r10); LOAD(r11);
    LOAD(r12); LOAD(r13); LOAD(r14); LOAD(r15);
}