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

Unified Diff: test/unittests/compiler/machine-operator-reducer-unittest.cc

Issue 2065503002: [builtins] Introduce proper Float64Atan and Float64Atan2 operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [WIP] Fix GCC/Win32. 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
« no previous file with comments | « test/unittests/compiler/js-builtin-reducer-unittest.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/machine-operator-reducer-unittest.cc
diff --git a/test/unittests/compiler/machine-operator-reducer-unittest.cc b/test/unittests/compiler/machine-operator-reducer-unittest.cc
index d9b6ea74033521ce068f5c7cc610bc810dd3ca98..9d7482af76df973f45b98cac3391179fa43cdecd 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -1401,6 +1401,53 @@ TEST_F(MachineOperatorReducerTest, Float64MulWithMinusOne) {
// -----------------------------------------------------------------------------
+// Float64Atan
+
+TEST_F(MachineOperatorReducerTest, Float64AtanWithConstant) {
+ TRACED_FOREACH(double, x, kFloat64Values) {
+ Reduction const r =
+ Reduce(graph()->NewNode(machine()->Float64Atan(), Float64Constant(x)));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(
+ r.replacement(),
+ IsFloat64Constant(NanSensitiveDoubleEq(base::ieee754::atan(x))));
+ }
+}
+
+// -----------------------------------------------------------------------------
+// Float64Atan2
+
+TEST_F(MachineOperatorReducerTest, Float64Atan2WithConstant) {
+ TRACED_FOREACH(double, y, kFloat64Values) {
+ TRACED_FOREACH(double, x, kFloat64Values) {
+ Reduction const r = Reduce(graph()->NewNode(
+ machine()->Float64Atan2(), Float64Constant(y), Float64Constant(x)));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(
+ r.replacement(),
+ IsFloat64Constant(NanSensitiveDoubleEq(base::ieee754::atan2(y, x))));
+ }
+ }
+}
+
+TEST_F(MachineOperatorReducerTest, Float64Atan2WithNaN) {
+ Node* const p0 = Parameter(0);
+ Node* const nan = Float64Constant(std::numeric_limits<double>::quiet_NaN());
+ {
+ Reduction const r =
+ Reduce(graph()->NewNode(machine()->Float64Atan2(), p0, nan));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_EQ(nan, r.replacement());
+ }
+ {
+ Reduction const r =
+ Reduce(graph()->NewNode(machine()->Float64Atan2(), nan, p0));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_EQ(nan, r.replacement());
+ }
+}
+
+// -----------------------------------------------------------------------------
// Float64Log
TEST_F(MachineOperatorReducerTest, Float64LogWithConstant) {
« no previous file with comments | « test/unittests/compiler/js-builtin-reducer-unittest.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698