]> git.proxmox.com Git - rustc.git/blob - src/rt/arch/x86_64/regs.h
Imported Upstream version 0.6
[rustc.git] / src / rt / arch / x86_64 / regs.h
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #define RUSTRT_RBX 0
12 #define RUSTRT_RSP 1
13 #define RUSTRT_RBP 2
14 // RCX on Windows, RDI elsewhere
15 #define RUSTRT_ARG0 3
16 #define RUSTRT_R12 4
17 #define RUSTRT_R13 5
18 #define RUSTRT_R14 6
19 #define RUSTRT_R15 7
20 #define RUSTRT_IP 8
21 // Not used, just padding
22 #define RUSTRT_XXX 9
23 #define RUSTRT_XMM0 10
24 #define RUSTRT_XMM1 12
25 #define RUSTRT_XMM2 14
26 #define RUSTRT_XMM3 16
27 #define RUSTRT_XMM4 18
28 #define RUSTRT_XMM5 20
29 #define RUSTRT_MAX 22
30
31 // ARG0 is the register in which the first argument goes.
32 // Naturally this depends on your operating system.
33 #if defined(__MINGW32__) || defined(_WINDOWS)
34 # define RUSTRT_ARG0_S %rcx
35 # define RUSTRT_ARG1_S %rdx
36 # define RUSTRT_ARG2_S %r8
37 # define RUSTRT_ARG3_S %r9
38 #else
39 # define RUSTRT_ARG0_S %rdi
40 # define RUSTRT_ARG1_S %rsi
41 # define RUSTRT_ARG2_S %rdx
42 # define RUSTRT_ARG3_S %rcx
43 # define RUSTRT_ARG4_S %r8
44 # define RUSTRT_ARG5_S %r9
45 #endif
46
47