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

Side by Side Diff: test/unittests/compiler/instruction-selector-unittest.cc

Issue 1225993002: [turbofan] Add TruncationMode for TruncateFloat64ToInt32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 "test/unittests/compiler/instruction-selector-unittest.h" 5 #include "test/unittests/compiler/instruction-selector-unittest.h"
6 6
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/schedule.h" 8 #include "src/compiler/schedule.h"
9 #include "src/flags.h" 9 #include "src/flags.h"
10 #include "test/unittests/compiler/compiler-test-utils.h" 10 #include "test/unittests/compiler/compiler-test-utils.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 EXPECT_EQ(1U, s[1]->InputCount()); 200 EXPECT_EQ(1U, s[1]->InputCount());
201 } 201 }
202 202
203 203
204 // ----------------------------------------------------------------------------- 204 // -----------------------------------------------------------------------------
205 // Conversions. 205 // Conversions.
206 206
207 207
208 TARGET_TEST_F(InstructionSelectorTest, TruncateFloat64ToInt32WithParameter) { 208 TARGET_TEST_F(InstructionSelectorTest, TruncateFloat64ToInt32WithParameter) {
209 StreamBuilder m(this, kMachInt32, kMachFloat64); 209 StreamBuilder m(this, kMachInt32, kMachFloat64);
210 m.Return(m.TruncateFloat64ToInt32(m.Parameter(0))); 210 m.Return(
211 m.TruncateFloat64ToInt32(TruncationMode::kJavaScript, m.Parameter(0)));
211 Stream s = m.Build(kAllInstructions); 212 Stream s = m.Build(kAllInstructions);
212 ASSERT_EQ(4U, s.size()); 213 ASSERT_EQ(4U, s.size());
213 EXPECT_EQ(kArchNop, s[0]->arch_opcode()); 214 EXPECT_EQ(kArchNop, s[0]->arch_opcode());
214 EXPECT_EQ(kArchTruncateDoubleToI, s[1]->arch_opcode()); 215 EXPECT_EQ(kArchTruncateDoubleToI, s[1]->arch_opcode());
215 EXPECT_EQ(1U, s[1]->InputCount()); 216 EXPECT_EQ(1U, s[1]->InputCount());
216 EXPECT_EQ(1U, s[1]->OutputCount()); 217 EXPECT_EQ(1U, s[1]->OutputCount());
217 EXPECT_EQ(kArchRet, s[2]->arch_opcode()); 218 EXPECT_EQ(kArchRet, s[2]->arch_opcode());
218 } 219 }
219 220
220 221
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); 606 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14)));
606 // Continuation. 607 // Continuation.
607 608
608 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); 609 EXPECT_EQ(kArchRet, s[index++]->arch_opcode());
609 EXPECT_EQ(index, s.size()); 610 EXPECT_EQ(index, s.size());
610 } 611 }
611 612
612 } // namespace compiler 613 } // namespace compiler
613 } // namespace internal 614 } // namespace internal
614 } // namespace v8 615 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-machops.cc ('k') | test/unittests/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698