aboutsummaryrefslogtreecommitdiffstats
path: root/ref_vrecps.c
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2011-09-23 11:24:43 +0200
committerChristophe Lyon <christophe.lyon@st.com>2011-09-23 11:24:43 +0200
commitae97a862ad03f118f56e9b4d099f1fcf1d50c541 (patch)
treee71c0569bfea45efa7b037f6fbef9736ad87b5f3 /ref_vrecps.c
parent7d7c403fe59e66a3a7a5311d04583e938aed25db (diff)
downloadplatform_external_arm-neon-tests-ae97a862ad03f118f56e9b4d099f1fcf1d50c541.tar.gz
platform_external_arm-neon-tests-ae97a862ad03f118f56e9b4d099f1fcf1d50c541.tar.bz2
platform_external_arm-neon-tests-ae97a862ad03f118f56e9b4d099f1fcf1d50c541.zip
Add corner case tests in vrecps and vrsqrts (NaN, infinity, 0, ...)
Diffstat (limited to 'ref_vrecps.c')
-rw-r--r--ref_vrecps.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/ref_vrecps.c b/ref_vrecps.c
index cf8d71a..208cdce 100644
--- a/ref_vrecps.c
+++ b/ref_vrecps.c
@@ -30,6 +30,7 @@ THE SOFTWARE.
#endif
#include "stm-arm-neon-ref.h"
+#include <math.h>
#define TEST_MSG "VRECPS/VRECPSQ"
void exec_vrecps(void)
@@ -73,4 +74,46 @@ void exec_vrecps(void)
fprintf (ref_file, "\n%s output:\n", TEST_MSG);
DUMP_FP(TEST_MSG, float, 32, 2, PRIx32);
DUMP_FP(TEST_MSG, float, 32, 4, PRIx32);
+
+
+ /* Test FP variants with special input values (NaN) */
+ TEST_VDUP(vector, , float, f, 32, 2, NAN);
+ TEST_VDUP(vector2, q, float, f, 32, 4, NAN);
+
+ /* Apply the operator */
+ TEST_VRECPS(, float, f, 32, 2);
+ TEST_VRECPS(q, float, f, 32, 4);
+
+ fprintf (ref_file, "\n%s output:\n", TEST_MSG " FP special (NAN) and normal values");
+ DUMP_FP(TEST_MSG, float, 32, 2, PRIx32);
+ DUMP_FP(TEST_MSG, float, 32, 4, PRIx32);
+
+
+ /* Test FP variants with special input values (infinity, 0) */
+ TEST_VDUP(vector, , float, f, 32, 2, HUGE_VALF);
+ TEST_VDUP(vector, q, float, f, 32, 4, 0.0f);
+ TEST_VDUP(vector2, q, float, f, 32, 4, 3.2f); /* Restore a normal value */
+
+ /* Apply the operator */
+ TEST_VRECPS(, float, f, 32, 2);
+ TEST_VRECPS(q, float, f, 32, 4);
+
+ fprintf (ref_file, "\n%s output:\n", TEST_MSG " FP special (infinity, 0) and normal values");
+ DUMP_FP(TEST_MSG, float, 32, 2, PRIx32);
+ DUMP_FP(TEST_MSG, float, 32, 4, PRIx32);
+
+
+ /* Test FP variants with only special input values (infinity, 0) */
+ TEST_VDUP(vector, , float, f, 32, 2, HUGE_VALF);
+ TEST_VDUP(vector, q, float, f, 32, 4, 0.0f);
+ TEST_VDUP(vector2, , float, f, 32, 2, 0.0f);
+ TEST_VDUP(vector2, q, float, f, 32, 4, HUGE_VALF);
+
+ /* Apply the operator */
+ TEST_VRECPS(, float, f, 32, 2);
+ TEST_VRECPS(q, float, f, 32, 4);
+
+ fprintf (ref_file, "\n%s output:\n", TEST_MSG " FP special (infinity, 0)");
+ DUMP_FP(TEST_MSG, float, 32, 2, PRIx32);
+ DUMP_FP(TEST_MSG, float, 32, 4, PRIx32);
}