Add a HHIR-level peephole optimization to reorder CheckTypes
[hiphop-php.git] / hphp / util / dwarf-reg.h
blobae4db8d0a95d81007b8517085390e6de4a111743
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
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 HPHP_UTIL_DWARF_REG_H_
18 #define HPHP_UTIL_DWARF_REG_H_
20 #include <cstdint>
22 namespace HPHP { namespace dw_reg {
24 ///////////////////////////////////////////////////////////////////////////////
26 enum class x64 : uint8_t {
27 RAX, RDX, RCX, RBX, RSI, RDI, RBP, RSP,
28 R8, R9, R10, R11, R12, R13, R14, R15, RIP
31 enum class arm : uint8_t {
32 X0, X1, X2, X3, X4, X5, X6, X7,
33 X8, X9, X10, X11, X12, X13, X14, X15,
34 X16, X17, X18, X19, X20, X21, X22, X23,
35 X24, X25, X26, X27, X28, X29, X30, SP
38 constexpr auto FP = static_cast<uint8_t>(
39 #if defined(__x86_64__)
40 x64::RBP
41 #elif defined(__aarch64__)
42 arm::X29
43 #else
45 #endif
48 constexpr auto SP = static_cast<uint8_t>(
49 #if defined(__x86_64__)
50 x64::RSP
51 #elif defined(__aarch64__)
52 arm::SP
53 #else
55 #endif
58 constexpr auto IP = static_cast<uint8_t>(
59 #if defined(__x86_64__)
60 x64::RIP
61 #elif defined(__aarch64__)
62 arm::X30
63 #else
65 #endif
68 ///////////////////////////////////////////////////////////////////////////////
72 #endif