2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_JIT_ABI_X64_H_
18 #define incl_HPHP_JIT_ABI_X64_H_
20 #include "hphp/runtime/vm/jit/abi-regs.h"
21 #include "hphp/runtime/vm/jit/phys-reg.h"
23 #include "hphp/util/asm-x64.h"
25 namespace HPHP
{ namespace jit
{
31 ///////////////////////////////////////////////////////////////////////////////
34 * Mirrors the API of abi.h.
37 const Abi
& abi(CodeKind kind
= CodeKind::Trace
);
39 constexpr PhysReg
rvmfp() { return reg::rbp
; }
40 constexpr PhysReg
rvmsp() { return reg::rbx
; }
41 constexpr PhysReg
rvmtl() { return reg::r12
; }
42 constexpr PhysReg
rsp() { return reg::rsp
; }
44 inline RegSet
vm_regs_no_sp() { return rvmfp() | rvmtl(); }
45 inline RegSet
vm_regs_with_sp() { return vm_regs_no_sp() | rvmsp(); }
47 constexpr PhysReg
rret_data() { return reg::rax
; }
48 constexpr PhysReg
rret_type() { return reg::rdx
; }
50 PhysReg
rret(size_t i
= 0);
51 PhysReg
rret_simd(size_t i
);
53 PhysReg
rarg(size_t i
);
54 PhysReg
rarg_simd(size_t i
);
55 PhysReg
rarg_ind_ret(size_t i
);
57 size_t num_arg_regs();
58 size_t num_arg_regs_simd();
59 size_t num_arg_regs_ind_ret();
61 RegSet
arg_regs(size_t n
);
62 RegSet
arg_regs_simd(size_t n
);
63 RegSet
arg_regs_ind_ret(size_t n
);
65 constexpr PhysReg
r_svcreq_req() { return reg::rdi
; }
66 constexpr PhysReg
r_svcreq_stub() { return reg::r10
; }
67 PhysReg
r_svcreq_sf();
68 PhysReg
r_svcreq_arg(size_t i
);
70 ///////////////////////////////////////////////////////////////////////////////
72 inline Vflags
required_flags(jit::ConditionCode cc
) { return 0xff; }
74 ///////////////////////////////////////////////////////////////////////////////