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

Unified Diff: runtime/vm/assembler_arm.h

Issue 12321149: Implements shifted offset register addressing mode for arm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm.h
===================================================================
--- runtime/vm/assembler_arm.h (revision 19091)
+++ runtime/vm/assembler_arm.h (working copy)
@@ -159,6 +159,7 @@
uint32_t encoding_;
friend class Assembler;
+ friend class Address;
};
@@ -200,6 +201,11 @@
class Address : public ValueObject {
public:
+ enum OffsetKind {
+ Immediate,
+ ShiftedRegister,
+ };
+
// Memory operand addressing mode
enum Mode {
// bit encoding P U W
@@ -211,15 +217,19 @@
NegPostIndex = (0|0|0) << 21 // negative post-indexed with writeback
};
- Address(const Address& other) : ValueObject(), encoding_(other.encoding_) { }
+ Address(const Address& other)
+ : ValueObject(), encoding_(other.encoding_), kind_(other.kind_) {
+ }
Address& operator=(const Address& other) {
encoding_ = other.encoding_;
+ kind_ = other.kind_;
return *this;
}
explicit Address(Register rn, int32_t offset = 0, Mode am = Offset) {
ASSERT(Utils::IsAbsoluteUint(12, offset));
+ kind_ = Immediate;
if (offset < 0) {
encoding_ = (am ^ (1 << kUShift)) | -offset; // Flip U to adjust sign.
} else {
@@ -228,6 +238,14 @@
encoding_ |= static_cast<uint32_t>(rn) << kRnShift;
}
+ explicit Address(Register rn, Register rm, Shift shift = LSL,
+ uint32_t shift_imm = 0, Mode am = Offset) {
+ ShifterOperand so(rm, shift, shift_imm);
+
+ kind_ = ShiftedRegister;
+ encoding_ = so.encoding() | am | (static_cast<uint32_t>(rn) << kRnShift);
+ }
+
static bool CanHoldLoadOffset(LoadOperandType type, int offset);
static bool CanHoldStoreOffset(StoreOperandType type, int offset);
@@ -240,8 +258,12 @@
// Encoding for vfp load/store addressing.
uint32_t vencoding() const;
+ OffsetKind kind() const { return kind_; }
+
uint32_t encoding_;
+ OffsetKind kind_;
+
friend class Assembler;
};
« no previous file with comments | « no previous file | runtime/vm/assembler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698