Commit b098c54d by Casey Dahlin

Add test for MulAdd in Reactor

Test: New test passes Bug: b/37496078 Change-Id: Ieff1b080bdde3f9c86a0531566c8b08d7cdf24fe Reviewed-on: https://swiftshader-review.googlesource.com/13009Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarCasey Dahlin <sadmac@google.com>
parent f6951fa3
...@@ -923,6 +923,41 @@ TEST(SubzeroReactorTest, MulHigh) { ...@@ -923,6 +923,41 @@ TEST(SubzeroReactorTest, MulHigh) {
delete routine; delete routine;
} }
TEST(SubzeroReactorTest, MulAdd) {
Routine *routine = nullptr;
{
Function<Int(Pointer<Byte>)> function;
{
Pointer<Byte> out = function.Arg<0>();
*Pointer<Int2>(out + 8 * 0) =
MulAdd(Short4(0x1aa, 0x2dd, 0x3ee, 0xF422),
Short4(0x1bb, 0x2cc, 0x3ff, 0xF411));
// (U)Short8 variant is mentioned but unimplemented
Return(0);
}
routine = function(L"one");
if(routine)
{
int out[1][2];
memset(&out, 0, sizeof(out));
int(*callable)(void*) = (int(*)(void*))routine->getEntry();
callable(&out);
EXPECT_EQ((unsigned)out[0][0], 0x000ae34a);
EXPECT_EQ((unsigned)out[0][1], 0x009d5254);
}
}
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