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

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: 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
« src/types.h ('K') | « 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 5468 matching lines...) Expand 10 before | Expand all | Expand 10 after
5479 &output, kMachInt64, 5479 &output, kMachInt64,
5480 m.BitcastFloat64ToInt64(m.LoadFromPointer(&input, kMachFloat64))); 5480 m.BitcastFloat64ToInt64(m.LoadFromPointer(&input, kMachFloat64)));
5481 m.Return(m.Int32Constant(11)); 5481 m.Return(m.Int32Constant(11));
5482 FOR_FLOAT64_INPUTS(i) { 5482 FOR_FLOAT64_INPUTS(i) {
5483 input = *i; 5483 input = *i;
5484 CHECK_EQ(11, m.Call()); 5484 CHECK_EQ(11, m.Call());
5485 double expected = bit_cast<int64_t>(input); 5485 double expected = bit_cast<int64_t>(input);
5486 CHECK_EQ(expected, output); 5486 CHECK_EQ(expected, output);
5487 } 5487 }
5488 } 5488 }
5489
5490
5491 TEST(RunChangeInt64ToFloat64) {
5492 BufferedRawMachineAssemblerTester<double> m(kMachInt64);
5493 m.Return(m.ChangeInt64ToFloat64(m.Parameter(0)));
5494 FOR_INT64_INPUTS(i) { CHECK_EQ(static_cast<double>(*i), m.Call(*i)); }
5495 }
5496
5497
5489 #endif 5498 #endif
5490 5499
5491 5500
5492 TEST(RunBitcastFloat32ToInt32) { 5501 TEST(RunBitcastFloat32ToInt32) {
5493 float input = 32.25; 5502 float input = 32.25;
5494 RawMachineAssemblerTester<int32_t> m; 5503 RawMachineAssemblerTester<int32_t> m;
5495 m.Return(m.BitcastFloat32ToInt32(m.LoadFromPointer(&input, kMachFloat32))); 5504 m.Return(m.BitcastFloat32ToInt32(m.LoadFromPointer(&input, kMachFloat32)));
5496 FOR_FLOAT32_INPUTS(i) { 5505 FOR_FLOAT32_INPUTS(i) {
5497 input = *i; 5506 input = *i;
5498 int32_t expected = bit_cast<int32_t>(input); 5507 int32_t expected = bit_cast<int32_t>(input);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
5560 c->CalleeSavedRegisters(), // callee saved 5569 c->CalleeSavedRegisters(), // callee saved
5561 c->CalleeSavedFPRegisters(), // callee saved FP 5570 c->CalleeSavedFPRegisters(), // callee saved FP
5562 CallDescriptor::kNoFlags, // flags 5571 CallDescriptor::kNoFlags, // flags
5563 "c-call-as-code"); 5572 "c-call-as-code");
5564 Node* call = r.AddNode(r.common()->Call(desc), phi); 5573 Node* call = r.AddNode(r.common()->Call(desc), phi);
5565 r.Return(call); 5574 r.Return(call);
5566 5575
5567 CHECK_EQ(33, r.Call(1)); 5576 CHECK_EQ(33, r.Call(1));
5568 CHECK_EQ(44, r.Call(0)); 5577 CHECK_EQ(44, r.Call(0));
5569 } 5578 }
OLDNEW
« src/types.h ('K') | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698