| 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_MIPS_H_ | 5 #ifndef VM_CONSTANTS_MIPS_H_ |
| 6 #define VM_CONSTANTS_MIPS_H_ | 6 #define VM_CONSTANTS_MIPS_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 R23 = 23, | 38 R23 = 23, |
| 39 R24 = 24, | 39 R24 = 24, |
| 40 R25 = 25, | 40 R25 = 25, |
| 41 R26 = 26, | 41 R26 = 26, |
| 42 R27 = 27, | 42 R27 = 27, |
| 43 R28 = 28, | 43 R28 = 28, |
| 44 R29 = 29, | 44 R29 = 29, |
| 45 R30 = 30, | 45 R30 = 30, |
| 46 R31 = 31, | 46 R31 = 31, |
| 47 kNumberOfCpuRegisters = 32, | 47 kNumberOfCpuRegisters = 32, |
| 48 IMM = 32, // Positive value is easier to encode than kNoRegister in bitfield. |
| 48 kNoRegister = -1, | 49 kNoRegister = -1, |
| 49 | 50 |
| 50 // Register aliases. | 51 // Register aliases. |
| 51 ZR = R0, | 52 ZR = R0, |
| 52 AT = R1, | 53 AT = R1, |
| 53 | 54 |
| 54 V0 = R2, | 55 V0 = R2, |
| 55 V1 = R3, | 56 V1 = R3, |
| 56 | 57 |
| 57 A0 = R4, | 58 A0 = R4, |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 const int kDartVolatileCpuRegCount = 14; | 230 const int kDartVolatileCpuRegCount = 14; |
| 230 const Register kDartFirstVolatileCpuReg = R2; | 231 const Register kDartFirstVolatileCpuReg = R2; |
| 231 const Register kDartLastVolatileCpuReg = R15; | 232 const Register kDartLastVolatileCpuReg = R15; |
| 232 | 233 |
| 233 // FPU registers 0 - 19 are not preserved across calls. | 234 // FPU registers 0 - 19 are not preserved across calls. |
| 234 const FRegister kDartFirstVolatileFpuReg = F0; | 235 const FRegister kDartFirstVolatileFpuReg = F0; |
| 235 const FRegister kDartLastVolatileFpuReg = F19; | 236 const FRegister kDartLastVolatileFpuReg = F19; |
| 236 const int kDartVolatileFpuRegCount = 20; | 237 const int kDartVolatileFpuRegCount = 20; |
| 237 | 238 |
| 238 | 239 |
| 239 // Values for the condition field. | 240 // There is no status register on MIPS. Instead of representing a condition |
| 240 // There is no condition field on MIPS, but Conditions are used and passed | 241 // code, type Condition (see assembler_mips.h) represents a pair of operands and |
| 241 // around by the intermediate language, so we need them here, too. | 242 // a relation operator between them. |
| 242 enum Condition { | 243 enum RelationOperator { |
| 244 AL, // always |
| 245 NV, // never |
| 243 EQ, // equal | 246 EQ, // equal |
| 244 NE, // not equal | 247 NE, // not equal |
| 245 GT, // greater than | 248 GT, // greater than |
| 246 GE, // greater equal | 249 GE, // greater equal |
| 247 LT, // less than | 250 LT, // less than |
| 248 LE, // less equal | 251 LE, // less equal |
| 249 VS, // overflow | 252 UGT, // unsigned greater than |
| 253 UGE, // unsigned greater equal |
| 254 ULT, // unsigned less than |
| 255 ULE, // unsigned less equal |
| 250 }; | 256 }; |
| 251 | 257 |
| 252 | 258 |
| 253 // Constants used for the decoding or encoding of the individual fields of | 259 // Constants used for the decoding or encoding of the individual fields of |
| 254 // instructions. Based on the "Table 4.25 CPU Instruction Format Fields". | 260 // instructions. Based on the "Table 4.25 CPU Instruction Format Fields". |
| 255 enum InstructionFields { | 261 enum InstructionFields { |
| 256 kOpcodeShift = 26, | 262 kOpcodeShift = 26, |
| 257 kOpcodeBits = 6, | 263 kOpcodeBits = 6, |
| 258 kRsShift = 21, | 264 kRsShift = 21, |
| 259 kRsBits = 5, | 265 kRsBits = 5, |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 SLLV = 4, | 360 SLLV = 4, |
| 355 SRLV = 6, | 361 SRLV = 6, |
| 356 SRAV = 7, | 362 SRAV = 7, |
| 357 JR = 8, | 363 JR = 8, |
| 358 JALR = 9, | 364 JALR = 9, |
| 359 MOVZ = 10, | 365 MOVZ = 10, |
| 360 MOVN = 11, | 366 MOVN = 11, |
| 361 SYSCALL = 12, | 367 SYSCALL = 12, |
| 362 BREAK = 13, | 368 BREAK = 13, |
| 363 SYNC = 15, | 369 SYNC = 15, |
| 364 MFHI =16, | 370 MFHI = 16, |
| 365 MTHI = 17, | 371 MTHI = 17, |
| 366 MFLO = 18, | 372 MFLO = 18, |
| 367 MTLO = 19, | 373 MTLO = 19, |
| 368 MULT = 24, | 374 MULT = 24, |
| 369 MULTU = 25, | 375 MULTU = 25, |
| 370 DIV = 26, | 376 DIV = 26, |
| 371 DIVU = 27, | 377 DIVU = 27, |
| 372 ADD = 32, | 378 ADD = 32, |
| 373 ADDU = 33, | 379 ADDU = 33, |
| 374 SUB = 34, | 380 SUB = 34, |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 #endif // defined(DEBUG) | 639 #endif // defined(DEBUG) |
| 634 | 640 |
| 635 private: | 641 private: |
| 636 DISALLOW_ALLOCATION(); | 642 DISALLOW_ALLOCATION(); |
| 637 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); | 643 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); |
| 638 }; | 644 }; |
| 639 | 645 |
| 640 } // namespace dart | 646 } // namespace dart |
| 641 | 647 |
| 642 #endif // VM_CONSTANTS_MIPS_H_ | 648 #endif // VM_CONSTANTS_MIPS_H_ |
| OLD | NEW |