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 72cfc51d588b17bd8e2d9670652aa2b55732647c..b088d8e76ec12afbefbb01cafdf47fc72bbf79a7 100644 |
--- a/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc |
+++ b/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc |
@@ -2954,6 +2954,78 @@ TEST_F(InstructionSelectorTest, Word32Clz) { |
EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
} |
+TEST_F(InstructionSelectorTest, Float32Max) { |
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float32(), |
+ MachineType::Float32()); |
+ Node* const p0 = m.Parameter(0); |
+ Node* const p1 = m.Parameter(1); |
+ Node* const n = m.Float32Max(p0, p1); |
+ m.Return(n); |
+ Stream s = m.Build(ARMv8); |
+ // Float32Max is `(b < a) ? a : b`. |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kArmFloat32Max, s[0]->arch_opcode()); |
+ ASSERT_EQ(2U, s[0]->InputCount()); |
+ EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
+ EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); |
+ ASSERT_EQ(1U, s[0]->OutputCount()); |
+ EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
+} |
+ |
+TEST_F(InstructionSelectorTest, Float32Min) { |
+ StreamBuilder m(this, MachineType::Float32(), MachineType::Float32(), |
+ MachineType::Float32()); |
+ Node* const p0 = m.Parameter(0); |
+ Node* const p1 = m.Parameter(1); |
+ Node* const n = m.Float32Min(p0, p1); |
+ m.Return(n); |
+ Stream s = m.Build(ARMv8); |
+ // Float32Min is `(a < b) ? a : b`. |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kArmFloat32Min, s[0]->arch_opcode()); |
+ ASSERT_EQ(2U, s[0]->InputCount()); |
+ EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
+ EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); |
+ ASSERT_EQ(1U, s[0]->OutputCount()); |
+ EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
+} |
+ |
+TEST_F(InstructionSelectorTest, Float64Max) { |
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64(), |
+ MachineType::Float64()); |
+ Node* const p0 = m.Parameter(0); |
+ Node* const p1 = m.Parameter(1); |
+ Node* const n = m.Float64Max(p0, p1); |
+ m.Return(n); |
+ Stream s = m.Build(ARMv8); |
+ // Float64Max is `(b < a) ? a : b`. |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kArmFloat64Max, s[0]->arch_opcode()); |
+ ASSERT_EQ(2U, s[0]->InputCount()); |
+ EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
+ EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); |
+ ASSERT_EQ(1U, s[0]->OutputCount()); |
+ EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
+} |
+ |
+TEST_F(InstructionSelectorTest, Float64Min) { |
+ StreamBuilder m(this, MachineType::Float64(), MachineType::Float64(), |
+ MachineType::Float64()); |
+ Node* const p0 = m.Parameter(0); |
+ Node* const p1 = m.Parameter(1); |
+ Node* const n = m.Float64Min(p0, p1); |
+ m.Return(n); |
+ Stream s = m.Build(ARMv8); |
+ // Float64Min is `(a < b) ? a : b`. |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kArmFloat64Min, s[0]->arch_opcode()); |
+ ASSERT_EQ(2U, s[0]->InputCount()); |
+ EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
+ EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); |
+ ASSERT_EQ(1U, s[0]->OutputCount()); |
+ EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
+} |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |