aboutsummaryrefslogtreecommitdiffstats
path: root/ref_vrecpe.c
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2011-02-16 18:23:15 +0100
committerChristophe Lyon <christophe.lyon@st.com>2011-02-18 10:36:57 +0100
commit1b7c8e96baf69e791fd2f557c0c8850103795cee (patch)
tree71fbbe730f76750495cf4f0cea2012fb291a22f9 /ref_vrecpe.c
parent6ed6dc41e965e2b370395cd43c61c439a0e6d352 (diff)
downloadplatform_external_arm-neon-tests-1b7c8e96baf69e791fd2f557c0c8850103795cee.tar.gz
platform_external_arm-neon-tests-1b7c8e96baf69e791fd2f557c0c8850103795cee.tar.bz2
platform_external_arm-neon-tests-1b7c8e96baf69e791fd2f557c0c8850103795cee.zip
vrecpe: add tests with NaNs, 0, infinity, large values
Diffstat (limited to 'ref_vrecpe.c')
-rw-r--r--ref_vrecpe.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/ref_vrecpe.c b/ref_vrecpe.c
index 4bb9714..3023ab6 100644
--- a/ref_vrecpe.c
+++ b/ref_vrecpe.c
@@ -30,6 +30,7 @@ THE SOFTWARE.
#endif
#include "stm-arm-neon-ref.h"
+#include <math.h>
#define TEST_MSG "VRECPE/VRECPEQ"
void exec_vrecpe(void)
@@ -94,4 +95,40 @@ void exec_vrecpe(void)
DUMP(TEST_MSG, uint, 32, 4, PRIx32);
DUMP_FP(TEST_MSG, float, 32, 2, PRIx32);
DUMP_FP(TEST_MSG, float, 32, 4, PRIx32);
+
+ /* Test FP variants with special input values (NaN, infinity) */
+ TEST_VDUP(vector, , float, f, 32, 2, NAN);
+ TEST_VDUP(vector, q, float, f, 32, 4, HUGE_VALF);
+
+ /* Apply the operator */
+ TEST_VRECPE(, float, f, 32, 2);
+ TEST_VRECPE(q, float, f, 32, 4);
+
+ fprintf (ref_file, "\n%s %s output:\n", TEST_MSG, " FP special (NaN, infinity)");
+ DUMP_FP(TEST_MSG, float, 32, 2, PRIx32);
+ DUMP_FP(TEST_MSG, float, 32, 4, PRIx32);
+
+ /* Test FP variants with special input values (zero, large value) */
+ TEST_VDUP(vector, , float, f, 32, 2, 0.0);
+ TEST_VDUP(vector, q, float, f, 32, 4, 9.0e37);
+
+ /* Apply the operator */
+ TEST_VRECPE(, float, f, 32, 2);
+ TEST_VRECPE(q, float, f, 32, 4);
+
+ fprintf (ref_file, "\n%s %s output:\n", TEST_MSG, " FP special (zero, large value)");
+ DUMP_FP(TEST_MSG, float, 32, 2, PRIx32);
+ DUMP_FP(TEST_MSG, float, 32, 4, PRIx32);
+
+ /* Test FP variants with special input values (-0, -infinity) */
+ TEST_VDUP(vector, , float, f, 32, 2, -0.0);
+ TEST_VDUP(vector, q, float, f, 32, 4, -HUGE_VALF);
+
+ /* Apply the operator */
+ TEST_VRECPE(, float, f, 32, 2);
+ TEST_VRECPE(q, float, f, 32, 4);
+
+ fprintf (ref_file, "\n%s %s output:\n", TEST_MSG, " FP special (-0, -infinity)");
+ DUMP_FP(TEST_MSG, float, 32, 2, PRIx32);
+ DUMP_FP(TEST_MSG, float, 32, 4, PRIx32);
}