| Index: test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
|
| diff --git a/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc b/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
|
| index 6c985139bc5da995b5ddbd2e9dc6f4a7febf0f97..fa030394d761e6c3c1c2210feddb97855986fdd7 100644
|
| --- a/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
|
| +++ b/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc
|
| @@ -3059,6 +3059,36 @@ TEST_F(InstructionSelectorTest, Float64Min) {
|
| EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
|
| }
|
|
|
| +TEST_F(InstructionSelectorTest, Float32Neg) {
|
| + StreamBuilder m(this, MachineType::Float32(), MachineType::Float32());
|
| + Node* const p0 = m.Parameter(0);
|
| + // Don't use m.Float32Neg() as that generates an explicit sub.
|
| + Node* const n = m.AddNode(m.machine()->Float32Neg().op(), m.Parameter(0));
|
| + m.Return(n);
|
| + Stream s = m.Build();
|
| + ASSERT_EQ(1U, s.size());
|
| + EXPECT_EQ(kArmVnegF32, s[0]->arch_opcode());
|
| + ASSERT_EQ(1U, s[0]->InputCount());
|
| + EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
|
| + ASSERT_EQ(1U, s[0]->OutputCount());
|
| + EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
|
| +}
|
| +
|
| +TEST_F(InstructionSelectorTest, Float64Neg) {
|
| + StreamBuilder m(this, MachineType::Float64(), MachineType::Float64());
|
| + Node* const p0 = m.Parameter(0);
|
| + // Don't use m.Float64Neg() as that generates an explicit sub.
|
| + Node* const n = m.AddNode(m.machine()->Float64Neg().op(), m.Parameter(0));
|
| + m.Return(n);
|
| + Stream s = m.Build();
|
| + ASSERT_EQ(1U, s.size());
|
| + EXPECT_EQ(kArmVnegF64, s[0]->arch_opcode());
|
| + ASSERT_EQ(1U, s[0]->InputCount());
|
| + EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
|
| + ASSERT_EQ(1U, s[0]->OutputCount());
|
| + EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
|
| +}
|
| +
|
| } // namespace compiler
|
| } // namespace internal
|
| } // namespace v8
|
|
|