Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(945)

Side by Side Diff: runtime/vm/assembler_arm64.h

Issue 1367973002: VM: Initialize Instruction objects with break instructions instead of null. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/assembler_ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ASSEMBLER_ARM64_H_ 5 #ifndef VM_ASSEMBLER_ARM64_H_
6 #define VM_ASSEMBLER_ARM64_H_ 6 #define VM_ASSEMBLER_ARM64_H_
7 7
8 #ifndef VM_ASSEMBLER_H_ 8 #ifndef VM_ASSEMBLER_H_
9 #error Do not include assembler_arm64.h directly; use assembler.h instead. 9 #error Do not include assembler_arm64.h directly; use assembler.h instead.
10 #endif 10 #endif
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 } 831 }
832 void ret(Register rn = R30) { 832 void ret(Register rn = R30) {
833 EmitUnconditionalBranchRegOp(RET, rn); 833 EmitUnconditionalBranchRegOp(RET, rn);
834 } 834 }
835 835
836 // Breakpoint. 836 // Breakpoint.
837 void brk(uint16_t imm) { 837 void brk(uint16_t imm) {
838 EmitExceptionGenOp(BRK, imm); 838 EmitExceptionGenOp(BRK, imm);
839 } 839 }
840 840
841 static uword GetBreakInstructionFiller() {
842 const intptr_t encoding = ExceptionGenOpEncoding(BRK, 0);
843 return encoding << 32 | encoding;
844 }
845
841 // Double floating point. 846 // Double floating point.
842 bool fmovdi(VRegister vd, double immd) { 847 bool fmovdi(VRegister vd, double immd) {
843 int64_t imm64 = bit_cast<int64_t, double>(immd); 848 int64_t imm64 = bit_cast<int64_t, double>(immd);
844 const uint8_t bit7 = imm64 >> 63; 849 const uint8_t bit7 = imm64 >> 63;
845 const uint8_t bit6 = (~(imm64 >> 62)) & 0x1; 850 const uint8_t bit6 = (~(imm64 >> 62)) & 0x1;
846 const uint8_t bit54 = (imm64 >> 52) & 0x3; 851 const uint8_t bit54 = (imm64 >> 52) & 0x3;
847 const uint8_t bit30 = (imm64 >> 48) & 0xf; 852 const uint8_t bit30 = (imm64 >> 48) & 0xf;
848 const uint8_t imm8 = (bit7 << 7) | (bit6 << 6) | (bit54 << 4) | bit30; 853 const uint8_t imm8 = (bit7 << 7) | (bit6 << 6) | (bit54 << 4) | bit30;
849 const int64_t expimm8 = Instr::VFPExpandImm(imm8); 854 const int64_t expimm8 = Instr::VFPExpandImm(imm8);
850 if (imm64 != expimm8) { 855 if (imm64 != expimm8) {
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 } 1686 }
1682 1687
1683 void EmitUnconditionalBranchRegOp(UnconditionalBranchRegOp op, Register rn) { 1688 void EmitUnconditionalBranchRegOp(UnconditionalBranchRegOp op, Register rn) {
1684 ASSERT((rn != CSP) && (rn != R31)); 1689 ASSERT((rn != CSP) && (rn != R31));
1685 const Register crn = ConcreteRegister(rn); 1690 const Register crn = ConcreteRegister(rn);
1686 const int32_t encoding = 1691 const int32_t encoding =
1687 op | (static_cast<int32_t>(crn) << kRnShift); 1692 op | (static_cast<int32_t>(crn) << kRnShift);
1688 Emit(encoding); 1693 Emit(encoding);
1689 } 1694 }
1690 1695
1696 static int32_t ExceptionGenOpEncoding(ExceptionGenOp op, uint16_t imm) {
1697 return op | (static_cast<int32_t>(imm) << kImm16Shift);
1698 }
1699
1691 void EmitExceptionGenOp(ExceptionGenOp op, uint16_t imm) { 1700 void EmitExceptionGenOp(ExceptionGenOp op, uint16_t imm) {
1692 const int32_t encoding = 1701 Emit(ExceptionGenOpEncoding(op, imm));
1693 op | (static_cast<int32_t>(imm) << kImm16Shift);
1694 Emit(encoding);
1695 } 1702 }
1696 1703
1697 void EmitMoveWideOp(MoveWideOp op, Register rd, const Immediate& imm, 1704 void EmitMoveWideOp(MoveWideOp op, Register rd, const Immediate& imm,
1698 int hw_idx, OperandSize sz) { 1705 int hw_idx, OperandSize sz) {
1699 ASSERT((hw_idx >= 0) && (hw_idx <= 3)); 1706 ASSERT((hw_idx >= 0) && (hw_idx <= 3));
1700 ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord)); 1707 ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
1701 const int32_t size = (sz == kDoubleWord) ? B31 : 0; 1708 const int32_t size = (sz == kDoubleWord) ? B31 : 0;
1702 const int32_t encoding = 1709 const int32_t encoding =
1703 op | size | 1710 op | size |
1704 (static_cast<int32_t>(rd) << kRdShift) | 1711 (static_cast<int32_t>(rd) << kRdShift) |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 Register value, 1927 Register value,
1921 Label* no_update); 1928 Label* no_update);
1922 1929
1923 DISALLOW_ALLOCATION(); 1930 DISALLOW_ALLOCATION();
1924 DISALLOW_COPY_AND_ASSIGN(Assembler); 1931 DISALLOW_COPY_AND_ASSIGN(Assembler);
1925 }; 1932 };
1926 1933
1927 } // namespace dart 1934 } // namespace dart
1928 1935
1929 #endif // VM_ASSEMBLER_ARM64_H_ 1936 #endif // VM_ASSEMBLER_ARM64_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698