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 e9b84b1238379ce2d4113382f4d65b3083ce1580..97fd7bfc37a9b20c49be1da58bcb81b1c549f1ba 100644 |
--- a/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc |
+++ b/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc |
@@ -1964,6 +1964,30 @@ TEST_F(InstructionSelectorTest, LoadAndShiftRight) { |
} |
} |
+TEST_F(InstructionSelectorTest, Word32ReverseBytes) { |
+ { |
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Int32()); |
+ m.Return(m.Word32ReverseBytes(m.Parameter(0))); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kMips64ByteSwap32, s[0]->arch_opcode()); |
+ EXPECT_EQ(1U, s[0]->InputCount()); |
+ EXPECT_EQ(1U, s[0]->OutputCount()); |
+ } |
+} |
+ |
+TEST_F(InstructionSelectorTest, Word64ReverseBytes) { |
+ { |
+ StreamBuilder m(this, MachineType::Int64(), MachineType::Int64()); |
+ m.Return(m.Word64ReverseBytes(m.Parameter(0))); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kMips64ByteSwap64, s[0]->arch_opcode()); |
+ EXPECT_EQ(1U, s[0]->InputCount()); |
+ EXPECT_EQ(1U, s[0]->OutputCount()); |
+ } |
+} |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |