diff options
author | Christophe Lyon <christophe.lyon@st.com> | 2014-05-16 17:12:21 +0200 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@st.com> | 2014-05-16 17:12:21 +0200 |
commit | fad316adcad1edd1cbb1e01769768abcffcb1070 (patch) | |
tree | 3823267fa869acfebee0e0c30d86a277afb1f45c | |
parent | 2abbb6e9c9987f5d7cd9ff68c8812db388266e60 (diff) | |
download | platform_external_arm-neon-tests-fad316adcad1edd1cbb1e01769768abcffcb1070.tar.gz platform_external_arm-neon-tests-fad316adcad1edd1cbb1e01769768abcffcb1070.tar.bz2 platform_external_arm-neon-tests-fad316adcad1edd1cbb1e01769768abcffcb1070.zip |
Add new output file, to make conversion to GCC dejagnu testsuite easier.
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | compute_ref.c | 8 | ||||
-rw-r--r-- | ref_v_binary_sat_op.c | 3 | ||||
-rw-r--r-- | ref_v_unary_sat_op.c | 3 | ||||
-rw-r--r-- | ref_vqdmlal.c | 3 | ||||
-rw-r--r-- | ref_vqdmlal_lane.c | 3 | ||||
-rw-r--r-- | ref_vqdmlal_n.c | 3 | ||||
-rw-r--r-- | ref_vqdmulh.c | 3 | ||||
-rw-r--r-- | ref_vqdmulh_lane.c | 3 | ||||
-rw-r--r-- | ref_vqdmulh_n.c | 17 | ||||
-rw-r--r-- | ref_vqdmull.c | 3 | ||||
-rw-r--r-- | ref_vqdmull_lane.c | 3 | ||||
-rw-r--r-- | ref_vqdmull_n.c | 3 | ||||
-rw-r--r-- | ref_vqmovn.c | 3 | ||||
-rw-r--r-- | ref_vqmovun.c | 3 | ||||
-rw-r--r-- | ref_vqrdmulh.c | 3 | ||||
-rw-r--r-- | ref_vqrdmulh_lane.c | 3 | ||||
-rw-r--r-- | ref_vqrdmulh_n.c | 17 | ||||
-rw-r--r-- | ref_vqrshl.c | 3 | ||||
-rw-r--r-- | ref_vqrshrn_n.c | 3 | ||||
-rw-r--r-- | ref_vqrshrun_n.c | 3 | ||||
-rw-r--r-- | ref_vqshl.c | 3 | ||||
-rw-r--r-- | ref_vqshl_n.c | 17 | ||||
-rw-r--r-- | ref_vqshlu_n.c | 3 | ||||
-rw-r--r-- | ref_vqshrn_n.c | 3 | ||||
-rw-r--r-- | ref_vqshrun_n.c | 3 | ||||
-rw-r--r-- | stm-arm-neon-ref.h | 65 |
27 files changed, 141 insertions, 50 deletions
@@ -85,7 +85,7 @@ compute_ref.axf: scatter.scat compute_ref.rvct.o retarget.rvct.o \ $(LD.rvct) $(LDFLAGS.rvct) --scatter $^ -o $@ compute_ref.rvct.o retarget.rvct.o: %.rvct.o: %.c - $(CC.rvct) $(CFLAGS.rvct) -c $^ -o $@ -DREFFILE=\"$(REFRVCT)\" + $(CC.rvct) $(CFLAGS.rvct) -c $^ -o $@ -DREFFILE=\"$(REFRVCT)\" -DGCCTESTS_FILE=\"expected_input4gcc.txt\" ref_%.rvct.o: ref_%.c stm-arm-neon-ref.h $(CC.rvct) $(CFLAGS.rvct) -c $< -o $@ @@ -162,4 +162,4 @@ ref_vsubw.*.o: ref_vaddw.c ref_vcage.*.o ref_vcale.*.o ref_vcagt.*.o ref_vcalt.*.o: ref_v_comp_f_op.c clean: - rm -f *.o *.log stm-arm-neon.refrvct + rm -f *.o *.log stm-arm-neon.refrvct expected_input4gcc.txt diff --git a/compute_ref.c b/compute_ref.c index d6b364e..331fa01 100644 --- a/compute_ref.c +++ b/compute_ref.c @@ -35,6 +35,7 @@ THE SOFTWARE. FILE* log_file = NULL; FILE* ref_file = NULL; +FILE* gcc_tests_file = NULL; #define LOGFILE "stm-arm-neon-ref.log" @@ -42,6 +43,7 @@ void cleanup (void) { if (log_file) fclose (log_file); if (ref_file) fclose (ref_file); + if (gcc_tests_file) fclose (gcc_tests_file); exit (1); } @@ -211,6 +213,12 @@ int main (void) cleanup (); } + gcc_tests_file = fopen (GCCTESTS_FILE, "w"); + if (gcc_tests_file == NULL) { + fprintf (log_file, "Error opening GCC ref file %s\n", GCCTESTS_FILE); + cleanup (); + } + fprintf (log_file, "Computing refs....\n"); exec_vld1 (); diff --git a/ref_v_binary_sat_op.c b/ref_v_binary_sat_op.c index b2cae86..7c72e15 100644 --- a/ref_v_binary_sat_op.c +++ b/ref_v_binary_sat_op.c @@ -47,7 +47,8 @@ FNNAME (INSN_NAME) VECT_VAR(vector2, T1, W, N)); \ vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W), \ + xSTR(T1), W, N) #define TEST_BINARY_SAT_OP(INSN, Q, T1, T2, W, N) \ TEST_BINARY_SAT_OP1(INSN, Q, T1, T2, W, N) diff --git a/ref_v_unary_sat_op.c b/ref_v_unary_sat_op.c index fdee616..37c1757 100644 --- a/ref_v_unary_sat_op.c +++ b/ref_v_unary_sat_op.c @@ -45,7 +45,8 @@ FNNAME (INSN_NAME) INSN##Q##_##T2##W(VECT_VAR(vector, T1, W, N)); \ vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W), \ + xSTR(T1), W, N) #define TEST_UNARY_SAT_OP(INSN, Q, T1, T2, W, N) \ TEST_UNARY_SAT_OP1(INSN, Q, T1, T2, W, N) diff --git a/ref_vqdmlal.c b/ref_vqdmlal.c index ff7ce56..c686c9d 100644 --- a/ref_vqdmlal.c +++ b/ref_vqdmlal.c @@ -52,7 +52,8 @@ FNNAME (INSN_NAME) VECT_VAR(vector4, T1, W2, N)); \ vst1q_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W2)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W2), \ + xSTR(T1), W, N) #define TEST_VQDMLXL(INSN, T1, T2, W, W2, N) \ TEST_VQDMLXL1(INSN, T1, T2, W, W2, N) diff --git a/ref_vqdmlal_lane.c b/ref_vqdmlal_lane.c index bdc19c9..903b822 100644 --- a/ref_vqdmlal_lane.c +++ b/ref_vqdmlal_lane.c @@ -52,7 +52,8 @@ FNNAME (INSN_NAME) V); \ vst1q_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W2)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W2), \ + xSTR(T1), W, N) #define TEST_VQDMLXL_LANE(INSN, T1, T2, W, W2, N, V) \ TEST_VQDMLXL_LANE1(INSN, T1, T2, W, W2, N, V) diff --git a/ref_vqdmlal_n.c b/ref_vqdmlal_n.c index 6d4dede..c9a3dc1 100644 --- a/ref_vqdmlal_n.c +++ b/ref_vqdmlal_n.c @@ -51,7 +51,8 @@ FNNAME (INSN_NAME) V); \ vst1q_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W2)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W2), \ + xSTR(T1), W, N) #define TEST_VQDMLXL_N(INSN, T1, T2, W, W2, N, V) \ TEST_VQDMLXL_N1(INSN, T1, T2, W, W2, N, V) diff --git a/ref_vqdmulh.c b/ref_vqdmulh.c index 0063ec0..a9ee93f 100644 --- a/ref_vqdmulh.c +++ b/ref_vqdmulh.c @@ -47,7 +47,8 @@ FNNAME (INSN) VECT_VAR(vector2, T1, W, N)); \ vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQDMULH1(INSN, Q, T1, T2, W, N) \ diff --git a/ref_vqdmulh_lane.c b/ref_vqdmulh_lane.c index 9f4c7da..2d6bb39 100644 --- a/ref_vqdmulh_lane.c +++ b/ref_vqdmulh_lane.c @@ -47,7 +47,8 @@ FNNAME (INSN) L); \ vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_lane_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_lane_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQDMULH_LANE1(INSN, Q, T1, T2, W, N, N2, L) \ diff --git a/ref_vqdmulh_n.c b/ref_vqdmulh_n.c index d009377..847edba 100644 --- a/ref_vqdmulh_n.c +++ b/ref_vqdmulh_n.c @@ -41,14 +41,15 @@ FNNAME (INSN) int i; /* vector_res = vqdmulh_n(vector,val), then store the result. */ -#define TEST_VQDMULH_N2(INSN, Q, T1, T2, W, N, L) \ - Set_Neon_Overflow(0); \ - VECT_VAR(vector_res, T1, W, N) = \ - INSN##Q##_n_##T2##W(VECT_VAR(vector, T1, W, N), \ - L); \ - vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ - VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_n_##T2##W)) +#define TEST_VQDMULH_N2(INSN, Q, T1, T2, W, N, L) \ + Set_Neon_Overflow(0); \ + VECT_VAR(vector_res, T1, W, N) = \ + INSN##Q##_n_##T2##W(VECT_VAR(vector, T1, W, N), \ + L); \ + vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ + VECT_VAR(vector_res, T1, W, N)); \ + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_n_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQDMULH_N1(INSN, Q, T1, T2, W, N, L) \ diff --git a/ref_vqdmull.c b/ref_vqdmull.c index 2d5f696..1d6bb6e 100644 --- a/ref_vqdmull.c +++ b/ref_vqdmull.c @@ -46,7 +46,8 @@ FNNAME (INSN) VECT_VAR(vector2, T1, W, N)); \ vst1q_##T2##W2(VECT_VAR(result, T1, W2, N), \ VECT_VAR(vector_res, T1, W2, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQDMULL1(INSN, T1, T2, W, W2, N) \ diff --git a/ref_vqdmull_lane.c b/ref_vqdmull_lane.c index b77fbd0..ae50a2e 100644 --- a/ref_vqdmull_lane.c +++ b/ref_vqdmull_lane.c @@ -49,7 +49,8 @@ FNNAME (INSN) L); \ vst1q_##T2##W2(VECT_VAR(result, T1, W2, N), \ VECT_VAR(vector_res, T1, W2, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_lane_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_lane_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQDMULL_LANE1(INSN, T1, T2, W, W2, N, L) \ diff --git a/ref_vqdmull_n.c b/ref_vqdmull_n.c index 7a149cc..e41593d 100644 --- a/ref_vqdmull_n.c +++ b/ref_vqdmull_n.c @@ -48,7 +48,8 @@ FNNAME (INSN) L); \ vst1q_##T2##W2(VECT_VAR(result, T1, W2, N), \ VECT_VAR(vector_res, T1, W2, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_n_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_n_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQDMULL_N1(INSN, T1, T2, W, W2, N, L) \ diff --git a/ref_vqmovn.c b/ref_vqmovn.c index 838aa46..303aba7 100644 --- a/ref_vqmovn.c +++ b/ref_vqmovn.c @@ -46,7 +46,8 @@ FNNAME (INSN_NAME) INSN##_##T2##W2(VECT_VAR(vector, T1, W2, N)); \ vst1##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W2)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W2), \ + xSTR(T1), W, N) #define TEST_UNARY_OP(INSN, T1, T2, W, W2, N) \ TEST_UNARY_OP1(INSN, T1, T2, W, W2, N) \ diff --git a/ref_vqmovun.c b/ref_vqmovun.c index 42326ee..292d116 100644 --- a/ref_vqmovun.c +++ b/ref_vqmovun.c @@ -46,7 +46,8 @@ FNNAME (INSN_NAME) INSN##_s##W2(VECT_VAR(vector, int, W2, N)); \ vst1##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_s##W2)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_s##W2), \ + xSTR(T1), W, N) #define TEST_UNARY_OP(INSN, T1, T2, W, W2, N) \ TEST_UNARY_OP1(INSN, T1, T2, W, W2, N) \ diff --git a/ref_vqrdmulh.c b/ref_vqrdmulh.c index cf878aa..4d9ced3 100644 --- a/ref_vqrdmulh.c +++ b/ref_vqrdmulh.c @@ -47,7 +47,8 @@ FNNAME (INSN) VECT_VAR(vector2, T1, W, N)); \ vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQRDMULH1(INSN, Q, T1, T2, W, N) \ diff --git a/ref_vqrdmulh_lane.c b/ref_vqrdmulh_lane.c index 4a713aa..93890c4 100644 --- a/ref_vqrdmulh_lane.c +++ b/ref_vqrdmulh_lane.c @@ -48,7 +48,8 @@ FNNAME (INSN) L); \ vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_lane_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_lane_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQRDMULH_LANE1(INSN, Q, T1, T2, W, N, N2, L) \ diff --git a/ref_vqrdmulh_n.c b/ref_vqrdmulh_n.c index eb79f56..3b7e8d8 100644 --- a/ref_vqrdmulh_n.c +++ b/ref_vqrdmulh_n.c @@ -42,14 +42,15 @@ FNNAME (INSN) int i; /* vector_res = vqrdmulh_n(vector,val), then store the result. */ -#define TEST_VQRDMULH_N2(INSN, Q, T1, T2, W, N, L) \ - Set_Neon_Overflow(0); \ - VECT_VAR(vector_res, T1, W, N) = \ - INSN##Q##_n_##T2##W(VECT_VAR(vector, T1, W, N), \ - L); \ - vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ - VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_n_##T2##W)) +#define TEST_VQRDMULH_N2(INSN, Q, T1, T2, W, N, L) \ + Set_Neon_Overflow(0); \ + VECT_VAR(vector_res, T1, W, N) = \ + INSN##Q##_n_##T2##W(VECT_VAR(vector, T1, W, N), \ + L); \ + vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ + VECT_VAR(vector_res, T1, W, N)); \ + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_n_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQRDMULH_N1(INSN, Q, T1, T2, W, N, L) \ diff --git a/ref_vqrshl.c b/ref_vqrshl.c index 3af92b7..9e09619 100644 --- a/ref_vqrshl.c +++ b/ref_vqrshl.c @@ -47,7 +47,8 @@ FNNAME (INSN) VECT_VAR(vector_shift, T3, W, N)); \ vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQRSHL1(INSN, T3, Q, T1, T2, W, N) \ diff --git a/ref_vqrshrn_n.c b/ref_vqrshrn_n.c index 21765e5..c73da4c 100644 --- a/ref_vqrshrn_n.c +++ b/ref_vqrshrn_n.c @@ -47,7 +47,8 @@ FNNAME (INSN) V); \ vst1_##T2##W2(VECT_VAR(result, T1, W2, N), \ VECT_VAR(vector_res, T1, W2, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQRSHRN_N1(INSN, T1, T2, W, W2, N, V) \ diff --git a/ref_vqrshrun_n.c b/ref_vqrshrun_n.c index a80b396..c525f4a 100644 --- a/ref_vqrshrun_n.c +++ b/ref_vqrshrun_n.c @@ -47,7 +47,8 @@ FNNAME (INSN) V); \ vst1_u##W2(VECT_VAR(result, uint, W2, N), \ VECT_VAR(vector_res, uint, W2, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQRSHRUN_N1(INSN, T1, T2, W, W2, N, V) \ diff --git a/ref_vqshl.c b/ref_vqshl.c index 277c2f4..7f9c02b 100644 --- a/ref_vqshl.c +++ b/ref_vqshl.c @@ -47,7 +47,8 @@ FNNAME (INSN) VECT_VAR(vector_shift, T3, W, N)); \ vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQSHL1(INSN, T3, Q, T1, T2, W, N) \ diff --git a/ref_vqshl_n.c b/ref_vqshl_n.c index 7f56980..731c4ca 100644 --- a/ref_vqshl_n.c +++ b/ref_vqshl_n.c @@ -40,14 +40,15 @@ THE SOFTWARE. FNNAME (INSN) { /* Basic test: v2=vqshl_n(v1,v), then store the result. */ -#define TEST_VQSHL_N2(INSN, Q, T1, T2, W, N, V) \ - Set_Neon_Overflow(0); \ - VECT_VAR(vector_res, T1, W, N) = \ - INSN##Q##_n_##T2##W(VECT_VAR(vector, T1, W, N), \ - V); \ - vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ - VECT_VAR(vector_res, T1, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_n_##T2##W)) +#define TEST_VQSHL_N2(INSN, Q, T1, T2, W, N, V) \ + Set_Neon_Overflow(0); \ + VECT_VAR(vector_res, T1, W, N) = \ + INSN##Q##_n_##T2##W(VECT_VAR(vector, T1, W, N), \ + V); \ + vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \ + VECT_VAR(vector_res, T1, W, N)); \ + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_n_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQSHL_N1(INSN, T3, Q, T1, T2, W, N) \ diff --git a/ref_vqshlu_n.c b/ref_vqshlu_n.c index 1f3f1b3..c8b14a6 100644 --- a/ref_vqshlu_n.c +++ b/ref_vqshlu_n.c @@ -47,7 +47,8 @@ FNNAME (INSN) V); \ vst1##Q##_##T4##W(VECT_VAR(result, T3, W, N), \ VECT_VAR(vector_res, T3, W, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_n_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##Q##_n_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQSHLU_N1(INSN, Q, T1, T2, T3, T4, W, N, V) \ diff --git a/ref_vqshrn_n.c b/ref_vqshrn_n.c index 8c0ccf8..21c080c 100644 --- a/ref_vqshrn_n.c +++ b/ref_vqshrn_n.c @@ -47,7 +47,8 @@ FNNAME (INSN) V); \ vst1_##T2##W2(VECT_VAR(result, T1, W2, N), \ VECT_VAR(vector_res, T1, W2, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQSHRN_N1(INSN, T1, T2, W, W2, N, V) \ diff --git a/ref_vqshrun_n.c b/ref_vqshrun_n.c index 151fbec..bdf47bb 100644 --- a/ref_vqshrun_n.c +++ b/ref_vqshrun_n.c @@ -47,7 +47,8 @@ FNNAME (INSN) V); \ vst1_u##W2(VECT_VAR(result, uint, W2, N), \ VECT_VAR(vector_res, uint, W2, N)); \ - dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W)) + dump_neon_overflow(TEST_MSG, xSTR(INSN##_##T2##W), \ + xSTR(T1), W, N) /* Two auxliary macros are necessary to expand INSN */ #define TEST_VQSHRUN_N1(INSN, T1, T2, W, W2, N, V) \ diff --git a/stm-arm-neon-ref.h b/stm-arm-neon-ref.h index 3ea931f..ba29f10 100644 --- a/stm-arm-neon-ref.h +++ b/stm-arm-neon-ref.h @@ -82,7 +82,8 @@ static int result_idx = 0; { \ fprintf(ref_file, "%" FMT ", ", VECT_VAR(result, T, W, N)[i]); \ } \ - fprintf(ref_file, " }\n"); + fprintf(ref_file, " }\n"); \ + DUMP4GCC(MSG,T,W,N,FMT); #define DUMP_FP(MSG,T,W,N,FMT) \ fprintf(ref_file, "%s:%d:%s [] = { ", MSG, result_idx++, \ @@ -96,7 +97,46 @@ static int result_idx = 0; tmp.f = VECT_VAR(result, T, W, N)[i]; \ fprintf(ref_file, "%" FMT " %.7a %.7g, ", tmp.i, tmp.f, tmp.f); \ } \ - fprintf(ref_file, " }\n"); + fprintf(ref_file, " }\n"); \ + DUMP4GCC_FP(MSG,T,W,N,FMT); + +#define DUMP4GCC(MSG,T,W,N,FMT) \ + fprintf(gcc_tests_file, "VECT_VAR_DECL(expected,%s,%d,%d) [] = { ", \ + STR(T), W, N); \ + for(i=0; i<(N-1) ; i++) \ + { \ + if (W < 32) { \ + uint32_t tmp = (uint##W##_t) VECT_VAR(result, T, W, N)[i]; \ + fprintf(gcc_tests_file, "0x%" FMT ", ", tmp); \ + } else { \ + fprintf(gcc_tests_file, "0x%" FMT ", ", VECT_VAR(result, T, W, N)[i]); \ + } \ + } \ + if (W < 32) { \ + uint32_t tmp = (uint##W##_t) VECT_VAR(result, T, W, N)[i]; \ + fprintf(gcc_tests_file, "0x%" FMT, tmp); \ + } else { \ + fprintf(gcc_tests_file, "0x%" FMT, VECT_VAR(result, T, W, N)[i]); \ + } \ + fprintf(gcc_tests_file, " };\n"); + +#define DUMP4GCC_FP(MSG,T,W,N,FMT) \ + { \ + union fp_operand { \ + uint##W##_t i; \ + float##W##_t f; \ + } tmp; \ + fprintf(gcc_tests_file, "VECT_VAR_DECL(expected,%s,%d,%d) [] = { ", \ + "hfloat", W, N); \ + for(i=0; i<(N-1) ; i++) \ + { \ + tmp.f = VECT_VAR(result, T, W, N)[i]; \ + fprintf(gcc_tests_file, "0x%" FMT ", ", tmp.i); \ + } \ + tmp.f = VECT_VAR(result, T, W, N)[i]; \ + fprintf(gcc_tests_file, "0x%" FMT, tmp.i); \ + fprintf(gcc_tests_file, " };\n"); \ + } /* ARMCC has internal knowledge of half-precision type. Define this alias to avoid having to duplicate declarations. */ @@ -115,6 +155,19 @@ static int result_idx = 0; } \ fprintf(ref_file, " }\n"); +#define DUMP4GCC_FP16(MSG,T,W,N,FMT) \ + if (0) { \ + fprintf(gcc_tests_file, "%s:%d:%s [] = { ", MSG, result_idx++, \ + STR(VECT_VAR(result, T, W, N))); \ + for(i=0; i<N ; i++) \ + { \ + uint##W##_t tmp; \ + tmp = (uint##W##_t)VECT_VAR(result, T, W, N)[i]; \ + fprintf(gcc_tests_file, "%" FMT ", ", tmp); \ + } \ + fprintf(gcc_tests_file, " }\n"); \ + } + #define CLEAN_PATTERN_8 0x33 #define CLEAN_PATTERN_16 0x3333 #define CLEAN_PATTERN_32 0x33333333 @@ -146,6 +199,7 @@ static int result_idx = 0; /* Generic declarations: */ extern FILE* log_file; extern FILE* ref_file; +extern FILE* gcc_tests_file; /* Input buffers, one of each size */ extern ARRAY(buffer, int, 8, 8); @@ -383,6 +437,7 @@ static void dump_results (char *test_name) int i; fprintf(ref_file, "\n%s output:\n", test_name); + fprintf(gcc_tests_file, "\n%s output:\n", test_name); DUMP(test_name, int, 8, 8, PRId8); DUMP(test_name, int, 16, 4, PRId16); @@ -421,6 +476,7 @@ static void dump_results_hex2 (const char *test_name, const char* comment) int i; fprintf(ref_file, "\n%s%s output:\n", test_name, comment); + fprintf(gcc_tests_file, "\n%s%s output:\n", test_name, comment); DUMP(test_name, int, 8, 8, PRIx8); DUMP(test_name, int, 16, 4, PRIx16); @@ -529,10 +585,13 @@ static void __set_neon_overflow(int x) { #endif /* STM_ARM_NEON_MODELS */ -static void dump_neon_overflow(const char* msg, const char *name) +static void dump_neon_overflow(const char* msg, const char *name, + const char* t1, int w, int n) { fprintf(ref_file, "%s:%d:%s Neon overflow %d\n", msg, result_idx++, name, Neon_Overflow); + fprintf(gcc_tests_file, "int VECT_VAR(expected_overflow,%s,%d,%d) = %d;\n", \ + t1, w, n, Neon_Overflow); } /* Clean output buffers before execution */ |