Allocate space for the largest types in intrinsics tests
This stops the ARM gcc 7.3.0 warnings about the use of indices out of
bounds. Only the space needed for the types was allocated and correct
access to that space is ensured by if tests for the types, but some
gcc versions are doing the out of bounds checks before unreachable
code is eliminated, and will therefore warn.
Asserts have been added to ensure that enough space does get
allocated.
BUG=aomedia:1313
Change-Id: I5f64f71f88ce2e0f26b316919b930861c24108c6
diff --git a/test/simd_cmp_impl.h b/test/simd_cmp_impl.h
index 0022a63..b98af9a 100644
--- a/test/simd_cmp_impl.h
+++ b/test/simd_cmp_impl.h
@@ -1500,9 +1500,10 @@
fptr ref_simd;
fptr simd;
int error = 0;
- DECLARE_ALIGNED(32, uint8_t, s[sizeof(CArg)]);
- DECLARE_ALIGNED(32, uint8_t, d[sizeof(CRet)]);
- DECLARE_ALIGNED(32, uint8_t, ref_d[sizeof(CRet)]);
+ DECLARE_ALIGNED(32, uint8_t, s[32]);
+ DECLARE_ALIGNED(32, uint8_t, d[32]);
+ DECLARE_ALIGNED(32, uint8_t, ref_d[32]);
+ assert(sizeof(CArg) <= 32 && sizeof(CRet) <= 32);
memset(ref_d, 0, sizeof(ref_d));
memset(d, 0, sizeof(d));
@@ -1744,10 +1745,11 @@
fptr ref_simd;
fptr simd;
int error = 0;
- DECLARE_ALIGNED(32, uint8_t, s1[sizeof(CArg1)]);
- DECLARE_ALIGNED(32, uint8_t, s2[sizeof(CArg2)]);
- DECLARE_ALIGNED(32, uint8_t, d[sizeof(CRet)]);
- DECLARE_ALIGNED(32, uint8_t, ref_d[sizeof(CRet)]);
+ DECLARE_ALIGNED(32, uint8_t, s1[32]);
+ DECLARE_ALIGNED(32, uint8_t, s2[32]);
+ DECLARE_ALIGNED(32, uint8_t, d[32]);
+ DECLARE_ALIGNED(32, uint8_t, ref_d[32]);
+ assert(sizeof(CArg1) <= 32 && sizeof(CArg2) <= 32 && sizeof(CRet) <= 32);
memset(ref_d, 0, sizeof(ref_d));
memset(d, 0, sizeof(d));
@@ -2000,11 +2002,13 @@
fptr ref_simd;
fptr simd;
int error = 0;
- DECLARE_ALIGNED(32, uint8_t, s1[sizeof(CArg1)]);
- DECLARE_ALIGNED(32, uint8_t, s2[sizeof(CArg2)]);
- DECLARE_ALIGNED(32, uint8_t, s3[sizeof(CArg3)]);
- DECLARE_ALIGNED(32, uint8_t, d[sizeof(CRet)]);
- DECLARE_ALIGNED(32, uint8_t, ref_d[sizeof(CRet)]);
+ DECLARE_ALIGNED(32, uint8_t, s1[32]);
+ DECLARE_ALIGNED(32, uint8_t, s2[32]);
+ DECLARE_ALIGNED(32, uint8_t, s3[32]);
+ DECLARE_ALIGNED(32, uint8_t, d[32]);
+ DECLARE_ALIGNED(32, uint8_t, ref_d[32]);
+ assert(sizeof(CArg1) <= 32 && sizeof(CArg2) <= 32 && sizeof(CArg3) <= 32 &&
+ sizeof(CRet) <= 32);
memset(ref_d, 0, sizeof(ref_d));
memset(d, 0, sizeof(d));