Index: test/cctest/compiler/test-run-machops.cc |
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc |
index 70e57cbd6814c1414609d08255d14cb29803dc94..ab5c7d90934bb21fe4a0fd7da59d4649c541619e 100644 |
--- a/test/cctest/compiler/test-run-machops.cc |
+++ b/test/cctest/compiler/test-run-machops.cc |
@@ -5546,6 +5546,35 @@ TEST(RunFloat64Log1p) { |
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::log1p(*i), m.Call(*i)); } |
} |
+TEST(RunFloat64Log2) { |
+ BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); |
+ m.Return(m.Float64Log2(m.Parameter(0))); |
+ CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN()))); |
+ CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN()))); |
+ CHECK(std::isnan(m.Call(-std::numeric_limits<double>::infinity()))); |
+ CHECK(std::isnan(m.Call(-1.0))); |
+ CHECK_DOUBLE_EQ(-std::numeric_limits<double>::infinity(), m.Call(-0.0)); |
+ CHECK_DOUBLE_EQ(-std::numeric_limits<double>::infinity(), m.Call(0.0)); |
+ CHECK_DOUBLE_EQ(0.0, m.Call(1.0)); |
+ CHECK_DOUBLE_EQ(std::numeric_limits<double>::infinity(), |
+ m.Call(std::numeric_limits<double>::infinity())); |
+ FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::log2(*i), m.Call(*i)); } |
+} |
+ |
+TEST(RunFloat64Log10) { |
+ BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); |
+ m.Return(m.Float64Log10(m.Parameter(0))); |
+ CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN()))); |
+ CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN()))); |
+ CHECK(std::isnan(m.Call(-std::numeric_limits<double>::infinity()))); |
+ CHECK(std::isnan(m.Call(-1.0))); |
+ CHECK_DOUBLE_EQ(-std::numeric_limits<double>::infinity(), m.Call(-0.0)); |
+ CHECK_DOUBLE_EQ(-std::numeric_limits<double>::infinity(), m.Call(0.0)); |
+ CHECK_DOUBLE_EQ(std::numeric_limits<double>::infinity(), |
+ m.Call(std::numeric_limits<double>::infinity())); |
+ FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::log10(*i), m.Call(*i)); } |
+} |
+ |
static double two_30 = 1 << 30; // 2^30 is a smi boundary. |
static double two_52 = two_30 * (1 << 22); // 2^52 is a precision boundary. |
static double kValues[] = {0.1, |