aboutsummaryrefslogtreecommitdiffstats
path: root/ref_vqrshl.c
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2011-09-22 11:31:22 +0200
committerChristophe Lyon <christophe.lyon@st.com>2011-09-22 11:31:22 +0200
commit7d7c403fe59e66a3a7a5311d04583e938aed25db (patch)
treeffb7970406319a519edd620aee918f0fd9a68f6a /ref_vqrshl.c
parent533adff4b720984ddcde604535832b44e45ee9fd (diff)
downloadplatform_external_arm-neon-tests-7d7c403fe59e66a3a7a5311d04583e938aed25db.tar.gz
platform_external_arm-neon-tests-7d7c403fe59e66a3a7a5311d04583e938aed25db.tar.bz2
platform_external_arm-neon-tests-7d7c403fe59e66a3a7a5311d04583e938aed25db.zip
Add tests with large shift amounts.
Diffstat (limited to 'ref_vqrshl.c')
-rw-r--r--ref_vqrshl.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/ref_vqrshl.c b/ref_vqrshl.c
index 95bd0ad..9fb652b 100644
--- a/ref_vqrshl.c
+++ b/ref_vqrshl.c
@@ -196,4 +196,73 @@ FNNAME (INSN)
TEST_MSG " (checking overflow: shift by -3)");
TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
dump_results_hex2 (TEST_MSG, " (checking overflow: shift by -3)");
+
+
+ /* Use large shift amount */
+ TEST_VDUP(vector_shift, , int, s, 8, 8, 10);
+ TEST_VDUP(vector_shift, , int, s, 16, 4, 20);
+ TEST_VDUP(vector_shift, , int, s, 32, 2, 40);
+ TEST_VDUP(vector_shift, , int, s, 64, 1, 70);
+ TEST_VDUP(vector_shift, q, int, s, 8, 16, 10);
+ TEST_VDUP(vector_shift, q, int, s, 16, 8, 20);
+ TEST_VDUP(vector_shift, q, int, s, 32, 4, 40);
+ TEST_VDUP(vector_shift, q, int, s, 64, 2, 70);
+
+ fprintf(ref_file, "\n%s overflow output:\n",
+ TEST_MSG " (checking overflow: large shift amount)");
+ TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
+ dump_results_hex2 (TEST_MSG, " (checking overflow: large shift amount)");
+
+
+ /* Fill input vector with negative values, to check saturation on limits */
+ TEST_VDUP(vector, , int, s, 8, 8, 0x80);
+ TEST_VDUP(vector, , int, s, 16, 4, 0x8000);
+ TEST_VDUP(vector, , int, s, 32, 2, 0x80000000);
+ TEST_VDUP(vector, , int, s, 64, 1, 0x8000000000000000LL);
+ TEST_VDUP(vector, q, int, s, 8, 16, 0x80);
+ TEST_VDUP(vector, q, int, s, 16, 8, 0x8000);
+ TEST_VDUP(vector, q, int, s, 32, 4, 0x80000000);
+ TEST_VDUP(vector, q, int, s, 64, 2, 0x8000000000000000LL);
+
+ /* Use large shift amount */
+ TEST_VDUP(vector_shift, , int, s, 8, 8, 10);
+ TEST_VDUP(vector_shift, , int, s, 16, 4, 20);
+ TEST_VDUP(vector_shift, , int, s, 32, 2, 40);
+ TEST_VDUP(vector_shift, , int, s, 64, 1, 70);
+ TEST_VDUP(vector_shift, q, int, s, 8, 16, 10);
+ TEST_VDUP(vector_shift, q, int, s, 16, 8, 20);
+ TEST_VDUP(vector_shift, q, int, s, 32, 4, 40);
+ TEST_VDUP(vector_shift, q, int, s, 64, 2, 70);
+
+ fprintf(ref_file, "\n%s overflow output:\n",
+ TEST_MSG " (checking overflow: large shift amount with negative input)");
+ TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
+ dump_results_hex2 (TEST_MSG, " (checking overflow: large shift amount with negative input)");
+
+
+ /* Fill input vector with negative and positive values, to check
+ * saturation on limits */
+ TEST_VDUP(vector, , int, s, 8, 8, 0x7F);
+ TEST_VDUP(vector, , int, s, 16, 4, 0x7FFF);
+ TEST_VDUP(vector, , int, s, 32, 2, 0x7FFFFFFF);
+ TEST_VDUP(vector, , int, s, 64, 1, 0x7FFFFFFFFFFFFFFFLL);
+ TEST_VDUP(vector, q, int, s, 8, 16, 0x80);
+ TEST_VDUP(vector, q, int, s, 16, 8, 0x8000);
+ TEST_VDUP(vector, q, int, s, 32, 4, 0x80000000);
+ TEST_VDUP(vector, q, int, s, 64, 2, 0x8000000000000000LL);
+
+ /* Use large negative shift amount */
+ TEST_VDUP(vector_shift, , int, s, 8, 8, -10);
+ TEST_VDUP(vector_shift, , int, s, 16, 4, -20);
+ TEST_VDUP(vector_shift, , int, s, 32, 2, -40);
+ TEST_VDUP(vector_shift, , int, s, 64, 1, -70);
+ TEST_VDUP(vector_shift, q, int, s, 8, 16, -10);
+ TEST_VDUP(vector_shift, q, int, s, 16, 8, -20);
+ TEST_VDUP(vector_shift, q, int, s, 32, 4, -40);
+ TEST_VDUP(vector_shift, q, int, s, 64, 2, -70);
+
+ fprintf(ref_file, "\n%s overflow output:\n",
+ TEST_MSG " (checking overflow: large negative shift amount)");
+ TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
+ dump_results_hex2 (TEST_MSG, " (checking overflow: large negative shift amount)");
}