OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_CONSTANTS_ARM_H_ | 5 #ifndef VM_CONSTANTS_ARM_H_ |
6 #define VM_CONSTANTS_ARM_H_ | 6 #define VM_CONSTANTS_ARM_H_ |
7 | 7 |
8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 #error "Exactly one of VFPv3_D16 or VFPv3_D32 can be defined at a time." | 24 #error "Exactly one of VFPv3_D16 or VFPv3_D32 can be defined at a time." |
25 #endif | 25 #endif |
26 | 26 |
27 | 27 |
28 enum Register { | 28 enum Register { |
29 R0 = 0, | 29 R0 = 0, |
30 R1 = 1, | 30 R1 = 1, |
31 R2 = 2, | 31 R2 = 2, |
32 R3 = 3, | 32 R3 = 3, |
33 R4 = 4, | 33 R4 = 4, |
34 R5 = 5, | 34 R5 = 5, // PP |
35 R6 = 6, | 35 R6 = 6, // CTX |
36 R7 = 7, | 36 R7 = 7, // iOS FP |
37 R8 = 8, // THR | 37 R8 = 8, |
38 R9 = 9, // PP | 38 R9 = 9, |
39 R10 = 10, // CTX | 39 R10 = 10, // THR |
40 R11 = 11, // FP | 40 R11 = 11, // Linux FP |
41 R12 = 12, // IP aka TMP | 41 R12 = 12, // IP aka TMP |
42 R13 = 13, // SP | 42 R13 = 13, // SP |
43 R14 = 14, // LR | 43 R14 = 14, // LR |
44 R15 = 15, // PC | 44 R15 = 15, // PC |
45 kNumberOfCpuRegisters = 16, | 45 kNumberOfCpuRegisters = 16, |
46 kNoRegister = -1, // Signals an illegal register. | 46 kNoRegister = -1, // Signals an illegal register. |
47 | 47 |
48 // Aliases. | 48 // Aliases. |
49 FP = R11, | 49 #if defined(TARGET_OS_MACOS) |
| 50 FP = R7, |
| 51 NOTFP = R11, |
| 52 #else |
| 53 FP = R11, |
| 54 NOTFP = R7, |
| 55 #endif |
50 IP = R12, | 56 IP = R12, |
51 SP = R13, | 57 SP = R13, |
52 LR = R14, | 58 LR = R14, |
53 PC = R15, | 59 PC = R15, |
54 }; | 60 }; |
55 | 61 |
56 | 62 |
57 // Values for single-precision floating point registers. | 63 // Values for single-precision floating point registers. |
58 enum SRegister { | 64 enum SRegister { |
59 kNoSRegister = -1, | 65 kNoSRegister = -1, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 260 |
255 | 261 |
256 // List of registers used in load/store multiple. | 262 // List of registers used in load/store multiple. |
257 typedef uint16_t RegList; | 263 typedef uint16_t RegList; |
258 const RegList kAllCpuRegistersList = 0xFFFF; | 264 const RegList kAllCpuRegistersList = 0xFFFF; |
259 | 265 |
260 | 266 |
261 // C++ ABI call registers. | 267 // C++ ABI call registers. |
262 const RegList kAbiArgumentCpuRegs = | 268 const RegList kAbiArgumentCpuRegs = |
263 (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3); | 269 (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3); |
| 270 #if defined(TARGET_OS_MACOS) |
| 271 const RegList kAbiPreservedCpuRegs = |
| 272 (1 << R4) | (1 << R5) | (1 << R6) | (1 << R8) | |
| 273 (1 << R10) | (1 << R11); |
| 274 const int kAbiPreservedCpuRegCount = 6; |
| 275 #else |
264 const RegList kAbiPreservedCpuRegs = | 276 const RegList kAbiPreservedCpuRegs = |
265 (1 << R4) | (1 << R5) | (1 << R6) | (1 << R7) | | 277 (1 << R4) | (1 << R5) | (1 << R6) | (1 << R7) | |
266 (1 << R8) | (1 << R9) | (1 << R10); | 278 (1 << R8) | (1 << R9) | (1 << R10); |
267 const int kAbiPreservedCpuRegCount = 7; | 279 const int kAbiPreservedCpuRegCount = 7; |
| 280 #endif |
268 const QRegister kAbiFirstPreservedFpuReg = Q4; | 281 const QRegister kAbiFirstPreservedFpuReg = Q4; |
269 const QRegister kAbiLastPreservedFpuReg = Q7; | 282 const QRegister kAbiLastPreservedFpuReg = Q7; |
270 const int kAbiPreservedFpuRegCount = 4; | 283 const int kAbiPreservedFpuRegCount = 4; |
271 | 284 |
272 const RegList kReservedCpuRegisters = | 285 const RegList kReservedCpuRegisters = |
273 (1 << SPREG) | | 286 (1 << SPREG) | |
274 (1 << FPREG) | | 287 (1 << FPREG) | |
275 (1 << TMP) | | 288 (1 << TMP) | |
276 (1 << PP) | | 289 (1 << PP) | |
277 (1 << THR) | | 290 (1 << THR) | |
278 (1 << PC); | 291 (1 << PC); |
279 // CPU registers available to Dart allocator. | 292 // CPU registers available to Dart allocator. |
280 const RegList kDartAvailableCpuRegs = | 293 const RegList kDartAvailableCpuRegs = |
281 kAllCpuRegistersList & ~kReservedCpuRegisters; | 294 kAllCpuRegistersList & ~kReservedCpuRegisters; |
282 // Registers available to Dart that are not preserved by runtime calls. | 295 // Registers available to Dart that are not preserved by runtime calls. |
283 const RegList kDartVolatileCpuRegs = | 296 const RegList kDartVolatileCpuRegs = |
284 kDartAvailableCpuRegs & ~kAbiPreservedCpuRegs; | 297 kDartAvailableCpuRegs & ~kAbiPreservedCpuRegs; |
| 298 #if defined(TARGET_OS_MACOS) |
| 299 const int kDartVolatileCpuRegCount = 6; |
| 300 #else |
285 const int kDartVolatileCpuRegCount = 5; | 301 const int kDartVolatileCpuRegCount = 5; |
| 302 #endif |
286 const QRegister kDartFirstVolatileFpuReg = Q0; | 303 const QRegister kDartFirstVolatileFpuReg = Q0; |
287 const QRegister kDartLastVolatileFpuReg = Q3; | 304 const QRegister kDartLastVolatileFpuReg = Q3; |
288 const int kDartVolatileFpuRegCount = 4; | 305 const int kDartVolatileFpuRegCount = 4; |
289 | 306 |
290 | 307 |
291 // Values for the condition field as defined in section A3.2. | 308 // Values for the condition field as defined in section A3.2. |
292 enum Condition { | 309 enum Condition { |
293 kNoCondition = -1, | 310 kNoCondition = -1, |
294 EQ = 0, // equal | 311 EQ = 0, // equal |
295 NE = 1, // not equal | 312 NE = 1, // not equal |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); } | 728 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); } |
712 | 729 |
713 private: | 730 private: |
714 DISALLOW_ALLOCATION(); | 731 DISALLOW_ALLOCATION(); |
715 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); | 732 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); |
716 }; | 733 }; |
717 | 734 |
718 } // namespace dart | 735 } // namespace dart |
719 | 736 |
720 #endif // VM_CONSTANTS_ARM_H_ | 737 #endif // VM_CONSTANTS_ARM_H_ |
OLD | NEW |