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

Side by Side Diff: test/cctest/compiler/test-run-machops.cc

Issue 1424333002: [turbofan] Added the RoundInt64ToFloat64 instruction to TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@BufferedRawMachineAssemblerTester
Patch Set: Fixed the type of RoundInt64ToFloat64 Created 5 years, 1 month 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/x64/macro-assembler-x64.cc ('k') | no next file » | 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 // TODO(jochen): Remove this after the setting is turned on globally. 5 // TODO(jochen): Remove this after the setting is turned on globally.
6 #define V8_IMMINENT_DEPRECATION_WARNINGS 6 #define V8_IMMINENT_DEPRECATION_WARNINGS
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <functional> 9 #include <functional>
10 #include <limits> 10 #include <limits>
(...skipping 5366 matching lines...) Expand 10 before | Expand all | Expand 10 after
5377 &output, kMachInt64, 5377 &output, kMachInt64,
5378 m.BitcastFloat64ToInt64(m.LoadFromPointer(&input, kMachFloat64))); 5378 m.BitcastFloat64ToInt64(m.LoadFromPointer(&input, kMachFloat64)));
5379 m.Return(m.Int32Constant(11)); 5379 m.Return(m.Int32Constant(11));
5380 FOR_FLOAT64_INPUTS(i) { 5380 FOR_FLOAT64_INPUTS(i) {
5381 input = *i; 5381 input = *i;
5382 CHECK_EQ(11, m.Call()); 5382 CHECK_EQ(11, m.Call());
5383 double expected = bit_cast<int64_t>(input); 5383 double expected = bit_cast<int64_t>(input);
5384 CHECK_EQ(expected, output); 5384 CHECK_EQ(expected, output);
5385 } 5385 }
5386 } 5386 }
5387
5388
5389 TEST(RunRoundInt64ToFloat64) {
5390 BufferedRawMachineAssemblerTester<double> m(kMachInt64);
5391 m.Return(m.RoundInt64ToFloat64(m.Parameter(0)));
5392 FOR_INT64_INPUTS(i) { CHECK_EQ(static_cast<double>(*i), m.Call(*i)); }
5393 }
5394
5395
5387 #endif 5396 #endif
5388 5397
5389 5398
5390 TEST(RunBitcastFloat32ToInt32) { 5399 TEST(RunBitcastFloat32ToInt32) {
5391 float input = 32.25; 5400 float input = 32.25;
5392 RawMachineAssemblerTester<int32_t> m; 5401 RawMachineAssemblerTester<int32_t> m;
5393 m.Return(m.BitcastFloat32ToInt32(m.LoadFromPointer(&input, kMachFloat32))); 5402 m.Return(m.BitcastFloat32ToInt32(m.LoadFromPointer(&input, kMachFloat32)));
5394 FOR_FLOAT32_INPUTS(i) { 5403 FOR_FLOAT32_INPUTS(i) {
5395 input = *i; 5404 input = *i;
5396 int32_t expected = bit_cast<int32_t>(input); 5405 int32_t expected = bit_cast<int32_t>(input);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
5462 Node* call = r.AddNode(r.common()->Call(desc), phi); 5471 Node* call = r.AddNode(r.common()->Call(desc), phi);
5463 r.Return(call); 5472 r.Return(call);
5464 5473
5465 CHECK_EQ(33, r.Call(1)); 5474 CHECK_EQ(33, r.Call(1));
5466 CHECK_EQ(44, r.Call(0)); 5475 CHECK_EQ(44, r.Call(0));
5467 } 5476 }
5468 5477
5469 } // namespace compiler 5478 } // namespace compiler
5470 } // namespace internal 5479 } // namespace internal
5471 } // namespace v8 5480 } // namespace v8
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698