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

Side by Side Diff: test/cctest/compiler/test-run-machops.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
« no previous file with comments | « src/v8.gyp ('k') | test/mjsunit/asm/construct-double.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this 1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 #include <functional> 6 #include <functional>
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/ieee754.h" 10 #include "src/base/ieee754.h"
(...skipping 5621 matching lines...) Expand 10 before | Expand all | Expand 10 after
5632 } 5632 }
5633 5633
5634 TEST(RunFloat64Sin) { 5634 TEST(RunFloat64Sin) {
5635 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64()); 5635 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
5636 m.Return(m.Float64Sin(m.Parameter(0))); 5636 m.Return(m.Float64Sin(m.Parameter(0)));
5637 CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN()))); 5637 CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN())));
5638 CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN()))); 5638 CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
5639 FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::sin(*i), m.Call(*i)); } 5639 FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::sin(*i), m.Call(*i)); }
5640 } 5640 }
5641 5641
5642 TEST(RunFloat64Tan) {
5643 BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
5644 m.Return(m.Float64Tan(m.Parameter(0)));
5645 CHECK(std::isnan(m.Call(std::numeric_limits<double>::quiet_NaN())));
5646 CHECK(std::isnan(m.Call(std::numeric_limits<double>::signaling_NaN())));
5647 FOR_FLOAT64_INPUTS(i) { CHECK_DOUBLE_EQ(ieee754::tan(*i), m.Call(*i)); }
5648 }
5649
5642 static double two_30 = 1 << 30; // 2^30 is a smi boundary. 5650 static double two_30 = 1 << 30; // 2^30 is a smi boundary.
5643 static double two_52 = two_30 * (1 << 22); // 2^52 is a precision boundary. 5651 static double two_52 = two_30 * (1 << 22); // 2^52 is a precision boundary.
5644 static double kValues[] = {0.1, 5652 static double kValues[] = {0.1,
5645 0.2, 5653 0.2,
5646 0.49999999999999994, 5654 0.49999999999999994,
5647 0.5, 5655 0.5,
5648 0.7, 5656 0.7,
5649 1.0 - std::numeric_limits<double>::epsilon(), 5657 1.0 - std::numeric_limits<double>::epsilon(),
5650 -0.1, 5658 -0.1,
5651 -0.49999999999999994, 5659 -0.49999999999999994,
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
6401 r.Goto(&merge); 6409 r.Goto(&merge);
6402 r.Bind(&merge); 6410 r.Bind(&merge);
6403 Node* phi = r.Phi(MachineRepresentation::kWord32, fa, fb); 6411 Node* phi = r.Phi(MachineRepresentation::kWord32, fa, fb);
6404 r.Return(phi); 6412 r.Return(phi);
6405 CHECK_EQ(1, r.Call(1)); 6413 CHECK_EQ(1, r.Call(1));
6406 } 6414 }
6407 6415
6408 } // namespace compiler 6416 } // namespace compiler
6409 } // namespace internal 6417 } // namespace internal
6410 } // namespace v8 6418 } // namespace v8
OLDNEW
« no previous file with comments | « src/v8.gyp ('k') | test/mjsunit/asm/construct-double.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698