diff options
author | Calin Juravle <calin@google.com> | 2014-11-26 19:01:09 +0000 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2014-11-26 19:01:09 +0000 |
commit | 91debbc3da3e3376416e4394155d9f9e355255cb (patch) | |
tree | fd2181a2d4b8e7e8d26101a9a87b4f0c34fa990f /compiler/optimizing/code_generator_arm.cc | |
parent | fd861249f31ab360c12dd1ffb131d50f02b0bfc6 (diff) | |
download | android_art-91debbc3da3e3376416e4394155d9f9e355255cb.tar.gz android_art-91debbc3da3e3376416e4394155d9f9e355255cb.tar.bz2 android_art-91debbc3da3e3376416e4394155d9f9e355255cb.zip |
Revert "[optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}"
Fails on arm due to missing vmrs op after vcmp. I revert this instead of pushing the fix because I don't understand yet why it compiles with run-test but not with dex2oat.
This reverts commit fd861249f31ab360c12dd1ffb131d50f02b0bfc6.
Change-Id: Idc2d30f6a0f39ddd3596aa18a532ae90f8aaf62f
Diffstat (limited to 'compiler/optimizing/code_generator_arm.cc')
-rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 71 |
1 files changed, 22 insertions, 49 deletions
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index df65ff054e..890cfdd0e6 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -2292,71 +2292,44 @@ void InstructionCodeGeneratorARM::VisitNot(HNot* not_) { void LocationsBuilderARM::VisitCompare(HCompare* compare) { LocationSummary* locations = new (GetGraph()->GetArena()) LocationSummary(compare, LocationSummary::kNoCall); - switch (compare->InputAt(0)->GetType()) { - case Primitive::kPrimLong: { - locations->SetInAt(0, Location::RequiresRegister()); - locations->SetInAt(1, Location::RequiresRegister()); - locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap); - break; - } - case Primitive::kPrimFloat: - case Primitive::kPrimDouble: { - locations->SetInAt(0, Location::RequiresFpuRegister()); - locations->SetInAt(1, Location::RequiresFpuRegister()); - locations->SetOut(Location::RequiresRegister()); - break; - } - default: - LOG(FATAL) << "Unexpected type for compare operation " << compare->InputAt(0)->GetType(); - } + locations->SetInAt(0, Location::RequiresRegister()); + locations->SetInAt(1, Location::RequiresRegister()); + locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap); } void InstructionCodeGeneratorARM::VisitCompare(HCompare* compare) { LocationSummary* locations = compare->GetLocations(); - Register out = locations->Out().As<Register>(); - Location left = locations->InAt(0); - Location right = locations->InAt(1); - - Label less, greater, done; switch (compare->InputAt(0)->GetType()) { case Primitive::kPrimLong: { + Register output = locations->Out().As<Register>(); + Location left = locations->InAt(0); + Location right = locations->InAt(1); + Label less, greater, done; __ cmp(left.AsRegisterPairHigh<Register>(), ShifterOperand(right.AsRegisterPairHigh<Register>())); // Signed compare. __ b(&less, LT); __ b(&greater, GT); - // Do LoadImmediate before any `cmp`, as LoadImmediate might affect the status flags. - __ LoadImmediate(out, 0); + // Do LoadImmediate before any `cmp`, as LoadImmediate might affect + // the status flags. + __ LoadImmediate(output, 0); __ cmp(left.AsRegisterPairLow<Register>(), ShifterOperand(right.AsRegisterPairLow<Register>())); // Unsigned compare. - break; - } - case Primitive::kPrimFloat: { - __ LoadImmediate(out, 0); - __ vcmps(left.As<SRegister>(), right.As<SRegister>()); - __ b(compare->IsGtBias() ? &greater : &less, VS); // VS for unordered - break; - } - case Primitive::kPrimDouble: { - __ LoadImmediate(out, 0); - __ vcmpd(FromLowSToD(left.AsFpuRegisterPairLow<SRegister>()), - FromLowSToD(right.AsFpuRegisterPairLow<SRegister>())); - __ b(compare->IsGtBias() ? &greater : &less, VS); + __ b(&done, EQ); + __ b(&less, CC); + + __ Bind(&greater); + __ LoadImmediate(output, 1); + __ b(&done); + + __ Bind(&less); + __ LoadImmediate(output, -1); + + __ Bind(&done); break; } default: - LOG(FATAL) << "Unexpected compare type " << compare->InputAt(0)->GetType(); + LOG(FATAL) << "Unimplemented compare type " << compare->InputAt(0)->GetType(); } - __ b(&done, EQ); - __ b(&less, CC); // CC is for both: unsigned compare for longs and 'less than' for floats. - - __ Bind(&greater); - __ LoadImmediate(out, 1); - __ b(&done); - - __ Bind(&less); - __ LoadImmediate(out, -1); - - __ Bind(&done); } void LocationsBuilderARM::VisitPhi(HPhi* instruction) { |