Chromium Code Reviews| Index: src/arm/assembler-arm.cc |
| =================================================================== |
| --- src/arm/assembler-arm.cc (revision 5106) |
| +++ src/arm/assembler-arm.cc (working copy) |
| @@ -445,6 +445,37 @@ |
| } |
| +bool Assembler::IsStrRegisterImmediate(Instr instr) { |
|
Rodolph Perfetta
2010/07/21 14:51:15
Should the name indicate this only returns true fo
Mads Ager (chromium)
2010/07/22 07:29:54
We could do that. I chose this name because it mat
|
| + return (instr & (B27 | B26 | B25 | B22 | B20)) == B26; |
| +} |
| + |
| + |
| +Instr Assembler::SetStrRegisterImmediateOffset(Instr instr, int offset) { |
| + ASSERT(IsStrRegisterImmediate(instr)); |
| + bool positive = offset >= 0; |
| + if (!positive) offset = -offset; |
| + ASSERT(is_uint12(offset)); |
| + // Set bit indicating whether the offset should be added. |
| + instr = (instr & ~B23) | (positive ? B23 : 0); |
| + // Set the actual offset. |
| + return (instr & ~Off12Mask) | offset; |
| +} |
| + |
| + |
| +bool Assembler::IsAddRegisterImmediate(Instr instr) { |
| + return (instr & (B27 | B26 | B25 | B24 | B23 | B22 | B21)) == (B25 | B23); |
| +} |
| + |
| + |
| +Instr Assembler::SetAddRegisterImmediateOffset(Instr instr, int offset) { |
| + ASSERT(IsAddRegisterImmediate(instr)); |
| + ASSERT(offset >= 0); |
| + ASSERT(is_uint12(offset)); |
| + // Set the offset. |
| + return (instr & ~Off12Mask) | offset; |
| +} |
| + |
| + |
| Register Assembler::GetRd(Instr instr) { |
| Register reg; |
| reg.code_ = ((instr & kRdMask) >> kRdShift); |