Commit 65624c9e authored by Ivica Bogosavljevic's avatar Ivica Bogosavljevic Committed by Commit Bot

MIPS: Disable Word32SarWithWord32Shl on MIPSr1

MIPSr1 doesn't support SEB and SEH instructions and this
causes test InstructionSelectorTest.Word32SarWithWord32Shl to fail.

This CL disables this test on MIPSr1.

TEST=unittests/InstructionSelectorTest.Word32SarWithWord32Shl

Change-Id: I284a85210bd0d38374ca339671643560e8a305e2
Reviewed-on: https://chromium-review.googlesource.com/1164363Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Ivica Bogosavljevic <ibogosavljevic@wavecomp.com>
Cr-Commit-Position: refs/heads/master@{#54939}
parent a1986533
...@@ -411,33 +411,35 @@ TEST_F(InstructionSelectorTest, Word32ShlWithWord32And) { ...@@ -411,33 +411,35 @@ TEST_F(InstructionSelectorTest, Word32ShlWithWord32And) {
} }
TEST_F(InstructionSelectorTest, Word32SarWithWord32Shl) { TEST_F(InstructionSelectorTest, Word32SarWithWord32Shl) {
{ if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32()); {
Node* const p0 = m.Parameter(0); StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const r = Node* const p0 = m.Parameter(0);
m.Word32Sar(m.Word32Shl(p0, m.Int32Constant(24)), m.Int32Constant(24)); Node* const r = m.Word32Sar(m.Word32Shl(p0, m.Int32Constant(24)),
m.Return(r); m.Int32Constant(24));
Stream s = m.Build(); m.Return(r);
ASSERT_EQ(1U, s.size()); Stream s = m.Build();
EXPECT_EQ(kMipsSeb, s[0]->arch_opcode()); ASSERT_EQ(1U, s.size());
ASSERT_EQ(1U, s[0]->InputCount()); EXPECT_EQ(kMipsSeb, s[0]->arch_opcode());
EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); ASSERT_EQ(1U, s[0]->InputCount());
ASSERT_EQ(1U, s[0]->OutputCount()); EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output())); ASSERT_EQ(1U, s[0]->OutputCount());
} EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
{ }
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32()); {
Node* const p0 = m.Parameter(0); StreamBuilder m(this, MachineType::Int32(), MachineType::Int32());
Node* const r = Node* const p0 = m.Parameter(0);
m.Word32Sar(m.Word32Shl(p0, m.Int32Constant(16)), m.Int32Constant(16)); Node* const r = m.Word32Sar(m.Word32Shl(p0, m.Int32Constant(16)),
m.Return(r); m.Int32Constant(16));
Stream s = m.Build(); m.Return(r);
ASSERT_EQ(1U, s.size()); Stream s = m.Build();
EXPECT_EQ(kMipsSeh, s[0]->arch_opcode()); ASSERT_EQ(1U, s.size());
ASSERT_EQ(1U, s[0]->InputCount()); EXPECT_EQ(kMipsSeh, s[0]->arch_opcode());
EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); ASSERT_EQ(1U, s[0]->InputCount());
ASSERT_EQ(1U, s[0]->OutputCount()); EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output())); ASSERT_EQ(1U, s[0]->OutputCount());
EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output()));
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment