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

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

Issue 1722013002: Enable concurrent sweep on MIPS and ARM64. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: clrex and assembler tests Created 4 years, 9 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 | « no previous file | runtime/vm/assembler_arm64_test.cc » ('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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 (a.type() == Address::PairPreIndex)); 750 (a.type() == Address::PairPreIndex));
751 EmitLoadStoreRegPair(LDP, rt, rt2, a, sz); 751 EmitLoadStoreRegPair(LDP, rt, rt2, a, sz);
752 } 752 }
753 void stp(Register rt, Register rt2, Address a, OperandSize sz = kDoubleWord) { 753 void stp(Register rt, Register rt2, Address a, OperandSize sz = kDoubleWord) {
754 ASSERT((a.type() == Address::PairOffset) || 754 ASSERT((a.type() == Address::PairOffset) ||
755 (a.type() == Address::PairPostIndex) || 755 (a.type() == Address::PairPostIndex) ||
756 (a.type() == Address::PairPreIndex)); 756 (a.type() == Address::PairPreIndex));
757 EmitLoadStoreRegPair(STP, rt, rt2, a, sz); 757 EmitLoadStoreRegPair(STP, rt, rt2, a, sz);
758 } 758 }
759 759
760 void ldxr(Register rt, Register rn) {
761 // rt = value
762 // rn = address
763 EmitLoadStoreExclusive(LDXR, R31, rn, rt, kDoubleWord);
764 }
765 void stxr(Register rs, Register rt, Register rn) {
766 // rs = status (1 = failure, 0 = success)
767 // rt = value
768 // rn = address
769 EmitLoadStoreExclusive(STXR, rs, rn, rt, kDoubleWord);
770 }
771 void clrex() {
772 const int32_t encoding = static_cast<int32_t>(CLREX);
773 Emit(encoding);
774 }
775
760 // Conditional select. 776 // Conditional select.
761 void csel(Register rd, Register rn, Register rm, Condition cond) { 777 void csel(Register rd, Register rn, Register rm, Condition cond) {
762 EmitConditionalSelect(CSEL, rd, rn, rm, cond, kDoubleWord); 778 EmitConditionalSelect(CSEL, rd, rn, rm, cond, kDoubleWord);
763 } 779 }
764 void csinc(Register rd, Register rn, Register rm, Condition cond) { 780 void csinc(Register rd, Register rn, Register rm, Condition cond) {
765 EmitConditionalSelect(CSINC, rd, rn, rm, cond, kDoubleWord); 781 EmitConditionalSelect(CSINC, rd, rn, rm, cond, kDoubleWord);
766 } 782 }
767 void cinc(Register rd, Register rn, Condition cond) { 783 void cinc(Register rd, Register rn, Condition cond) {
768 csinc(rd, rn, rn, InvertCondition(cond)); 784 csinc(rd, rn, rn, InvertCondition(cond));
769 } 785 }
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord)); 1728 ASSERT((sz == kDoubleWord) || (sz == kWord) || (sz == kUnsignedWord));
1713 const int32_t size = (sz == kDoubleWord) ? B31 : 0; 1729 const int32_t size = (sz == kDoubleWord) ? B31 : 0;
1714 const int32_t encoding = 1730 const int32_t encoding =
1715 op | size | 1731 op | size |
1716 (static_cast<int32_t>(rd) << kRdShift) | 1732 (static_cast<int32_t>(rd) << kRdShift) |
1717 (static_cast<int32_t>(hw_idx) << kHWShift) | 1733 (static_cast<int32_t>(hw_idx) << kHWShift) |
1718 (static_cast<int32_t>(imm.value() & 0xffff) << kImm16Shift); 1734 (static_cast<int32_t>(imm.value() & 0xffff) << kImm16Shift);
1719 Emit(encoding); 1735 Emit(encoding);
1720 } 1736 }
1721 1737
1738 void EmitLoadStoreExclusive(LoadStoreExclusiveOp op, Register rs, Register rn,
1739 Register rt, OperandSize sz = kDoubleWord) {
1740 ASSERT(sz == kDoubleWord);
1741 const int32_t size = B31 | B30;
1742
1743 ASSERT((rs != kNoRegister) && (rs != ZR));
1744 ASSERT((rn != kNoRegister) && (rn != ZR));
1745 ASSERT((rt != kNoRegister) && (rt != ZR));
1746
1747 const int32_t encoding =
1748 op | size |
1749 (static_cast<int32_t>(ConcreteRegister(rs)) << kRsShift) |
1750 (static_cast<int32_t>(ConcreteRegister(rn)) << kRnShift) |
1751 (static_cast<int32_t>(ConcreteRegister(rt)) << kRtShift);
1752
1753 Emit(encoding);
1754 }
1755
1722 void EmitLoadStoreReg(LoadStoreRegOp op, Register rt, Address a, 1756 void EmitLoadStoreReg(LoadStoreRegOp op, Register rt, Address a,
1723 OperandSize sz) { 1757 OperandSize sz) {
1724 const Register crt = ConcreteRegister(rt); 1758 const Register crt = ConcreteRegister(rt);
1725 const int32_t size = Log2OperandSizeBytes(sz); 1759 const int32_t size = Log2OperandSizeBytes(sz);
1726 const int32_t encoding = 1760 const int32_t encoding =
1727 op | ((size & 0x3) << kSzShift) | 1761 op | ((size & 0x3) << kSzShift) |
1728 (static_cast<int32_t>(crt) << kRtShift) | 1762 (static_cast<int32_t>(crt) << kRtShift) |
1729 a.encoding(); 1763 a.encoding();
1730 Emit(encoding); 1764 Emit(encoding);
1731 } 1765 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 Register value, 1966 Register value,
1933 Label* no_update); 1967 Label* no_update);
1934 1968
1935 DISALLOW_ALLOCATION(); 1969 DISALLOW_ALLOCATION();
1936 DISALLOW_COPY_AND_ASSIGN(Assembler); 1970 DISALLOW_COPY_AND_ASSIGN(Assembler);
1937 }; 1971 };
1938 1972
1939 } // namespace dart 1973 } // namespace dart
1940 1974
1941 #endif // VM_ASSEMBLER_ARM64_H_ 1975 #endif // VM_ASSEMBLER_ARM64_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698