OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ARM64_CONSTANTS_ARM64_H_ | 5 #ifndef V8_ARM64_CONSTANTS_ARM64_H_ |
6 #define V8_ARM64_CONSTANTS_ARM64_H_ | 6 #define V8_ARM64_CONSTANTS_ARM64_H_ |
7 | 7 |
8 #include "src/base/macros.h" | 8 #include "src/base/macros.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace v8 { | 26 namespace v8 { |
27 namespace internal { | 27 namespace internal { |
28 | 28 |
29 | 29 |
30 const unsigned kInstructionSize = 4; | 30 const unsigned kInstructionSize = 4; |
31 const unsigned kInstructionSizeLog2 = 2; | 31 const unsigned kInstructionSizeLog2 = 2; |
32 const unsigned kLoadLiteralScaleLog2 = 2; | 32 const unsigned kLoadLiteralScaleLog2 = 2; |
33 const unsigned kMaxLoadLiteralRange = 1 * MB; | 33 const unsigned kMaxLoadLiteralRange = 1 * MB; |
34 | 34 |
35 const unsigned kNumberOfRegisters = 32; | 35 const int kNumberOfRegisters = 32; |
36 const unsigned kNumberOfFPRegisters = 32; | 36 const int kNumberOfFPRegisters = 32; |
37 // Callee saved registers are x19-x30(lr). | 37 // Callee saved registers are x19-x30(lr). |
38 const int kNumberOfCalleeSavedRegisters = 11; | 38 const int kNumberOfCalleeSavedRegisters = 11; |
39 const int kFirstCalleeSavedRegisterIndex = 19; | 39 const int kFirstCalleeSavedRegisterIndex = 19; |
40 // Callee saved FP registers are d8-d15. | 40 // Callee saved FP registers are d8-d15. |
41 const int kNumberOfCalleeSavedFPRegisters = 8; | 41 const int kNumberOfCalleeSavedFPRegisters = 8; |
42 const int kFirstCalleeSavedFPRegisterIndex = 8; | 42 const int kFirstCalleeSavedFPRegisterIndex = 8; |
43 // Callee saved registers with no specific purpose in JS are x19-x25. | 43 // Callee saved registers with no specific purpose in JS are x19-x25. |
44 const unsigned kJSCalleeSavedRegList = 0x03f80000; | 44 const unsigned kJSCalleeSavedRegList = 0x03f80000; |
45 // TODO(all): k<Y>RegSize should probably be k<Y>RegSizeInBits. | 45 const int kWRegSizeInBits = 32; |
46 const unsigned kWRegSizeInBits = 32; | 46 const int kWRegSizeInBitsLog2 = 5; |
47 const unsigned kWRegSizeInBitsLog2 = 5; | 47 const int kWRegSize = kWRegSizeInBits >> 3; |
48 const unsigned kWRegSize = kWRegSizeInBits >> 3; | 48 const int kWRegSizeLog2 = kWRegSizeInBitsLog2 - 3; |
49 const unsigned kWRegSizeLog2 = kWRegSizeInBitsLog2 - 3; | 49 const int kXRegSizeInBits = 64; |
50 const unsigned kXRegSizeInBits = 64; | 50 const int kXRegSizeInBitsLog2 = 6; |
51 const unsigned kXRegSizeInBitsLog2 = 6; | 51 const int kXRegSize = kXRegSizeInBits >> 3; |
52 const unsigned kXRegSize = kXRegSizeInBits >> 3; | 52 const int kXRegSizeLog2 = kXRegSizeInBitsLog2 - 3; |
53 const unsigned kXRegSizeLog2 = kXRegSizeInBitsLog2 - 3; | 53 const int kSRegSizeInBits = 32; |
54 const unsigned kSRegSizeInBits = 32; | 54 const int kSRegSizeInBitsLog2 = 5; |
55 const unsigned kSRegSizeInBitsLog2 = 5; | 55 const int kSRegSize = kSRegSizeInBits >> 3; |
56 const unsigned kSRegSize = kSRegSizeInBits >> 3; | 56 const int kSRegSizeLog2 = kSRegSizeInBitsLog2 - 3; |
57 const unsigned kSRegSizeLog2 = kSRegSizeInBitsLog2 - 3; | 57 const int kDRegSizeInBits = 64; |
58 const unsigned kDRegSizeInBits = 64; | 58 const int kDRegSizeInBitsLog2 = 6; |
59 const unsigned kDRegSizeInBitsLog2 = 6; | 59 const int kDRegSize = kDRegSizeInBits >> 3; |
60 const unsigned kDRegSize = kDRegSizeInBits >> 3; | 60 const int kDRegSizeLog2 = kDRegSizeInBitsLog2 - 3; |
61 const unsigned kDRegSizeLog2 = kDRegSizeInBitsLog2 - 3; | |
62 const int64_t kWRegMask = 0x00000000ffffffffL; | 61 const int64_t kWRegMask = 0x00000000ffffffffL; |
63 const int64_t kXRegMask = 0xffffffffffffffffL; | 62 const int64_t kXRegMask = 0xffffffffffffffffL; |
64 const int64_t kSRegMask = 0x00000000ffffffffL; | 63 const int64_t kSRegMask = 0x00000000ffffffffL; |
65 const int64_t kDRegMask = 0xffffffffffffffffL; | 64 const int64_t kDRegMask = 0xffffffffffffffffL; |
66 // TODO(all) check if the expression below works on all compilers or if it | 65 // TODO(all) check if the expression below works on all compilers or if it |
67 // triggers an overflow error. | 66 // triggers an overflow error. |
68 const int64_t kDSignBit = 63; | 67 const int64_t kDSignBit = 63; |
69 const int64_t kDSignMask = 0x1L << kDSignBit; | 68 const int64_t kDSignMask = 0x1L << kDSignBit; |
70 const int64_t kSSignBit = 31; | 69 const int64_t kSSignBit = 31; |
71 const int64_t kSSignMask = 0x1L << kSSignBit; | 70 const int64_t kSSignMask = 0x1L << kSSignBit; |
72 const int64_t kXSignBit = 63; | 71 const int64_t kXSignBit = 63; |
73 const int64_t kXSignMask = 0x1L << kXSignBit; | 72 const int64_t kXSignMask = 0x1L << kXSignBit; |
74 const int64_t kWSignBit = 31; | 73 const int64_t kWSignBit = 31; |
75 const int64_t kWSignMask = 0x1L << kWSignBit; | 74 const int64_t kWSignMask = 0x1L << kWSignBit; |
76 const int64_t kDQuietNanBit = 51; | 75 const int64_t kDQuietNanBit = 51; |
77 const int64_t kDQuietNanMask = 0x1L << kDQuietNanBit; | 76 const int64_t kDQuietNanMask = 0x1L << kDQuietNanBit; |
78 const int64_t kSQuietNanBit = 22; | 77 const int64_t kSQuietNanBit = 22; |
79 const int64_t kSQuietNanMask = 0x1L << kSQuietNanBit; | 78 const int64_t kSQuietNanMask = 0x1L << kSQuietNanBit; |
80 const int64_t kByteMask = 0xffL; | 79 const int64_t kByteMask = 0xffL; |
81 const int64_t kHalfWordMask = 0xffffL; | 80 const int64_t kHalfWordMask = 0xffffL; |
82 const int64_t kWordMask = 0xffffffffL; | 81 const int64_t kWordMask = 0xffffffffL; |
83 const uint64_t kXMaxUInt = 0xffffffffffffffffUL; | 82 const uint64_t kXMaxUInt = 0xffffffffffffffffUL; |
84 const uint64_t kWMaxUInt = 0xffffffffUL; | 83 const uint64_t kWMaxUInt = 0xffffffffUL; |
85 const int64_t kXMaxInt = 0x7fffffffffffffffL; | 84 const int64_t kXMaxInt = 0x7fffffffffffffffL; |
86 const int64_t kXMinInt = 0x8000000000000000L; | 85 const int64_t kXMinInt = 0x8000000000000000L; |
87 const int32_t kWMaxInt = 0x7fffffff; | 86 const int32_t kWMaxInt = 0x7fffffff; |
88 const int32_t kWMinInt = 0x80000000; | 87 const int32_t kWMinInt = 0x80000000; |
89 const unsigned kIp0Code = 16; | 88 const int kIp0Code = 16; |
90 const unsigned kIp1Code = 17; | 89 const int kIp1Code = 17; |
91 const unsigned kFramePointerRegCode = 29; | 90 const int kFramePointerRegCode = 29; |
92 const unsigned kLinkRegCode = 30; | 91 const int kLinkRegCode = 30; |
93 const unsigned kZeroRegCode = 31; | 92 const int kZeroRegCode = 31; |
94 const unsigned kJSSPCode = 28; | 93 const int kJSSPCode = 28; |
95 const unsigned kSPRegInternalCode = 63; | 94 const int kSPRegInternalCode = 63; |
96 const unsigned kRegCodeMask = 0x1f; | 95 const unsigned kRegCodeMask = 0x1f; |
97 const unsigned kShiftAmountWRegMask = 0x1f; | 96 const unsigned kShiftAmountWRegMask = 0x1f; |
98 const unsigned kShiftAmountXRegMask = 0x3f; | 97 const unsigned kShiftAmountXRegMask = 0x3f; |
99 // Standard machine types defined by AAPCS64. | 98 // Standard machine types defined by AAPCS64. |
100 const unsigned kByteSize = 8; | 99 const unsigned kByteSize = 8; |
101 const unsigned kByteSizeInBytes = kByteSize >> 3; | 100 const unsigned kByteSizeInBytes = kByteSize >> 3; |
102 const unsigned kHalfWordSize = 16; | 101 const unsigned kHalfWordSize = 16; |
103 const unsigned kHalfWordSizeLog2 = 4; | 102 const unsigned kHalfWordSizeLog2 = 4; |
104 const unsigned kHalfWordSizeInBytes = kHalfWordSize >> 3; | 103 const unsigned kHalfWordSizeInBytes = kHalfWordSize >> 3; |
105 const unsigned kHalfWordSizeInBytesLog2 = kHalfWordSizeLog2 - 3; | 104 const unsigned kHalfWordSizeInBytesLog2 = kHalfWordSizeLog2 - 3; |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 | 1227 |
1229 enum UnallocatedOp { | 1228 enum UnallocatedOp { |
1230 UnallocatedFixed = 0x00000000, | 1229 UnallocatedFixed = 0x00000000, |
1231 UnallocatedFMask = 0x00000000 | 1230 UnallocatedFMask = 0x00000000 |
1232 }; | 1231 }; |
1233 | 1232 |
1234 } // namespace internal | 1233 } // namespace internal |
1235 } // namespace v8 | 1234 } // namespace v8 |
1236 | 1235 |
1237 #endif // V8_ARM64_CONSTANTS_ARM64_H_ | 1236 #endif // V8_ARM64_CONSTANTS_ARM64_H_ |
OLD | NEW |