MIPS[64]: Implement Word[32|64]ReverseByte instruction selector unit tests
BUG= Review-Url: https://codereview.chromium.org/2398993003 Cr-Commit-Position: refs/heads/master@{#42358}
This commit is contained in:
parent
4fb60b2158
commit
0d0d623b57
@ -653,6 +653,12 @@ class V8_EXPORT_PRIVATE RawMachineAssembler {
|
||||
Node* Float64RoundTiesEven(Node* a) {
|
||||
return AddNode(machine()->Float64RoundTiesEven().op(), a);
|
||||
}
|
||||
Node* Word32ReverseBytes(Node* a) {
|
||||
return AddNode(machine()->Word32ReverseBytes().op(), a);
|
||||
}
|
||||
Node* Word64ReverseBytes(Node* a) {
|
||||
return AddNode(machine()->Word64ReverseBytes().op(), a);
|
||||
}
|
||||
|
||||
// Float64 bit operations.
|
||||
Node* Float64ExtractLowWord32(Node* a) {
|
||||
|
@ -1454,6 +1454,18 @@ TEST_F(InstructionSelectorTest, Float64Min) {
|
||||
EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
|
||||
}
|
||||
|
||||
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(kMipsByteSwap32, s[0]->arch_opcode());
|
||||
EXPECT_EQ(1U, s[0]->InputCount());
|
||||
EXPECT_EQ(1U, s[0]->OutputCount());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace compiler
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user