Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 98a049b64abed3387a1d5f6c380a48c1fed8c78f..1a6efc39455ee14343f479d10f4443e3c35715fc 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -561,6 +561,16 @@ void LCodeGen::X87LoadForUsage(X87Register reg) { |
} |
+void LCodeGen::X87LoadForUsage(X87Register reg1, X87Register reg2) { |
+ ASSERT(x87_stack_.Contains(reg1)); |
+ ASSERT(x87_stack_.Contains(reg2)); |
+ x87_stack_.Fxch(reg1, 1); |
+ x87_stack_.Fxch(reg2); |
+ x87_stack_.pop(); |
+ x87_stack_.pop(); |
Toon Verwaest
2013/09/24 09:00:08
Pretty surprising that you first push values to th
Benedikt Meurer
2013/09/24 09:12:30
As discussed offline, we can fix this once the X87
|
+} |
+ |
+ |
void LCodeGen::X87Stack::Fxch(X87Register reg, int other_slot) { |
ASSERT(is_mutable_); |
ASSERT(Contains(reg) && stack_depth_ > other_slot); |
@@ -2572,10 +2582,7 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) { |
CpuFeatureScope scope(masm(), SSE2); |
__ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); |
} else { |
- X87Fxch(ToX87Register(right)); |
- X87Fxch(ToX87Register(left), 1); |
- __ fld(0); |
- __ fld(2); |
+ X87LoadForUsage(ToX87Register(right), ToX87Register(left)); |
__ FCmp(); |
} |
// Don't base result on EFLAGS when a NaN is involved. Instead |