OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64_H_ | 5 #ifndef VM_CONSTANTS_ARM64_H_ |
6 #define VM_CONSTANTS_ARM64_H_ | 6 #define VM_CONSTANTS_ARM64_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 kImm3Shift = 10, | 603 kImm3Shift = 10, |
604 kImm3Bits = 3, | 604 kImm3Bits = 3, |
605 kImm6Shift = 10, | 605 kImm6Shift = 10, |
606 kImm6Bits = 6, | 606 kImm6Bits = 6, |
607 kImm8Shift = 13, | 607 kImm8Shift = 13, |
608 kImm8Bits = 8, | 608 kImm8Bits = 8, |
609 kImm9Shift = 12, | 609 kImm9Shift = 12, |
610 kImm9Bits = 9, | 610 kImm9Bits = 9, |
611 kImm12Shift = 10, | 611 kImm12Shift = 10, |
612 kImm12Bits = 12, | 612 kImm12Bits = 12, |
| 613 kImm12Mask = 0xfff << kImm12Shift, |
613 kImm12ShiftShift = 22, | 614 kImm12ShiftShift = 22, |
614 kImm12ShiftBits = 2, | 615 kImm12ShiftBits = 2, |
615 kImm14Shift = 5, | 616 kImm14Shift = 5, |
616 kImm14Bits = 14, | 617 kImm14Bits = 14, |
617 kImm16Shift = 5, | 618 kImm16Shift = 5, |
618 kImm16Bits = 16, | 619 kImm16Bits = 16, |
619 kImm16Mask = 0xffff << kImm16Shift, | 620 kImm16Mask = 0xffff << kImm16Shift, |
620 kImm19Shift = 5, | 621 kImm19Shift = 5, |
621 kImm19Bits = 19, | 622 kImm19Bits = 19, |
622 kImm19Mask = 0x7ffff << kImm19Shift, | 623 kImm19Mask = 0x7ffff << kImm19Shift, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 (static_cast<int32_t>(imm) << kImm16Shift)); | 741 (static_cast<int32_t>(imm) << kImm16Shift)); |
741 } | 742 } |
742 | 743 |
743 inline void SetUnconditionalBranchRegBits( | 744 inline void SetUnconditionalBranchRegBits( |
744 UnconditionalBranchRegOp op, Register rn) { | 745 UnconditionalBranchRegOp op, Register rn) { |
745 SetInstructionBits( | 746 SetInstructionBits( |
746 op | | 747 op | |
747 (static_cast<int32_t>(rn) << kRnShift)); | 748 (static_cast<int32_t>(rn) << kRnShift)); |
748 } | 749 } |
749 | 750 |
| 751 inline void SetImm12Bits(int32_t orig, int32_t imm12) { |
| 752 ASSERT((imm12 & 0xfffff000) == 0); |
| 753 SetInstructionBits((orig & ~kImm12Mask) | (imm12 << kImm12Shift)); |
| 754 } |
| 755 |
750 inline int NField() const { return Bit(22); } | 756 inline int NField() const { return Bit(22); } |
751 inline int SField() const { return Bit(kSShift); } | 757 inline int SField() const { return Bit(kSShift); } |
752 inline int SFField() const { return Bit(kSFShift); } | 758 inline int SFField() const { return Bit(kSFShift); } |
753 inline int SzField() const { return Bits(kSzShift, kSzBits); } | 759 inline int SzField() const { return Bits(kSzShift, kSzBits); } |
754 inline Register RdField() const { return static_cast<Register>( | 760 inline Register RdField() const { return static_cast<Register>( |
755 Bits(kRdShift, kRdBits)); } | 761 Bits(kRdShift, kRdBits)); } |
756 inline Register RnField() const { return static_cast<Register>( | 762 inline Register RnField() const { return static_cast<Register>( |
757 Bits(kRnShift, kRnBits)); } | 763 Bits(kRnShift, kRnBits)); } |
758 inline Register RaField() const { return static_cast<Register>( | 764 inline Register RaField() const { return static_cast<Register>( |
759 Bits(kRaShift, kRaBits)); } | 765 Bits(kRaShift, kRaBits)); } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); } | 945 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); } |
940 | 946 |
941 private: | 947 private: |
942 DISALLOW_ALLOCATION(); | 948 DISALLOW_ALLOCATION(); |
943 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); | 949 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); |
944 }; | 950 }; |
945 | 951 |
946 } // namespace dart | 952 } // namespace dart |
947 | 953 |
948 #endif // VM_CONSTANTS_ARM64_H_ | 954 #endif // VM_CONSTANTS_ARM64_H_ |
OLD | NEW |