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

Unified Diff: runtime/vm/assembler_arm64.h

Issue 242983006: Adds load/store from signed unscaled 9-bit offset w/ no writeback. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/assembler_arm64.cc » ('j') | runtime/vm/disassembler_arm64.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm64.h
===================================================================
--- runtime/vm/assembler_arm64.h (revision 35193)
+++ runtime/vm/assembler_arm64.h (working copy)
@@ -99,14 +99,21 @@
Address(Register rn, int32_t offset = 0, AddressType at = Offset,
OperandSize sz = kDoubleWord) {
ASSERT((rn != R31) && (rn != ZR));
+ ASSERT(CanHoldOffset(offset, at, sz));
const Register crn = ConcreteRegister(rn);
const int32_t scale = Log2OperandSizeBytes(sz);
- if (Utils::IsUint(12 + scale, offset) && (at == Offset)) {
- ASSERT(offset == ((offset >> scale) << scale));
+ if ((at == Offset) &&
+ Utils::IsUint(12 + scale, offset) &&
+ (offset == ((offset >> scale) << scale))) {
encoding_ =
B24 |
((offset >> scale) << kImm12Shift) |
(static_cast<int32_t>(crn) << kRnShift);
+ } else if ((at == Offset) &&
+ Utils::IsInt(9, offset)) {
+ encoding_ =
+ ((offset & 0x1ff) << kImm9Shift) |
+ (static_cast<int32_t>(crn) << kRnShift);
} else {
ASSERT(Utils::IsInt(9, offset));
ASSERT((at == PreIndex) || (at == PostIndex));
@@ -123,10 +130,12 @@
static bool CanHoldOffset(int32_t offset, AddressType at = Offset,
OperandSize sz = kDoubleWord) {
if (at == Offset) {
- // Fits in 12 bit unsigned and right alignment for sz.
+ // Offset fits in 12 bit unsigned and has right alignment for sz,
+ // or fits in 9 bit signed offset with no alignment restriction.
const int32_t scale = Log2OperandSizeBytes(sz);
- return Utils::IsUint(12 + scale, offset) &&
- (offset == ((offset >> scale) << scale));
+ return (Utils::IsUint(12 + scale, offset) &&
+ (offset == ((offset >> scale) << scale))) ||
+ (Utils::IsInt(9, offset));
} else if (at == PCOffset) {
return Utils::IsInt(21, offset) &&
(offset == ((offset >> 2) << 2));
« no previous file with comments | « no previous file | runtime/vm/assembler_arm64.cc » ('j') | runtime/vm/disassembler_arm64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698