OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC_CONSTANTS_PPC_H_ | 5 #ifndef V8_PPC_CONSTANTS_PPC_H_ |
6 #define V8_PPC_CONSTANTS_PPC_H_ | 6 #define V8_PPC_CONSTANTS_PPC_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
11 #include "src/base/macros.h" | 11 #include "src/base/macros.h" |
12 #include "src/globals.h" | 12 #include "src/globals.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 // Number of registers | 17 // Number of registers |
18 const int kNumRegisters = 32; | 18 const int kNumRegisters = 32; |
19 | 19 |
20 // FP support. | 20 // FP support. |
21 const int kNumFPDoubleRegisters = 32; | 21 const int kNumDoubleRegisters = 32; |
22 const int kNumFPRegisters = kNumFPDoubleRegisters; | |
23 | 22 |
24 const int kNoRegister = -1; | 23 const int kNoRegister = -1; |
25 | 24 |
26 // Used in embedded constant pool builder - max reach in bits for | 25 // Used in embedded constant pool builder - max reach in bits for |
27 // various load instructions (one less due to unsigned) | 26 // various load instructions (one less due to unsigned) |
28 const int kLoadPtrMaxReachBits = 15; | 27 const int kLoadPtrMaxReachBits = 15; |
29 const int kLoadDoubleMaxReachBits = 15; | 28 const int kLoadDoubleMaxReachBits = 15; |
30 | 29 |
31 // sign-extend the least significant 16-bits of value <imm> | 30 // sign-extend the least significant 16-bits of value <imm> |
32 #define SIGN_EXT_IMM16(imm) ((static_cast<int>(imm) << 16) >> 16) | 31 #define SIGN_EXT_IMM16(imm) ((static_cast<int>(imm) << 16) >> 16) |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 | 556 |
558 private: | 557 private: |
559 // We need to prevent the creation of instances of class Instruction. | 558 // We need to prevent the creation of instances of class Instruction. |
560 DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction); | 559 DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction); |
561 }; | 560 }; |
562 | 561 |
563 | 562 |
564 // Helper functions for converting between register numbers and names. | 563 // Helper functions for converting between register numbers and names. |
565 class Registers { | 564 class Registers { |
566 public: | 565 public: |
567 // Return the name of the register. | |
568 static const char* Name(int reg); | |
569 | |
570 // Lookup the register number for the name provided. | |
571 static int Number(const char* name); | |
572 | |
573 struct RegisterAlias { | |
574 int reg; | |
575 const char* name; | |
576 }; | |
577 | |
578 private: | |
579 static const char* names_[kNumRegisters]; | |
580 static const RegisterAlias aliases_[]; | |
581 }; | |
582 | |
583 // Helper functions for converting between FP register numbers and names. | |
584 class FPRegisters { | |
585 public: | |
586 // Return the name of the register. | |
587 static const char* Name(int reg); | |
588 | |
589 // Lookup the register number for the name provided. | 566 // Lookup the register number for the name provided. |
590 static int Number(const char* name); | 567 static int Number(const char* name); |
591 | 568 |
592 private: | 569 private: |
593 static const char* names_[kNumFPRegisters]; | 570 static const char* names_[kNumRegisters]; |
| 571 }; |
| 572 |
| 573 // Helper functions for converting between FP register numbers and names. |
| 574 class DoubleRegisters { |
| 575 public: |
| 576 // Lookup the register number for the name provided. |
| 577 static int Number(const char* name); |
| 578 |
| 579 private: |
| 580 static const char* names_[kNumDoubleRegisters]; |
594 }; | 581 }; |
595 } // namespace internal | 582 } // namespace internal |
596 } // namespace v8 | 583 } // namespace v8 |
597 | 584 |
598 #endif // V8_PPC_CONSTANTS_PPC_H_ | 585 #endif // V8_PPC_CONSTANTS_PPC_H_ |
OLD | NEW |