Index: src/arm/assembler-arm.cc |
=================================================================== |
--- src/arm/assembler-arm.cc (revision 6683) |
+++ src/arm/assembler-arm.cc (working copy) |
@@ -352,6 +352,11 @@ |
} |
+Condition Assembler::GetCondition(Instr instr) { |
+ return Instruction::ConditionField(instr); |
+} |
+ |
+ |
bool Assembler::IsBranch(Instr instr) { |
return (instr & (B27 | B25)) == (B27 | B25); |
} |
@@ -428,6 +433,20 @@ |
} |
+Register Assembler::GetRn(Instr instr) { |
+ Register reg; |
+ reg.code_ = Instruction::RnValue(instr); |
+ return reg; |
+} |
+ |
+ |
+Register Assembler::GetRm(Instr instr) { |
+ Register reg; |
+ reg.code_ = Instruction::RmValue(instr); |
+ return reg; |
+} |
+ |
+ |
bool Assembler::IsPush(Instr instr) { |
return ((instr & ~kRdMask) == kPushRegPattern); |
} |
@@ -465,6 +484,35 @@ |
} |
+bool Assembler::IsTstImmediate(Instr instr) { |
+ return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask)) == |
+ (I | TST | S); |
+} |
+ |
+ |
+bool Assembler::IsCmpRegister(Instr instr) { |
+ return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask | B4)) == |
+ (CMP | S); |
+} |
+ |
+ |
+bool Assembler::IsCmpImmediate(Instr instr) { |
+ return (instr & (B27 | B26 | I | kOpCodeMask | S | kRdMask)) == |
+ (I | CMP | S); |
+} |
+ |
+ |
+Register Assembler::GetCmpImmediateRegister(Instr instr) { |
+ ASSERT(IsCmpImmediate(instr)); |
+ return GetRn(instr); |
+} |
+ |
+ |
+int Assembler::GetCmpImmediateRawImmediate(Instr instr) { |
+ ASSERT(IsCmpImmediate(instr)); |
+ return instr & kOff12Mask; |
+} |
+ |
// Labels refer to positions in the (to be) generated code. |
// There are bound, linked, and unused labels. |
// |
@@ -1052,6 +1100,13 @@ |
} |
+void Assembler::cmp_raw_immediate( |
+ Register src, int raw_immediate, Condition cond) { |
+ ASSERT(is_uint12(raw_immediate)); |
+ emit(cond | I | CMP | S | src.code() << 16 | raw_immediate); |
+} |
+ |
+ |
void Assembler::cmn(Register src1, const Operand& src2, Condition cond) { |
addrmod1(cond | CMN | S, src1, r0, src2); |
} |
@@ -2363,7 +2418,7 @@ |
bool Assembler::IsNop(Instr instr, int type) { |
- // Check for mov rx, rx. |
+ // Check for mov rx, rx where x = type. |
ASSERT(0 <= type && type <= 14); // mov pc, pc is not a nop. |
return instr == (al | 13*B21 | type*B12 | type); |
} |