Index: src/arm/macro-assembler-arm.cc |
=================================================================== |
--- src/arm/macro-assembler-arm.cc (revision 5768) |
+++ src/arm/macro-assembler-arm.cc (working copy) |
@@ -220,20 +220,20 @@ |
void MacroAssembler::And(Register dst, Register src1, const Operand& src2, |
Condition cond) { |
- if (!CpuFeatures::IsSupported(ARMv7) || src2.is_single_instruction()) { |
+ if (!src2.is_reg() && |
+ !src2.must_use_constant_pool() && |
+ src2.immediate() == 0) { |
+ mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond); |
+ |
+ } else if (!src2.is_single_instruction() && |
+ !src2.must_use_constant_pool() && |
+ CpuFeatures::IsSupported(ARMv7) && |
+ IsPowerOf2(src2.immediate() + 1)) { |
+ ubfx(dst, src1, 0, WhichPowerOf2(src2.immediate() + 1), cond); |
+ |
+ } else { |
and_(dst, src1, src2, LeaveCC, cond); |
- return; |
} |
- int32_t immediate = src2.immediate(); |
- if (immediate == 0) { |
- mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond); |
- return; |
- } |
- if (IsPowerOf2(immediate + 1) && ((immediate & 1) != 0)) { |
- ubfx(dst, src1, 0, WhichPowerOf2(immediate + 1), cond); |
- return; |
- } |
- and_(dst, src1, src2, LeaveCC, cond); |
} |