| Index: test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
|
| diff --git a/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc b/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
|
| index 5a61177b830de88661fa2288e7bd22a869943e2a..66bb3e51bf76bae656ac3b3efc1110c41359d57f 100644
|
| --- a/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
|
| +++ b/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
|
| @@ -388,7 +388,7 @@ TEST_P(InstructionSelectorLogicalTest, Parameter) {
|
| const MachInst2 dpi = GetParam();
|
| const MachineType type = dpi.machine_type;
|
| StreamBuilder m(this, type, type, type);
|
| - m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(1)));
|
| + m.Return((m.*dpi.constructor)(m.Parameter(0), m.Parameter(0)));
|
| Stream s = m.Build();
|
| ASSERT_EQ(1U, s.size());
|
| EXPECT_EQ(dpi.arch_opcode, s[0]->arch_opcode());
|
| @@ -400,6 +400,54 @@ INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorLogicalTest,
|
| ::testing::ValuesIn(kLogicalInstructions));
|
|
|
|
|
| +TEST_F(InstructionSelectorTest, Word64XorMinusOneWithWord64Or) {
|
| + {
|
| + StreamBuilder m(this, kMachInt64, kMachInt64);
|
| + m.Return(m.Word64Xor(m.Word64Or(m.Parameter(0), m.Parameter(0)),
|
| + m.Int64Constant(-1)));
|
| + Stream s = m.Build();
|
| + ASSERT_EQ(1U, s.size());
|
| + EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
|
| + EXPECT_EQ(2U, s[0]->InputCount());
|
| + EXPECT_EQ(1U, s[0]->OutputCount());
|
| + }
|
| + {
|
| + StreamBuilder m(this, kMachInt64, kMachInt64);
|
| + m.Return(m.Word64Xor(m.Int64Constant(-1),
|
| + m.Word64Or(m.Parameter(0), m.Parameter(0))));
|
| + Stream s = m.Build();
|
| + ASSERT_EQ(1U, s.size());
|
| + EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
|
| + EXPECT_EQ(2U, s[0]->InputCount());
|
| + EXPECT_EQ(1U, s[0]->OutputCount());
|
| + }
|
| +}
|
| +
|
| +
|
| +TEST_F(InstructionSelectorTest, Word32XorMinusOneWithWord32Or) {
|
| + {
|
| + StreamBuilder m(this, kMachInt32, kMachInt32);
|
| + m.Return(m.Word32Xor(m.Word32Or(m.Parameter(0), m.Parameter(0)),
|
| + m.Int32Constant(-1)));
|
| + Stream s = m.Build();
|
| + ASSERT_EQ(1U, s.size());
|
| + EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
|
| + EXPECT_EQ(2U, s[0]->InputCount());
|
| + EXPECT_EQ(1U, s[0]->OutputCount());
|
| + }
|
| + {
|
| + StreamBuilder m(this, kMachInt32, kMachInt32);
|
| + m.Return(m.Word32Xor(m.Int32Constant(-1),
|
| + m.Word32Or(m.Parameter(0), m.Parameter(0))));
|
| + Stream s = m.Build();
|
| + ASSERT_EQ(1U, s.size());
|
| + EXPECT_EQ(kMips64Nor, s[0]->arch_opcode());
|
| + EXPECT_EQ(2U, s[0]->InputCount());
|
| + EXPECT_EQ(1U, s[0]->OutputCount());
|
| + }
|
| +}
|
| +
|
| +
|
| TEST_F(InstructionSelectorTest, Word32AndWithImmediateWithWord32Shr) {
|
| // The available shift operand range is `0 <= imm < 32`, but we also test
|
| // that immediates outside this range are handled properly (modulo-32).
|
|
|