summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-02-16 16:54:00 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-02-16 16:54:01 +0000
commitce053b20e87f33b4417b8f21bb6f2ec4feb3104e (patch)
tree9c40e6abafac47ca9b9190df0a2ac85b6540ccad /compiler/optimizing
parenta1f1296d8353c22b43cb2c5437a3ef5b747f7a87 (diff)
parent8659e8462553fa95ec1470fb86324f6ad540bf77 (diff)
Merge "X86: Allow long compares to stack operands"
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/code_generator_x86.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index 07edd97c1f..3c880c2aaa 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -1276,7 +1276,7 @@ void InstructionCodeGeneratorX86::GenerateLongComparesAndJumps(HCondition* cond,
}
// Must be equal high, so compare the lows.
codegen_->Compare32BitValue(left_low, val_low);
- } else {
+ } else if (right.IsRegisterPair()) {
Register right_high = right.AsRegisterPairHigh<Register>();
Register right_low = right.AsRegisterPairLow<Register>();
@@ -1291,6 +1291,19 @@ void InstructionCodeGeneratorX86::GenerateLongComparesAndJumps(HCondition* cond,
}
// Must be equal high, so compare the lows.
__ cmpl(left_low, right_low);
+ } else {
+ DCHECK(right.IsDoubleStackSlot());
+ __ cmpl(left_high, Address(ESP, right.GetHighStackIndex(kX86WordSize)));
+ if (if_cond == kCondNE) {
+ __ j(X86Condition(true_high_cond), true_label);
+ } else if (if_cond == kCondEQ) {
+ __ j(X86Condition(false_high_cond), false_label);
+ } else {
+ __ j(X86Condition(true_high_cond), true_label);
+ __ j(X86Condition(false_high_cond), false_label);
+ }
+ // Must be equal high, so compare the lows.
+ __ cmpl(left_low, Address(ESP, right.GetStackIndex()));
}
// The last comparison might be unsigned.
__ j(final_condition, true_label);
@@ -1593,7 +1606,7 @@ void LocationsBuilderX86::HandleCondition(HCondition* cond) {
switch (cond->InputAt(0)->GetType()) {
case Primitive::kPrimLong: {
locations->SetInAt(0, Location::RequiresRegister());
- locations->SetInAt(1, Location::RegisterOrConstant(cond->InputAt(1)));
+ locations->SetInAt(1, Location::Any());
if (!cond->IsEmittedAtUseSite()) {
locations->SetOut(Location::RequiresRegister());
}