diff options
author | Christophe Lyon <christophe.lyon@st.com> | 2011-09-26 18:00:27 +0200 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@st.com> | 2011-09-26 18:00:27 +0200 |
commit | c8aa0f690d4febd69842708d468673b7f2c99c25 (patch) | |
tree | d032a0de6dd6b5472d4e0280861903fc5369ca14 /ref_vmax.c | |
parent | ae97a862ad03f118f56e9b4d099f1fcf1d50c541 (diff) | |
download | platform_external_arm-neon-tests-c8aa0f690d4febd69842708d468673b7f2c99c25.tar.gz platform_external_arm-neon-tests-c8aa0f690d4febd69842708d468673b7f2c99c25.tar.bz2 platform_external_arm-neon-tests-c8aa0f690d4febd69842708d468673b7f2c99c25.zip |
Add more corner case tests.
Diffstat (limited to 'ref_vmax.c')
-rw-r--r-- | ref_vmax.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -30,6 +30,7 @@ THE SOFTWARE. #endif #include "stm-arm-neon-ref.h" +#include <math.h> #ifndef INSN_NAME #define INSN_NAME vmax @@ -43,6 +44,8 @@ THE SOFTWARE. FNNAME (INSN_NAME) { + int i; + /* Basic test: y=OP(x,x), then store the result. */ #define TEST_BINARY_OP1(INSN, Q, T1, T2, W, N) \ VECT_VAR(vector_res, T1, W, N) = \ @@ -113,4 +116,28 @@ FNNAME (INSN_NAME) TEST_MACRO_NO64BIT_VARIANT_1_5(TEST_BINARY_OP, INSN_NAME); dump_results_hex (TEST_MSG); + + +#ifndef NO_FLOAT_VARIANT + /* Extra FP tests with special values (NaN, ....) */ + TEST_VDUP(vector, q, float, f, 32, 4, 1.0f); + TEST_VDUP(vector2, q, float, f, 32, 4, NAN); + TEST_BINARY_OP(INSN_NAME, q, float, f, 32, 4); + DUMP_FP(TEST_MSG " FP special (NAN)", float, 32, 4, PRIx32); + + TEST_VDUP(vector, q, float, f, 32, 4, NAN); + TEST_VDUP(vector2, q, float, f, 32, 4, 1.0f); + TEST_BINARY_OP(INSN_NAME, q, float, f, 32, 4); + DUMP_FP(TEST_MSG " FP special (NAN)", float, 32, 4, PRIx32); + + TEST_VDUP(vector, q, float, f, 32, 4, 0.0f); + TEST_VDUP(vector2, q, float, f, 32, 4, -0.0f); + TEST_BINARY_OP(INSN_NAME, q, float, f, 32, 4); + DUMP_FP(TEST_MSG " FP special (-0.0)", float, 32, 4, PRIx32); + + TEST_VDUP(vector, q, float, f, 32, 4, -0.0f); + TEST_VDUP(vector2, q, float, f, 32, 4, 0.0f); + TEST_BINARY_OP(INSN_NAME, q, float, f, 32, 4); + DUMP_FP(TEST_MSG " FP special (-0.0)", float, 32, 4, PRIx32); +#endif } |