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

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

Issue 1485833003: MIPS:[turbofan] Use Nor instruction for bit negation instead of xori. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « test/unittests/compiler/mips/instruction-selector-mips-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 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace compiler { 9 namespace compiler {
10 10
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 ASSERT_EQ(1U, s.size()); 393 ASSERT_EQ(1U, s.size());
394 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode()); 394 EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
395 EXPECT_EQ(2U, s[0]->InputCount()); 395 EXPECT_EQ(2U, s[0]->InputCount());
396 EXPECT_EQ(1U, s[0]->OutputCount()); 396 EXPECT_EQ(1U, s[0]->OutputCount());
397 } 397 }
398 398
399 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorLogicalTest, 399 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorLogicalTest,
400 ::testing::ValuesIn(kLogicalInstructions)); 400 ::testing::ValuesIn(kLogicalInstructions));
401 401
402 402
403 TEST_F(InstructionSelectorTest, Word64XorMinusOneWithParameter) {
404 {
405 StreamBuilder m(this, kMachInt64, kMachInt64);
406 m.Return(m.Word64Xor(m.Parameter(0), m.Int64Constant(-1)));
407 Stream s = m.Build();
408 ASSERT_EQ(1U, s.size());
409 EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
410 EXPECT_EQ(2U, s[0]->InputCount());
411 EXPECT_EQ(1U, s[0]->OutputCount());
412 }
413 {
414 StreamBuilder m(this, kMachInt64, kMachInt64);
415 m.Return(m.Word64Xor(m.Int64Constant(-1), m.Parameter(0)));
416 Stream s = m.Build();
417 ASSERT_EQ(1U, s.size());
418 EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
419 EXPECT_EQ(2U, s[0]->InputCount());
420 EXPECT_EQ(1U, s[0]->OutputCount());
421 }
422 }
423
424
425 TEST_F(InstructionSelectorTest, Word32XorMinusOneWithParameter) {
426 {
427 StreamBuilder m(this, kMachInt32, kMachInt32);
428 m.Return(m.Word32Xor(m.Parameter(0), m.Int32Constant(-1)));
429 Stream s = m.Build();
430 ASSERT_EQ(1U, s.size());
431 EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
432 EXPECT_EQ(2U, s[0]->InputCount());
433 EXPECT_EQ(1U, s[0]->OutputCount());
434 }
435 {
436 StreamBuilder m(this, kMachInt32, kMachInt32);
437 m.Return(m.Word32Xor(m.Int32Constant(-1), m.Parameter(0)));
438 Stream s = m.Build();
439 ASSERT_EQ(1U, s.size());
440 EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
441 EXPECT_EQ(2U, s[0]->InputCount());
442 EXPECT_EQ(1U, s[0]->OutputCount());
443 }
444 }
445
446
403 TEST_F(InstructionSelectorTest, Word64XorMinusOneWithWord64Or) { 447 TEST_F(InstructionSelectorTest, Word64XorMinusOneWithWord64Or) {
404 { 448 {
405 StreamBuilder m(this, kMachInt64, kMachInt64); 449 StreamBuilder m(this, kMachInt64, kMachInt64);
406 m.Return(m.Word64Xor(m.Word64Or(m.Parameter(0), m.Parameter(0)), 450 m.Return(m.Word64Xor(m.Word64Or(m.Parameter(0), m.Parameter(0)),
407 m.Int64Constant(-1))); 451 m.Int64Constant(-1)));
408 Stream s = m.Build(); 452 Stream s = m.Build();
409 ASSERT_EQ(1U, s.size()); 453 ASSERT_EQ(1U, s.size());
410 EXPECT_EQ(kMips64Nor, s[0]->arch_opcode()); 454 EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
411 EXPECT_EQ(2U, s[0]->InputCount()); 455 EXPECT_EQ(2U, s[0]->InputCount());
412 EXPECT_EQ(1U, s[0]->OutputCount()); 456 EXPECT_EQ(1U, s[0]->OutputCount());
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 ASSERT_EQ(1U, s.size()); 1239 ASSERT_EQ(1U, s.size());
1196 EXPECT_EQ(kMips64Float64Min, s[0]->arch_opcode()); 1240 EXPECT_EQ(kMips64Float64Min, s[0]->arch_opcode());
1197 ASSERT_EQ(2U, s[0]->InputCount()); 1241 ASSERT_EQ(2U, s[0]->InputCount());
1198 ASSERT_EQ(1U, s[0]->OutputCount()); 1242 ASSERT_EQ(1U, s[0]->OutputCount());
1199 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); 1243 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
1200 } 1244 }
1201 1245
1202 } // namespace compiler 1246 } // namespace compiler
1203 } // namespace internal 1247 } // namespace internal
1204 } // namespace v8 1248 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/mips/instruction-selector-mips-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698