Index: test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc |
diff --git a/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc b/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc |
index d1a17260a21e3a67e5e77fa9dd166f02622cc255..a1d884c19266e78c13a1042a5c21af26dfbf044d 100644 |
--- a/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc |
+++ b/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc |
@@ -601,6 +601,38 @@ TEST_F(InstructionSelectorTest, Int32MulHigh) { |
EXPECT_TRUE(s.IsFixed(s[0]->OutputAt(0), edx)); |
} |
+ |
+TEST_F(InstructionSelectorTest, Float64BinopArithmetic) { |
+ { |
+ StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64); |
+ Node* add = m.Float64Add(m.Parameter(0), m.Parameter(1)); |
+ Node* mul = m.Float64Mul(add, m.Parameter(1)); |
+ Node* sub = m.Float64Sub(mul, add); |
+ Node* ret = m.Float64Div(mul, sub); |
+ m.Return(ret); |
+ Stream s = m.Build(AVX); |
+ ASSERT_EQ(4U, s.size()); |
+ EXPECT_EQ(kAVXFloat64Add, s[0]->arch_opcode()); |
+ EXPECT_EQ(kAVXFloat64Mul, s[1]->arch_opcode()); |
+ EXPECT_EQ(kAVXFloat64Sub, s[2]->arch_opcode()); |
+ EXPECT_EQ(kAVXFloat64Div, s[3]->arch_opcode()); |
+ } |
+ { |
+ StreamBuilder m(this, kMachFloat64, kMachFloat64, kMachFloat64); |
+ Node* add = m.Float64Add(m.Parameter(0), m.Parameter(1)); |
+ Node* mul = m.Float64Mul(add, m.Parameter(1)); |
+ Node* sub = m.Float64Sub(mul, add); |
+ Node* ret = m.Float64Div(mul, sub); |
+ m.Return(ret); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(4U, s.size()); |
+ EXPECT_EQ(kSSEFloat64Add, s[0]->arch_opcode()); |
+ EXPECT_EQ(kSSEFloat64Mul, s[1]->arch_opcode()); |
+ EXPECT_EQ(kSSEFloat64Sub, s[2]->arch_opcode()); |
+ EXPECT_EQ(kSSEFloat64Div, s[3]->arch_opcode()); |
+ } |
+} |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |