Commit 7d532719 authored by Steinar Midtskogen's avatar Steinar Midtskogen

Make input buffers for intrinsics testing uint8_t

BUG=aomedia:401

Change-Id: I46ac4e1c9ad62d67536fd525d768899bfb758ae5
parent 37f6fe61
...@@ -816,7 +816,7 @@ void TestSimd1Arg(uint32_t iterations, uint32_t mask, uint32_t maskwidth, ...@@ -816,7 +816,7 @@ void TestSimd1Arg(uint32_t iterations, uint32_t mask, uint32_t maskwidth,
fptr ref_simd; fptr ref_simd;
fptr simd; fptr simd;
int error = 0; int error = 0;
DECLARE_ALIGNED(32, uint16_t, s[sizeof(CArg) / sizeof(uint16_t)]); DECLARE_ALIGNED(32, uint8_t, s[sizeof(CArg)]);
DECLARE_ALIGNED(32, uint8_t, d[sizeof(CRet)]); DECLARE_ALIGNED(32, uint8_t, d[sizeof(CRet)]);
DECLARE_ALIGNED(32, uint8_t, ref_d[sizeof(CRet)]); DECLARE_ALIGNED(32, uint8_t, ref_d[sizeof(CRet)]);
memset(ref_d, 0, sizeof(ref_d)); memset(ref_d, 0, sizeof(ref_d));
...@@ -826,14 +826,12 @@ void TestSimd1Arg(uint32_t iterations, uint32_t mask, uint32_t maskwidth, ...@@ -826,14 +826,12 @@ void TestSimd1Arg(uint32_t iterations, uint32_t mask, uint32_t maskwidth,
if (simd == NULL || ref_simd == NULL) { if (simd == NULL || ref_simd == NULL) {
FAIL() << "Internal error: Unknown intrinsic function " << name; FAIL() << "Internal error: Unknown intrinsic function " << name;
} }
for (unsigned int count = 0; for (unsigned int count = 0;
count < iterations && !error && !testing::Test::HasFailure(); count++) { count < iterations && !error && !testing::Test::HasFailure(); count++) {
for (unsigned int c = 0; c < sizeof(CArg) / sizeof(uint16_t); c++) for (unsigned int c = 0; c < sizeof(CArg); c++) s[c] = rnd.Rand8();
s[c] = rnd.Rand16();
if (maskwidth) { if (maskwidth) {
SetMask(reinterpret_cast<uint8_t *>(s), sizeof(CArg), mask, maskwidth); SetMask(s, sizeof(CArg), mask, maskwidth);
} }
if (typeid(CRet) == typeid(c_v64) && typeid(CArg) == typeid(c_v64)) { if (typeid(CRet) == typeid(c_v64) && typeid(CArg) == typeid(c_v64)) {
...@@ -971,9 +969,8 @@ void TestSimd1Arg(uint32_t iterations, uint32_t mask, uint32_t maskwidth, ...@@ -971,9 +969,8 @@ void TestSimd1Arg(uint32_t iterations, uint32_t mask, uint32_t maskwidth,
} }
EXPECT_EQ(0, error) << "Error: mismatch for " << name << "(" EXPECT_EQ(0, error) << "Error: mismatch for " << name << "("
<< Print((uint8_t *)s, sizeof(s)) << ") -> " << Print(s, sizeof(s)) << ") -> " << Print(d, sizeof(d))
<< Print(d, sizeof(d)) << " (simd), " << " (simd), " << Print(ref_d, sizeof(ref_d)) << " (ref)";
<< Print(ref_d, sizeof(ref_d)) << " (ref)";
} }
template <typename CRet, typename CArg1, typename CArg2> template <typename CRet, typename CArg1, typename CArg2>
...@@ -983,8 +980,8 @@ void TestSimd2Args(uint32_t iterations, uint32_t mask, uint32_t maskwidth, ...@@ -983,8 +980,8 @@ void TestSimd2Args(uint32_t iterations, uint32_t mask, uint32_t maskwidth,
fptr ref_simd; fptr ref_simd;
fptr simd; fptr simd;
int error = 0; int error = 0;
DECLARE_ALIGNED(32, uint16_t, s1[sizeof(CArg1) / sizeof(uint16_t)]); DECLARE_ALIGNED(32, uint8_t, s1[sizeof(CArg1)]);
DECLARE_ALIGNED(32, uint16_t, s2[sizeof(CArg2) / sizeof(uint16_t)]); DECLARE_ALIGNED(32, uint8_t, s2[sizeof(CArg2)]);
DECLARE_ALIGNED(32, uint8_t, d[sizeof(CRet)]); DECLARE_ALIGNED(32, uint8_t, d[sizeof(CRet)]);
DECLARE_ALIGNED(32, uint8_t, ref_d[sizeof(CRet)]); DECLARE_ALIGNED(32, uint8_t, ref_d[sizeof(CRet)]);
memset(ref_d, 0, sizeof(ref_d)); memset(ref_d, 0, sizeof(ref_d));
...@@ -997,14 +994,11 @@ void TestSimd2Args(uint32_t iterations, uint32_t mask, uint32_t maskwidth, ...@@ -997,14 +994,11 @@ void TestSimd2Args(uint32_t iterations, uint32_t mask, uint32_t maskwidth,
for (unsigned int count = 0; for (unsigned int count = 0;
count < iterations && !error && !testing::Test::HasFailure(); count++) { count < iterations && !error && !testing::Test::HasFailure(); count++) {
for (unsigned int c = 0; c < sizeof(CArg1) / sizeof(uint16_t); c++) for (unsigned int c = 0; c < sizeof(CArg1); c++) s1[c] = rnd.Rand8();
s1[c] = rnd.Rand16();
for (unsigned int c = 0; c < sizeof(CArg2) / sizeof(uint16_t); c++) for (unsigned int c = 0; c < sizeof(CArg2); c++) s2[c] = rnd.Rand8();
s2[c] = rnd.Rand16();
if (maskwidth) if (maskwidth) SetMask(s2, sizeof(CArg2), mask, maskwidth);
SetMask(reinterpret_cast<uint8_t *>(s2), sizeof(CArg2), mask, maskwidth);
if (typeid(CRet) == typeid(c_v64) && typeid(CArg1) == typeid(c_v64) && if (typeid(CRet) == typeid(c_v64) && typeid(CArg1) == typeid(c_v64) &&
typeid(CArg2) == typeid(c_v64)) { typeid(CArg2) == typeid(c_v64)) {
...@@ -1145,9 +1139,7 @@ void TestSimd2Args(uint32_t iterations, uint32_t mask, uint32_t maskwidth, ...@@ -1145,9 +1139,7 @@ void TestSimd2Args(uint32_t iterations, uint32_t mask, uint32_t maskwidth,
} }
EXPECT_EQ(0, error) << "Error: mismatch for " << name << "(" EXPECT_EQ(0, error) << "Error: mismatch for " << name << "("
<< Print(reinterpret_cast<uint8_t *>(s1), sizeof(s1)) << Print(s1, sizeof(s1)) << ", " << Print(s2, sizeof(s2))
<< ", "
<< Print(reinterpret_cast<uint8_t *>(s2), sizeof(s2))
<< ") -> " << Print(d, sizeof(d)) << " (simd), " << ") -> " << Print(d, sizeof(d)) << " (simd), "
<< Print(ref_d, sizeof(ref_d)) << " (ref)"; << Print(ref_d, sizeof(ref_d)) << " (ref)";
} }
......
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