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

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

Issue 2083453002: [builtins] Introduce proper Float64Tan operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/machine-operator-reducer.h" 5 #include "src/compiler/machine-operator-reducer.h"
6 #include "src/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/base/division-by-constant.h" 7 #include "src/base/division-by-constant.h"
8 #include "src/base/ieee754.h" 8 #include "src/base/ieee754.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/typer.h" 10 #include "src/compiler/typer.h"
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 TRACED_FOREACH(double, x, kFloat64Values) { 1523 TRACED_FOREACH(double, x, kFloat64Values) {
1524 Reduction const r = 1524 Reduction const r =
1525 Reduce(graph()->NewNode(machine()->Float64Sin(), Float64Constant(x))); 1525 Reduce(graph()->NewNode(machine()->Float64Sin(), Float64Constant(x)));
1526 ASSERT_TRUE(r.Changed()); 1526 ASSERT_TRUE(r.Changed());
1527 EXPECT_THAT(r.replacement(), 1527 EXPECT_THAT(r.replacement(),
1528 IsFloat64Constant(NanSensitiveDoubleEq(base::ieee754::sin(x)))); 1528 IsFloat64Constant(NanSensitiveDoubleEq(base::ieee754::sin(x))));
1529 } 1529 }
1530 } 1530 }
1531 1531
1532 // ----------------------------------------------------------------------------- 1532 // -----------------------------------------------------------------------------
1533 // Float64Tan
1534
1535 TEST_F(MachineOperatorReducerTest, Float64TanWithConstant) {
1536 TRACED_FOREACH(double, x, kFloat64Values) {
1537 Reduction const r =
1538 Reduce(graph()->NewNode(machine()->Float64Tan(), Float64Constant(x)));
1539 ASSERT_TRUE(r.Changed());
1540 EXPECT_THAT(r.replacement(),
1541 IsFloat64Constant(NanSensitiveDoubleEq(base::ieee754::tan(x))));
1542 }
1543 }
1544
1545 // -----------------------------------------------------------------------------
1533 // Float64InsertLowWord32 1546 // Float64InsertLowWord32
1534 1547
1535 TEST_F(MachineOperatorReducerTest, Float64InsertLowWord32WithConstant) { 1548 TEST_F(MachineOperatorReducerTest, Float64InsertLowWord32WithConstant) {
1536 TRACED_FOREACH(double, x, kFloat64Values) { 1549 TRACED_FOREACH(double, x, kFloat64Values) {
1537 TRACED_FOREACH(uint32_t, y, kUint32Values) { 1550 TRACED_FOREACH(uint32_t, y, kUint32Values) {
1538 Reduction const r = 1551 Reduction const r =
1539 Reduce(graph()->NewNode(machine()->Float64InsertLowWord32(), 1552 Reduce(graph()->NewNode(machine()->Float64InsertLowWord32(),
1540 Float64Constant(x), Uint32Constant(y))); 1553 Float64Constant(x), Uint32Constant(y)));
1541 ASSERT_TRUE(r.Changed()); 1554 ASSERT_TRUE(r.Changed());
1542 EXPECT_THAT( 1555 EXPECT_THAT(
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 Reduction r = Reduce(node); 1786 Reduction r = Reduce(node);
1774 ASSERT_TRUE(r.Changed()); 1787 ASSERT_TRUE(r.Changed());
1775 EXPECT_THAT(r.replacement(), 1788 EXPECT_THAT(r.replacement(),
1776 IsStore(rep, base, index, value, effect, control)); 1789 IsStore(rep, base, index, value, effect, control));
1777 } 1790 }
1778 } 1791 }
1779 1792
1780 } // namespace compiler 1793 } // namespace compiler
1781 } // namespace internal 1794 } // namespace internal
1782 } // namespace v8 1795 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/js-intrinsic-lowering-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