Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 2060743002: [builtins] Introduce proper Float64Log1p operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@Math_Log
Patch Set: REBASE Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 8f3efb5777ed6a6683abd6155a37baf0689692bd..b1b01a48f82e7e0ca7f418fc007e0f0d150662ba 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5511,6 +5511,20 @@ TEST(RunFloat64Log) {
FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::log(*i), m.Call(*i)); }
}
+TEST(RunFloat64Log1p) {
+ BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
+ m.Return(m.Float64Log1p(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_DOUBLE_EQ(-std::numeric_limits<double>::infinity(), m.Call(-1.0));
+ CHECK_DOUBLE_EQ(0.0, m.Call(0.0));
+ CHECK_DOUBLE_EQ(-0.0, 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::log1p(*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,

Powered by Google App Engine
This is Rietveld 408576698