Chromium Code Reviews| Index: src/arm/assembler-arm.cc |
| =================================================================== |
| --- src/arm/assembler-arm.cc (revision 6683) |
| +++ src/arm/assembler-arm.cc (working copy) |
| @@ -352,6 +352,10 @@ |
| } |
| +Condition Assembler::GetCondition(Instr instr) { |
|
Alexandre
2011/02/09 13:57:16
Same as Instruction::ConditionField(). Do we want
Søren Thygesen Gjesse
2011/02/09 14:48:28
This now calls Instruction::ConditionField()
|
| + return static_cast<Condition>(instr & kConditionMask); |
| +} |
| + |
| bool Assembler::IsBranch(Instr instr) { |
| return (instr & (B27 | B25)) == (B27 | B25); |
| } |
| @@ -428,6 +432,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 +483,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; |
| +} |
| + |
|
Alexandre
2011/02/09 13:57:16
Not sure, but should we move these to the Instruct
Søren Thygesen Gjesse
2011/02/09 14:48:28
I think it will be fine to have these in the Instr
|
| // Labels refer to positions in the (to be) generated code. |
| // There are bound, linked, and unused labels. |
| // |
| @@ -1052,6 +1099,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 +2417,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); |
| } |