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

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

Issue 2333663002: [turbofan] Do constant folding for Float64Pow. (Closed)
Patch Set: Created 4 years, 3 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 | « src/wasm/wasm-external-refs.cc ('k') | no next file » | 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 b81ec2f3c568d41af52fa2a45f811ed851716408..318738eb34303edfd035d99068877f3538ae8c2e 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -1772,6 +1772,21 @@ TEST_F(MachineOperatorReducerTest, Float64Log1pWithConstant) {
}
// -----------------------------------------------------------------------------
+// Float64Pow
+
+TEST_F(MachineOperatorReducerTest, Float64PowWithConstant) {
+ TRACED_FOREACH(double, x, kFloat64Values) {
+ TRACED_FOREACH(double, y, kFloat64Values) {
+ Reduction const r = Reduce(graph()->NewNode(
+ machine()->Float64Pow(), Float64Constant(x), Float64Constant(y)));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(r.replacement(),
+ IsFloat64Constant(NanSensitiveDoubleEq(Pow(x, y))));
+ }
+ }
+}
+
ahaas 2016/09/12 10:45:23 Nit: could you add a test for x ** +-0.0 => 1.0?
Benedikt Meurer 2016/09/12 10:52:03 Done.
+// -----------------------------------------------------------------------------
// Float64Sin
TEST_F(MachineOperatorReducerTest, Float64SinWithConstant) {
« no previous file with comments | « src/wasm/wasm-external-refs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698