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

Unified Diff: runtime/vm/assembler_arm.h

Issue 593363003: Expands the use of Immediate and Operand wrappers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 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 40903)
+++ runtime/vm/assembler_arm.h (working copy)
@@ -231,6 +231,10 @@
encoding_ |= static_cast<uint32_t>(rn) << kRnShift;
}
+ // There is no register offset mode unless Mode is Offset, in which case the
+ // shifted register case below should be used.
+ Address(Register rn, Register r, Mode am);
+
Address(Register rn, Register rm,
Shift shift = LSL, uint32_t shift_imm = 0, Mode am = Offset) {
Operand o(rm, shift, shift_imm);
@@ -243,6 +247,9 @@
encoding_ = o.encoding() | am | (static_cast<uint32_t>(rn) << kRnShift);
}
+ // There is no shifted register mode with a register shift.
+ Address(Register rn, Register rm, Shift shift, Register r, Mode am = Offset);
+
static OperandSize OperandSizeFor(intptr_t cid);
static bool CanHoldLoadOffset(OperandSize size,
@@ -279,6 +286,9 @@
FieldAddress(Register base, int32_t disp)
: Address(base, disp - kHeapObjectTag) { }
+ // This addressing mode does not exist.
+ FieldAddress(Register base, Register r);
+
FieldAddress(const FieldAddress& other) : Address(other) { }
FieldAddress& operator=(const FieldAddress& other) {
@@ -396,8 +406,6 @@
// Miscellaneous data-processing instructions.
void clz(Register rd, Register rm, Condition cond = AL);
- void movw(Register rd, uint16_t imm16, Condition cond = AL);
- void movt(Register rd, uint16_t imm16, Condition cond = AL);
// Multiply instructions.
void mul(Register rd, Register rn, Register rm, Condition cond = AL);
@@ -717,14 +725,19 @@
// Convenience shift instructions. Use mov instruction with shifter operand
// for variants setting the status flags.
- void Lsl(Register rd, Register rm, uint32_t shift_imm, Condition cond = AL);
+ void Lsl(Register rd, Register rm, const Operand& shift_imm,
+ Condition cond = AL);
void Lsl(Register rd, Register rm, Register rs, Condition cond = AL);
- void Lsr(Register rd, Register rm, uint32_t shift_imm, Condition cond = AL);
+ void Lsr(Register rd, Register rm, const Operand& shift_imm,
+ Condition cond = AL);
void Lsr(Register rd, Register rm, Register rs, Condition cond = AL);
- void Asr(Register rd, Register rm, uint32_t shift_imm, Condition cond = AL);
+ void Asr(Register rd, Register rm, const Operand& shift_imm,
+ Condition cond = AL);
void Asr(Register rd, Register rm, Register rs, Condition cond = AL);
- void Asrs(Register rd, Register rm, uint32_t shift_imm, Condition cond = AL);
- void Ror(Register rd, Register rm, uint32_t shift_imm, Condition cond = AL);
+ void Asrs(Register rd, Register rm, const Operand& shift_imm,
+ Condition cond = AL);
+ void Ror(Register rd, Register rm, const Operand& shift_imm,
+ Condition cond = AL);
void Ror(Register rd, Register rm, Register rs, Condition cond = AL);
void Rrx(Register rd, Register rm, Condition cond = AL);
@@ -738,19 +751,19 @@
void Vdivqs(QRegister qd, QRegister qn, QRegister qm);
void SmiTag(Register reg, Condition cond = AL) {
- Lsl(reg, reg, kSmiTagSize, cond);
+ Lsl(reg, reg, Operand(kSmiTagSize), cond);
}
void SmiTag(Register dst, Register src, Condition cond = AL) {
- Lsl(dst, src, kSmiTagSize, cond);
+ Lsl(dst, src, Operand(kSmiTagSize), cond);
}
void SmiUntag(Register reg, Condition cond = AL) {
- Asr(reg, reg, kSmiTagSize, cond);
+ Asr(reg, reg, Operand(kSmiTagSize), cond);
}
void SmiUntag(Register dst, Register src, Condition cond = AL) {
- Asr(dst, src, kSmiTagSize, cond);
+ Asr(dst, src, Operand(kSmiTagSize), cond);
}
// Untag the value in the register assuming it is a smi.
@@ -759,7 +772,7 @@
// Otherwise fall-through.
void SmiUntag(Register dst, Register src, Label* is_smi) {
ASSERT(kSmiTagSize == 1);
- Asrs(dst, src, kSmiTagSize);
+ Asrs(dst, src, Operand(kSmiTagSize));
b(is_smi, CC);
}
@@ -870,6 +883,11 @@
bool use_far_branches_;
+ // If you are thinking of using one or both of these instructions directly,
+ // instead LoadImmediate should probably be used.
+ void movw(Register rd, uint16_t imm16, Condition cond = AL);
+ void movt(Register rd, uint16_t imm16, Condition cond = AL);
+
int32_t AddObject(const Object& obj);
int32_t AddExternalLabel(const ExternalLabel* label);
« 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