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

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

Issue 654833002: [turbofan] Optimize division/modulus by constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « test/unittests/compiler/machine-operator-unittest.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. 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/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 EXPECT_EQ(kX64Imul, s[0]->arch_opcode()); 491 EXPECT_EQ(kX64Imul, s[0]->arch_opcode());
492 EXPECT_EQ(kX64Add, s[1]->arch_opcode()); 492 EXPECT_EQ(kX64Add, s[1]->arch_opcode());
493 } 493 }
494 } 494 }
495 } 495 }
496 496
497 497
498 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorMultTest, 498 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorMultTest,
499 ::testing::ValuesIn(kMultParams)); 499 ::testing::ValuesIn(kMultParams));
500 500
501
502 TEST_F(InstructionSelectorTest, Int32MulHigh) {
503 StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
504 Node* const p0 = m.Parameter(0);
505 Node* const p1 = m.Parameter(1);
506 Node* const n = m.Int32MulHigh(p0, p1);
507 m.Return(n);
508 Stream s = m.Build();
509 ASSERT_EQ(1U, s.size());
510 EXPECT_EQ(kX64ImulHigh32, s[0]->arch_opcode());
511 ASSERT_EQ(2U, s[0]->InputCount());
512 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
513 EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1)));
514 ASSERT_EQ(1U, s[0]->OutputCount());
515 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
516 }
517
501 } // namespace compiler 518 } // namespace compiler
502 } // namespace internal 519 } // namespace internal
503 } // namespace v8 520 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/machine-operator-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698