diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-11-28 15:00:02 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-11-28 16:03:28 +0000 |
commit | 3bcc8ea079d867f26622defd0611d134a3b4ae49 (patch) | |
tree | a1f3f3ad3ec1284d199eee6e57889b8c1e90b619 /compiler/optimizing/code_generator_arm.cc | |
parent | eea79dd779ba199658ada7264f8f96d776e53f19 (diff) | |
download | android_art-3bcc8ea079d867f26622defd0611d134a3b4ae49.tar.gz android_art-3bcc8ea079d867f26622defd0611d134a3b4ae49.tar.bz2 android_art-3bcc8ea079d867f26622defd0611d134a3b4ae49.zip |
Don't use CanHoldArm in the code generator.
CanHoldArm was ARM32 specific. Instead use a virtual
Assembler::ShifterOperandCanHold that both thumb2 and arm32
implement.
Change-Id: I33794a93caf02ee5d78d32a8471d9fd6fe4f0a00
Diffstat (limited to 'compiler/optimizing/code_generator_arm.cc')
-rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index 7d6d827386..dc861144ca 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -949,20 +949,20 @@ void InstructionCodeGeneratorARM::VisitIf(HIf* if_instr) { // Condition has not been materialized, use its inputs as the // comparison and its condition as the branch condition. LocationSummary* locations = cond->GetLocations(); + Register left = locations->InAt(0).AsRegister<Register>(); if (locations->InAt(1).IsRegister()) { - __ cmp(locations->InAt(0).AsRegister<Register>(), - ShifterOperand(locations->InAt(1).AsRegister<Register>())); + __ cmp(left, ShifterOperand(locations->InAt(1).AsRegister<Register>())); } else { DCHECK(locations->InAt(1).IsConstant()); int32_t value = locations->InAt(1).GetConstant()->AsIntConstant()->GetValue(); ShifterOperand operand; - if (ShifterOperand::CanHoldArm(value, &operand)) { - __ cmp(locations->InAt(0).AsRegister<Register>(), ShifterOperand(value)); + if (GetAssembler()->ShifterOperandCanHold(R0, left, CMP, value, &operand)) { + __ cmp(left, operand); } else { Register temp = IP; __ LoadImmediate(temp, value); - __ cmp(locations->InAt(0).AsRegister<Register>(), ShifterOperand(temp)); + __ cmp(left, ShifterOperand(temp)); } } __ b(codegen_->GetLabelOf(if_instr->IfTrueSuccessor()), @@ -988,21 +988,21 @@ void LocationsBuilderARM::VisitCondition(HCondition* comp) { void InstructionCodeGeneratorARM::VisitCondition(HCondition* comp) { if (!comp->NeedsMaterialization()) return; - LocationSummary* locations = comp->GetLocations(); + Register left = locations->InAt(0).AsRegister<Register>(); + if (locations->InAt(1).IsRegister()) { - __ cmp(locations->InAt(0).AsRegister<Register>(), - ShifterOperand(locations->InAt(1).AsRegister<Register>())); + __ cmp(left, ShifterOperand(locations->InAt(1).AsRegister<Register>())); } else { DCHECK(locations->InAt(1).IsConstant()); int32_t value = locations->InAt(1).GetConstant()->AsIntConstant()->GetValue(); ShifterOperand operand; - if (ShifterOperand::CanHoldArm(value, &operand)) { - __ cmp(locations->InAt(0).AsRegister<Register>(), ShifterOperand(value)); + if (GetAssembler()->ShifterOperandCanHold(R0, left, CMP, value, &operand)) { + __ cmp(left, operand); } else { Register temp = IP; __ LoadImmediate(temp, value); - __ cmp(locations->InAt(0).AsRegister<Register>(), ShifterOperand(temp)); + __ cmp(left, ShifterOperand(temp)); } } __ it(ARMCondition(comp->GetCondition()), kItElse); |