Commit 36fad3cc by Casey Dahlin

Add test for MulHigh in Reactor

Test: New tests pass Bug: b/37496856 Change-Id: Ifae1f802d61a7d51f6e8f5c135e3c8c67be30125 Reviewed-on: https://swiftshader-review.googlesource.com/12950Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarCasey Dahlin <sadmac@google.com>
parent 7f301812
...@@ -882,6 +882,47 @@ TEST(SubzeroReactorTest, Pack) ...@@ -882,6 +882,47 @@ TEST(SubzeroReactorTest, Pack)
delete routine; delete routine;
} }
TEST(SubzeroReactorTest, MulHigh) {
Routine *routine = nullptr;
{
Function<Int(Pointer<Byte>)> function;
{
Pointer<Byte> out = function.Arg<0>();
*Pointer<Short4>(out + 8 * 0) =
MulHigh(Short4(0x1aa, 0x2dd, 0x3ee, 0xF422),
Short4(0x1bb, 0x2cc, 0x3ff, 0xF411));
*Pointer<UShort4>(out + 8 * 1) =
MulHigh(UShort4(0x1aa, 0x2dd, 0x3ee, 0xF422),
UShort4(0x1bb, 0x2cc, 0x3ff, 0xF411));
// (U)Short8 variants are mentioned but unimplemented
Return(0);
}
routine = function(L"one");
if(routine)
{
int out[2][2];
memset(&out, 0, sizeof(out));
int(*callable)(void*) = (int(*)(void*))routine->getEntry();
callable(&out);
EXPECT_EQ((unsigned)out[0][0], 0x00080002);
EXPECT_EQ((unsigned)out[0][1], 0x008d000f);
EXPECT_EQ((unsigned)out[1][0], 0x00080002);
EXPECT_EQ((unsigned)out[1][1], 0xe8c0000f);
}
}
delete routine;
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
......
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