tests/tcg: Massage MIPS tests for easier maintenance
v4 cover tests/tcg: Massage MIPS tests for easier maintenance
Missing review: #1
Since v3:
- removed unused header
- update to use latest TAP header correctly (rth)
Since v2:
- meson 1-line doc (pbo)
- use generic TAP header
Since v1:
- TAP (pbo)
- no more assert (pbo)
- split per group
- MSA ld/st tests
Based-on: <[email protected]>
Philippe Mathieu-Daudé (32):
tests/tcg/mips: Remove unused test_utils_32.h
tests/tcg/mips: Group DSP acc tests
tests/tcg/mips: Group DSP arith tests
tests/tcg/mips: Group DSP cmp tests
tests/tcg/mips: Group DSP ctrl tests
tests/tcg/mips: Group DSP dot tests
tests/tcg/mips: Group DSP mul tests
tests/tcg/mips: Group DSP pack tests
tests/tcg/mips: Group DSP shift tests
tests/tcg/mips: Group Release 6 bitops tests
tests/tcg/mips: Group Release 6 crc tests
tests/tcg/mips: Group Release 6 logic tests
tests/tcg/mips: Group Release 6 multiply tests
tests/tcg/mips: Group Release 6 shift tests
tests/tcg/mips: Group MSA bit-count tests
tests/tcg/mips: Group MSA bit-move tests
tests/tcg/mips: Group MSA bit-set tests
tests/tcg/mips: Group MSA fixed-multiply tests
tests/tcg/mips: Group MSA float-max-min tests
tests/tcg/mips: Group MSA int-add tests
tests/tcg/mips: Group MSA int-average tests
tests/tcg/mips: Group MSA int-compare tests
tests/tcg/mips: Group MSA int-div-mod tests
tests/tcg/mips: Group MSA int-dot-product tests
tests/tcg/mips: Group MSA int-max-min tests
tests/tcg/mips: Group MSA int-multiply tests
tests/tcg/mips: Group MSA int-subtract tests
tests/tcg/mips: Group MSA interleave tests
tests/tcg/mips: Group MSA logic tests
tests/tcg/mips: Group MSA pack tests
tests/tcg/mips: Group MSA shift tests
tests/tcg/mips: Add MSA load/store tests
tests/tcg/mips/include/test_utils_128.h | 32 +- tests/tcg/mips/include/test_utils_32.h | 78 ----- tests/tcg/mips/include/test_utils_64.h | 24 +- tests/tcg/mipsel/test_dsp_runner.h | 26 ++ tests/tcg/mips/test_msa_bit_count.c | 99 ++++++ tests/tcg/mips/test_msa_bit_move.c | 93 ++++++ tests/tcg/mips/test_msa_bit_set.c | 99 ++++++ tests/tcg/mips/test_msa_fixed_multiply.c | 99 ++++++ tests/tcg/mips/test_msa_float_max_min.c | 75 +++++ tests/tcg/mips/test_msa_int_add.c | 183 +++++++++++ tests/tcg/mips/test_msa_int_average.c | 123 +++++++ tests/tcg/mips/test_msa_int_compare.c | 147 +++++++++ tests/tcg/mips/test_msa_int_div_mod.c | 123 +++++++ tests/tcg/mips/test_msa_int_dot_product.c | 135 ++++++++ tests/tcg/mips/test_msa_int_max_min.c | 171 ++++++++++ tests/tcg/mips/test_msa_int_multiply.c | 99 ++++++ tests/tcg/mips/test_msa_int_subtract.c | 231 ++++++++++++++ tests/tcg/mips/test_msa_interleave.c | 123 +++++++ tests/tcg/mips/test_msa_load_store.c | 168 ++++++++++ tests/tcg/mips/test_msa_logic.c | 57 ++++ tests/tcg/mips/test_msa_pack.c | 99 ++++++ tests/tcg/mips/test_msa_shift.c | 147 +++++++++ tests/tcg/mips64/test_mips64r6_bitops.c | 60 ++++ tests/tcg/mips64/test_mips64r6_crc.c | 72 +++++ tests/tcg/mips64/test_mips64r6_logic.c | 48 +++ tests/tcg/mips64/test_mips64r6_multiply.c | 72 +++++ tests/tcg/mips64/test_mips64r6_shift.c | 60 ++++ tests/tcg/mipsel/test_dsp_acc.c | 109 +++++++ tests/tcg/mipsel/test_dsp_arith.c | 179 +++++++++++ tests/tcg/mipsel/test_dsp_cmp.c | 84 +++++ tests/tcg/mipsel/test_dsp_ctrl.c | 44 +++ tests/tcg/mipsel/test_dsp_dot.c | 154 +++++++++ tests/tcg/mipsel/test_dsp_mul.c | 64 ++++ tests/tcg/mipsel/test_dsp_pack.c | 149 +++++++++ tests/tcg/mipsel/test_dsp_r1_absq_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_absq_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_addq_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_addq_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_addq_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_addsc.c | 1 - tests/tcg/mipsel/test_dsp_r1_addu_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_addu_s_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_addwc.c | 1 - tests/tcg/mipsel/test_dsp_r1_bitrev.c | 1 - tests/tcg/mipsel/test_dsp_r1_bposge32.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmp_eq_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmp_le_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmp_lt_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpgu_eq_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpgu_le_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpgu_lt_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpu_eq_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpu_le_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpu_lt_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpaq_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpaq_sa_l_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpau_h_qbl.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpau_h_qbr.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpsq_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpsq_sa_l_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpsu_h_qbl.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpsu_h_qbr.c | 1 - tests/tcg/mipsel/test_dsp_r1_extp.c | 1 - tests/tcg/mipsel/test_dsp_r1_extpdp.c | 1 - tests/tcg/mipsel/test_dsp_r1_extpdpv.c | 1 - tests/tcg/mipsel/test_dsp_r1_extpv.c | 1 - tests/tcg/mipsel/test_dsp_r1_extr_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extr_rs_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extr_s_h.c | 1 - tests/tcg/mipsel/test_dsp_r1_extr_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extrv_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extrv_rs_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extrv_s_h.c | 1 - tests/tcg/mipsel/test_dsp_r1_extrv_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_insv.c | 1 - tests/tcg/mipsel/test_dsp_r1_lbux.c | 1 - tests/tcg/mipsel/test_dsp_r1_lhx.c | 1 - tests/tcg/mipsel/test_dsp_r1_lwx.c | 1 - tests/tcg/mipsel/test_dsp_r1_madd.c | 1 - tests/tcg/mipsel/test_dsp_r1_maddu.c | 1 - tests/tcg/mipsel/test_dsp_r1_main.c | 6 - tests/tcg/mipsel/test_dsp_r1_maq_s_w_phl.c | 1 - tests/tcg/mipsel/test_dsp_r1_maq_s_w_phr.c | 1 - tests/tcg/mipsel/test_dsp_r1_maq_sa_w_phl.c | 1 - tests/tcg/mipsel/test_dsp_r1_maq_sa_w_phr.c | 1 - tests/tcg/mipsel/test_dsp_r1_mfhi.c | 1 - tests/tcg/mipsel/test_dsp_r1_mflo.c | 1 - tests/tcg/mipsel/test_dsp_r1_modsub.c | 1 - tests/tcg/mipsel/test_dsp_r1_msub.c | 1 - tests/tcg/mipsel/test_dsp_r1_msubu.c | 1 - tests/tcg/mipsel/test_dsp_r1_mthi.c | 1 - tests/tcg/mipsel/test_dsp_r1_mthlip.c | 1 - tests/tcg/mipsel/test_dsp_r1_mtlo.c | 1 - tests/tcg/mipsel/test_dsp_r1_muleq_s_w_phl.c | 1 - tests/tcg/mipsel/test_dsp_r1_muleq_s_w_phr.c | 1 - tests/tcg/mipsel/test_dsp_r1_muleu_s_ph_qbl.c | 1 - tests/tcg/mipsel/test_dsp_r1_muleu_s_ph_qbr.c | 1 - tests/tcg/mipsel/test_dsp_r1_mulq_rs_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_mult.c | 1 - tests/tcg/mipsel/test_dsp_r1_multu.c | 1 - tests/tcg/mipsel/test_dsp_r1_packrl_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_pick_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_pick_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceq_w_phl.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceq_w_phr.c | 1 - tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbl.c | 1 - .../tcg/mipsel/test_dsp_r1_precequ_ph_qbla.c | 1 - tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbr.c | 1 - .../tcg/mipsel/test_dsp_r1_precequ_ph_qbra.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbl.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbla.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbr.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbra.c | 1 - tests/tcg/mipsel/test_dsp_r1_precrq_ph_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_precrq_qb_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_precrq_rs_ph_w.c | 1 - .../tcg/mipsel/test_dsp_r1_precrqu_s_qb_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_raddu_w_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_rddsp.c | 1 - tests/tcg/mipsel/test_dsp_r1_repl_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_repl_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_replv_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_replv_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_shilo.c | 1 - tests/tcg/mipsel/test_dsp_r1_shilov.c | 1 - tests/tcg/mipsel/test_dsp_r1_shll_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shll_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_shll_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shll_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_shllv_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shllv_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_shllv_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shllv_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_shra_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shra_r_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shra_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrav_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrav_r_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrav_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrl_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrlv_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_subq_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_subq_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_subq_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_subu_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_subu_s_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_wrdsp.c | 1 - tests/tcg/mipsel/test_dsp_r2_absq_s_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_addqh_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_addqh_r_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_addqh_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_addqh_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_addu_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_addu_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_adduh_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_adduh_r_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_append.c | 1 - tests/tcg/mipsel/test_dsp_r2_balign.c | 1 - tests/tcg/mipsel/test_dsp_r2_cmpgdu_eq_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_cmpgdu_le_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_cmpgdu_lt_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpa_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpaqx_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpaqx_sa_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpax_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dps_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpsqx_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpsqx_sa_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpsx_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mul_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mul_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulq_rs_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulq_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulq_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulsa_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulsaq_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_precr_qb_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_precr_sra_ph_w.c | 1 - .../tcg/mipsel/test_dsp_r2_precr_sra_r_ph_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_prepend.c | 1 - tests/tcg/mipsel/test_dsp_r2_shra_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shra_r_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shrav_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shrav_r_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shrl_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_shrlv_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subqh_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subqh_r_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subqh_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_subqh_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_subu_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subu_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subuh_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_subuh_r_qb.c | 1 - tests/tcg/mipsel/test_dsp_shift.c | 124 ++++++++ tests/tcg/mips/meson.build | 299 ++---------------- tests/tcg/mips64/meson.build | 42 +-- tests/tcg/mipsel/meson.build | 172 +--------- 198 files changed, 3583 insertions(+), 745 deletions(-) delete mode 100644 tests/tcg/mips/include/test_utils_32.h create mode 100644 tests/tcg/mipsel/test_dsp_runner.h create mode 100644 tests/tcg/mips/test_msa_bit_count.c create mode 100644 tests/tcg/mips/test_msa_bit_move.c create mode 100644 tests/tcg/mips/test_msa_bit_set.c create mode 100644 tests/tcg/mips/test_msa_fixed_multiply.c create mode 100644 tests/tcg/mips/test_msa_float_max_min.c create mode 100644 tests/tcg/mips/test_msa_int_add.c create mode 100644 tests/tcg/mips/test_msa_int_average.c create mode 100644 tests/tcg/mips/test_msa_int_compare.c create mode 100644 tests/tcg/mips/test_msa_int_div_mod.c create mode 100644 tests/tcg/mips/test_msa_int_dot_product.c create mode 100644 tests/tcg/mips/test_msa_int_max_min.c create mode 100644 tests/tcg/mips/test_msa_int_multiply.c create mode 100644 tests/tcg/mips/test_msa_int_subtract.c create mode 100644 tests/tcg/mips/test_msa_interleave.c create mode 100644 tests/tcg/mips/test_msa_load_store.c create mode 100644 tests/tcg/mips/test_msa_logic.c create mode 100644 tests/tcg/mips/test_msa_pack.c create mode 100644 tests/tcg/mips/test_msa_shift.c create mode 100644 tests/tcg/mips64/test_mips64r6_bitops.c create mode 100644 tests/tcg/mips64/test_mips64r6_crc.c create mode 100644 tests/tcg/mips64/test_mips64r6_logic.c create mode 100644 tests/tcg/mips64/test_mips64r6_multiply.c create mode 100644 tests/tcg/mips64/test_mips64r6_shift.c create mode 100644 tests/tcg/mipsel/test_dsp_acc.c create mode 100644 tests/tcg/mipsel/test_dsp_arith.c create mode 100644 tests/tcg/mipsel/test_dsp_cmp.c create mode 100644 tests/tcg/mipsel/test_dsp_ctrl.c create mode 100644 tests/tcg/mipsel/test_dsp_dot.c create mode 100644 tests/tcg/mipsel/test_dsp_mul.c create mode 100644 tests/tcg/mipsel/test_dsp_pack.c delete mode 100644 tests/tcg/mipsel/test_dsp_r1_main.c create mode 100644 tests/tcg/mipsel/test_dsp_shift.c
Signature · 1 line
2.55.0
PATCH v4 1/32 tests/tcg/mips: Remove unused test_utils_32.h
The 32-bit test utilities header added in 26b3256392e0 is not included by any test, and check_results_32() is never called.
--- tests/tcg/mips/include/test_utils_32.h | 78 -------------------------- 1 file changed, 78 deletions(-) delete mode 100644 tests/tcg/mips/include/test_utils_32.h
tests/tcg/mips/include/test_utils_32.h deleted +0 -78
@@ -1,78 +0,0 @@ -/* -* Header file for test utilities -* -* Copyright (C) 2019 Wave Computing, Inc. -* Copyright (C) 2019 Aleksandar Markovic <[email protected]> -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <https://www.gnu.org/licenses/>. -* -*/ - -#ifndef TEST_UTILS_32_H -#define TEST_UTILS_32_H - -#include <stdio.h> -#include <stdint.h> -#include <inttypes.h> -#include <string.h> - -#define PRINT_RESULTS 0 - - -static inline int32_t check_results_32 (const char *instruction_name, -const uint32_t test_count, -const double elapsed_time, -const uint32_t *b32_result, -const uint32_t *b32_expect) -{ -#if PRINT_RESULTS -uint32_t ii; -printf ("\n" ); -for (ii =0 ; ii < test_count; ii++) { -uint64_t a; -memcpy (&a, (b32_result + ii),8 ); -if (ii %8 !=0 ) { -printf (" 0x%08lxULL,\n" , a); - }else { -printf (" 0x%08lxULL, /* %3d */\n" , - a, ii); - } - } -printf ("\n" ); -#endif -uint32_t i; -uint32_t pass_count =0 ; -uint32_t fail_count =0 ; - -printf ("%s: " , instruction_name); -for (i =0 ; i < test_count; i++) { -if (b32_result[i] == b32_expect[i]) { - pass_count++; - }else { - fail_count++; - } - } - -printf ("PASS: %3d FAIL: %3d elapsed time: %5.2f ms\n" , - pass_count, fail_count, elapsed_time); - -if (fail_count >0 ) { -return -1 ; - }else { -return 0 ; - } -} - - -#endif
Signature · 1 line
2.55.0
Re: [PATCH v4 01/32] tests/tcg/mips: Remove unused test_utils_32.h
Quoted 9 lines · Philippe Mathieu-Daudé
The 32-bit test utilities header added in
26b3256392e0is not included by any test, andcheck_results_32()is never called.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- tests/tcg/mips/include/test_utils_32.h | 78 -------------------------- 1 file changed, 78 deletions(-) delete mode 100644 tests/tcg/mips/include/test_utils_32.h
PATCH v4 2/32 tests/tcg/mips: Group DSP acc tests
In reply to Philippe Mathieu-DaudéBuild the 19 per-opcode acc tests as a single executable, test_dsp_acc.c, to reduce the number of test binaries. Each opcode reports one TAP line.
Add test_dsp_runner.h: assert() only counts failures, and RUN_TEST() resets DSPControl and reports each test in TAP. Drop the unused hello-world test.
--- tests/tcg/mipsel/test_dsp_runner.h | 26 ++++++ tests/tcg/mipsel/test_dsp_acc.c | 109 ++++++++++++++++++++++ tests/tcg/mipsel/test_dsp_r1_extp.c | 1 - tests/tcg/mipsel/test_dsp_r1_extpdp.c | 1 - tests/tcg/mipsel/test_dsp_r1_extpdpv.c | 1 - tests/tcg/mipsel/test_dsp_r1_extpv.c | 1 - tests/tcg/mipsel/test_dsp_r1_extr_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extr_rs_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extr_s_h.c | 1 - tests/tcg/mipsel/test_dsp_r1_extr_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extrv_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extrv_rs_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_extrv_s_h.c | 1 - tests/tcg/mipsel/test_dsp_r1_extrv_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_main.c | 6 -- tests/tcg/mipsel/test_dsp_r1_mfhi.c | 1 - tests/tcg/mipsel/test_dsp_r1_mflo.c | 1 - tests/tcg/mipsel/test_dsp_r1_mthi.c | 1 - tests/tcg/mipsel/test_dsp_r1_mthlip.c | 1 - tests/tcg/mipsel/test_dsp_r1_mtlo.c | 1 - tests/tcg/mipsel/test_dsp_r1_shilo.c | 1 - tests/tcg/mipsel/test_dsp_r1_shilov.c | 1 - tests/tcg/mipsel/meson.build | 21 +---- 23 files changed, 136 insertions(+), 45 deletions(-) create mode 100644 tests/tcg/mipsel/test_dsp_runner.h create mode 100644 tests/tcg/mipsel/test_dsp_acc.c delete mode 100644 tests/tcg/mipsel/test_dsp_r1_main.c
tests/tcg/mipsel/test_dsp_runner.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Helpers to run several DSP ASE tests from the same process: assert() is +* mapped to tap_assert() which only counts failures, and RUN_TEST() reports +* one TAP result per test, after resetting DSPControl. A test calling +* RUN_TEST() must end with "return tap_done();". +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ +#ifndef TEST_DSP_RUNNER_H +#define TEST_DSP_RUNNER_H + +#include "../include/tap.h" + +#undef assert +#define assert (cond) tap_assert(cond) + +#define RUN_TEST (fn) \ + do { \ + int ret_; \ + tap_assert_failures = 0; \ + __asm__ volatile("wrdsp $zero, 0x3f\n\t"); \ + ret_ = fn(); \ + tap_report(!(ret_ || tap_assert_failures), "%s", #fn); \ + } while (0) + +#endif
tests/tcg/mipsel/test_dsp_acc.c new file +109 -0
109 lines not on this page · raw message
tests/tcg/mipsel/test_dsp_r1_extp.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extpdp.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extpdpv.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extpv.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extr_r_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extr_rs_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extr_s_h.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extr_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extrv_r_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extrv_rs_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extrv_s_h.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_extrv_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_main.c deleted +0 -6
@@ -1,6 +0,0 @@ -#include <stdio.h> - -int main () -{ -printf ("hello world\n" ); -}
tests/tcg/mipsel/test_dsp_r1_mfhi.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_mflo.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_mthi.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_mthlip.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_mtlo.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shilo.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shilov.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/meson.build +1 -20
@@ -4,6 +4,7 @@ tests = [] tests += tcg_tests['multiarch-linux-user']['tests'] tests_dsp = [ + 'test_dsp_acc.c', 'test_dsp_r1_absq_s_ph.c', 'test_dsp_r1_absq_s_w.c', 'test_dsp_r1_addq_ph.c',
@@ -32,37 +33,19 @@ tests_dsp = [ 'test_dsp_r1_dpsq_sa_l_w.c', 'test_dsp_r1_dpsu_h_qbl.c', 'test_dsp_r1_dpsu_h_qbr.c', - 'test_dsp_r1_extp.c', - 'test_dsp_r1_extpdp.c', - 'test_dsp_r1_extpdpv.c', - 'test_dsp_r1_extpv.c', - 'test_dsp_r1_extr_r_w.c', - 'test_dsp_r1_extr_rs_w.c', - 'test_dsp_r1_extr_s_h.c', - 'test_dsp_r1_extr_w.c', - 'test_dsp_r1_extrv_r_w.c', - 'test_dsp_r1_extrv_rs_w.c', - 'test_dsp_r1_extrv_s_h.c', - 'test_dsp_r1_extrv_w.c', 'test_dsp_r1_insv.c', 'test_dsp_r1_lbux.c', 'test_dsp_r1_lhx.c', 'test_dsp_r1_lwx.c', 'test_dsp_r1_madd.c', 'test_dsp_r1_maddu.c', - 'test_dsp_r1_main.c', 'test_dsp_r1_maq_s_w_phl.c', 'test_dsp_r1_maq_s_w_phr.c', 'test_dsp_r1_maq_sa_w_phl.c', 'test_dsp_r1_maq_sa_w_phr.c', - 'test_dsp_r1_mfhi.c', - 'test_dsp_r1_mflo.c', 'test_dsp_r1_modsub.c', 'test_dsp_r1_msub.c', 'test_dsp_r1_msubu.c', - 'test_dsp_r1_mthi.c', - 'test_dsp_r1_mthlip.c', - 'test_dsp_r1_mtlo.c', 'test_dsp_r1_muleq_s_w_phl.c', 'test_dsp_r1_muleq_s_w_phr.c', 'test_dsp_r1_muleu_s_ph_qbl.c',
@@ -93,8 +76,6 @@ tests_dsp = [ 'test_dsp_r1_repl_qb.c', 'test_dsp_r1_replv_ph.c', 'test_dsp_r1_replv_qb.c', - 'test_dsp_r1_shilo.c', - 'test_dsp_r1_shilov.c', 'test_dsp_r1_shll_ph.c', 'test_dsp_r1_shll_qb.c', 'test_dsp_r1_shll_s_ph.c',
Signature · 1 line
2.55.0
PATCH v4 3/32 tests/tcg/mips: Group DSP arith tests
In reply to Philippe Mathieu-DaudéBuild the 33 per-opcode arith tests as a single executable, test_dsp_arith.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mipsel/test_dsp_arith.c | 179 ++++++++++++++++++++++ tests/tcg/mipsel/test_dsp_r1_absq_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_absq_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_addq_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_addq_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_addq_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_addsc.c | 1 - tests/tcg/mipsel/test_dsp_r1_addu_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_addu_s_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_addwc.c | 1 - tests/tcg/mipsel/test_dsp_r1_modsub.c | 1 - tests/tcg/mipsel/test_dsp_r1_raddu_w_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_subq_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_subq_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_subq_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_subu_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_subu_s_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_absq_s_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_addqh_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_addqh_r_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_addqh_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_addqh_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_addu_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_addu_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_adduh_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_adduh_r_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_subqh_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subqh_r_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subqh_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_subqh_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_subu_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subu_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_subuh_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_subuh_r_qb.c | 1 - tests/tcg/mipsel/meson.build | 34 +--- 35 files changed, 180 insertions(+), 66 deletions(-) create mode 100644 tests/tcg/mipsel/test_dsp_arith.c
tests/tcg/mipsel/test_dsp_arith.c new file +179 -0
@@ -0,0 +1,179 @@ +/* +* MIPS DSP ASE tests: Add, Subtract and Absolute value instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "test_dsp_runner.h" + +#define main test_dsp_r1_absq_s_ph +#include "test_dsp_r1_absq_s_ph.c" +#undef main + +#define main test_dsp_r1_absq_s_w +#include "test_dsp_r1_absq_s_w.c" +#undef main + +#define main test_dsp_r1_addq_ph +#include "test_dsp_r1_addq_ph.c" +#undef main + +#define main test_dsp_r1_addq_s_ph +#include "test_dsp_r1_addq_s_ph.c" +#undef main + +#define main test_dsp_r1_addq_s_w +#include "test_dsp_r1_addq_s_w.c" +#undef main + +#define main test_dsp_r1_addsc +#include "test_dsp_r1_addsc.c" +#undef main + +#define main test_dsp_r1_addu_qb +#include "test_dsp_r1_addu_qb.c" +#undef main + +#define main test_dsp_r1_addu_s_qb +#include "test_dsp_r1_addu_s_qb.c" +#undef main + +#define main test_dsp_r1_addwc +#include "test_dsp_r1_addwc.c" +#undef main + +#define main test_dsp_r1_modsub +#include "test_dsp_r1_modsub.c" +#undef main + +#define main test_dsp_r1_raddu_w_qb +#include "test_dsp_r1_raddu_w_qb.c" +#undef main + +#define main test_dsp_r1_subq_ph +#include "test_dsp_r1_subq_ph.c" +#undef main + +#define main test_dsp_r1_subq_s_ph +#include "test_dsp_r1_subq_s_ph.c" +#undef main + +#define main test_dsp_r1_subq_s_w +#include "test_dsp_r1_subq_s_w.c" +#undef main + +#define main test_dsp_r1_subu_qb +#include "test_dsp_r1_subu_qb.c" +#undef main + +#define main test_dsp_r1_subu_s_qb +#include "test_dsp_r1_subu_s_qb.c" +#undef main + +#define main test_dsp_r2_absq_s_qb +#include "test_dsp_r2_absq_s_qb.c" +#undef main + +#define main test_dsp_r2_addqh_ph +#include "test_dsp_r2_addqh_ph.c" +#undef main + +#define main test_dsp_r2_addqh_r_ph +#include "test_dsp_r2_addqh_r_ph.c" +#undef main + +#define main test_dsp_r2_addqh_r_w +#include "test_dsp_r2_addqh_r_w.c" +#undef main + +#define main test_dsp_r2_addqh_w +#include "test_dsp_r2_addqh_w.c" +#undef main + +#define main test_dsp_r2_addu_ph +#include "test_dsp_r2_addu_ph.c" +#undef main + +#define main test_dsp_r2_addu_s_ph +#include "test_dsp_r2_addu_s_ph.c" +#undef main + +#define main test_dsp_r2_adduh_qb +#include "test_dsp_r2_adduh_qb.c" +#undef main + +#define main test_dsp_r2_adduh_r_qb +#include "test_dsp_r2_adduh_r_qb.c" +#undef main + +#define main test_dsp_r2_subqh_ph +#include "test_dsp_r2_subqh_ph.c" +#undef main + +#define main test_dsp_r2_subqh_r_ph +#include "test_dsp_r2_subqh_r_ph.c" +#undef main + +#define main test_dsp_r2_subqh_r_w +#include "test_dsp_r2_subqh_r_w.c" +#undef main + +#define main test_dsp_r2_subqh_w +#include "test_dsp_r2_subqh_w.c" +#undef main + +#define main test_dsp_r2_subu_ph +#include "test_dsp_r2_subu_ph.c" +#undef main + +#define main test_dsp_r2_subu_s_ph +#include "test_dsp_r2_subu_s_ph.c" +#undef main + +#define main test_dsp_r2_subuh_qb +#include "test_dsp_r2_subuh_qb.c" +#undef main + +#define main test_dsp_r2_subuh_r_qb +#include "test_dsp_r2_subuh_r_qb.c" +#undef main + +int main (void ) +{ +TAP_START (); +RUN_TEST (test_dsp_r1_absq_s_ph); +RUN_TEST (test_dsp_r1_absq_s_w); +RUN_TEST (test_dsp_r1_addq_ph); +RUN_TEST (test_dsp_r1_addq_s_ph); +RUN_TEST (test_dsp_r1_addq_s_w); +RUN_TEST (test_dsp_r1_addsc); +RUN_TEST (test_dsp_r1_addu_qb); +RUN_TEST (test_dsp_r1_addu_s_qb); +RUN_TEST (test_dsp_r1_addwc); +RUN_TEST (test_dsp_r1_modsub); +RUN_TEST (test_dsp_r1_raddu_w_qb); +RUN_TEST (test_dsp_r1_subq_ph); +RUN_TEST (test_dsp_r1_subq_s_ph); +RUN_TEST (test_dsp_r1_subq_s_w); +RUN_TEST (test_dsp_r1_subu_qb); +RUN_TEST (test_dsp_r1_subu_s_qb); +RUN_TEST (test_dsp_r2_absq_s_qb); +RUN_TEST (test_dsp_r2_addqh_ph); +RUN_TEST (test_dsp_r2_addqh_r_ph); +RUN_TEST (test_dsp_r2_addqh_r_w); +RUN_TEST (test_dsp_r2_addqh_w); +RUN_TEST (test_dsp_r2_addu_ph); +RUN_TEST (test_dsp_r2_addu_s_ph); +RUN_TEST (test_dsp_r2_adduh_qb); +RUN_TEST (test_dsp_r2_adduh_r_qb); +RUN_TEST (test_dsp_r2_subqh_ph); +RUN_TEST (test_dsp_r2_subqh_r_ph); +RUN_TEST (test_dsp_r2_subqh_r_w); +RUN_TEST (test_dsp_r2_subqh_w); +RUN_TEST (test_dsp_r2_subu_ph); +RUN_TEST (test_dsp_r2_subu_s_ph); +RUN_TEST (test_dsp_r2_subuh_qb); +RUN_TEST (test_dsp_r2_subuh_r_qb); + +return tap_done (); +}
tests/tcg/mipsel/test_dsp_r1_absq_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main ()
tests/tcg/mipsel/test_dsp_r1_absq_s_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_addq_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_addq_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_addq_s_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main ()
tests/tcg/mipsel/test_dsp_r1_addsc.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_addu_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_addu_s_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_addwc.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_modsub.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_raddu_w_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_subq_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_subq_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_subq_s_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_subu_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_subu_s_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_absq_s_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_addqh_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_addqh_r_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_addqh_r_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_addqh_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_addu_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_addu_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_adduh_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_adduh_r_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_subqh_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_subqh_r_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_subqh_r_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_subqh_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_subu_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_subu_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_subuh_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_subuh_r_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/meson.build +1 -33
@@ -5,15 +5,7 @@ tests += tcg_tests['multiarch-linux-user']['tests'] tests_dsp = [ 'test_dsp_acc.c', - 'test_dsp_r1_absq_s_ph.c', - 'test_dsp_r1_absq_s_w.c', - 'test_dsp_r1_addq_ph.c', - 'test_dsp_r1_addq_s_ph.c', - 'test_dsp_r1_addq_s_w.c', - 'test_dsp_r1_addsc.c', - 'test_dsp_r1_addu_qb.c', - 'test_dsp_r1_addu_s_qb.c', - 'test_dsp_r1_addwc.c', + 'test_dsp_arith.c', 'test_dsp_r1_bitrev.c', 'test_dsp_r1_bposge32.c', 'test_dsp_r1_cmp_eq_ph.c',
@@ -43,7 +35,6 @@ tests_dsp = [ 'test_dsp_r1_maq_s_w_phr.c', 'test_dsp_r1_maq_sa_w_phl.c', 'test_dsp_r1_maq_sa_w_phr.c', - 'test_dsp_r1_modsub.c', 'test_dsp_r1_msub.c', 'test_dsp_r1_msubu.c', 'test_dsp_r1_muleq_s_w_phl.c',
@@ -70,7 +61,6 @@ tests_dsp = [ 'test_dsp_r1_precrq_qb_ph.c', 'test_dsp_r1_precrq_rs_ph_w.c', 'test_dsp_r1_precrqu_s_qb_ph.c', - 'test_dsp_r1_raddu_w_qb.c', 'test_dsp_r1_rddsp.c', 'test_dsp_r1_repl_ph.c', 'test_dsp_r1_repl_qb.c',
@@ -92,21 +82,7 @@ tests_dsp = [ 'test_dsp_r1_shrav_r_w.c', 'test_dsp_r1_shrl_qb.c', 'test_dsp_r1_shrlv_qb.c', - 'test_dsp_r1_subq_ph.c', - 'test_dsp_r1_subq_s_ph.c', - 'test_dsp_r1_subq_s_w.c', - 'test_dsp_r1_subu_qb.c', - 'test_dsp_r1_subu_s_qb.c', 'test_dsp_r1_wrdsp.c', - 'test_dsp_r2_absq_s_qb.c', - 'test_dsp_r2_addqh_ph.c', - 'test_dsp_r2_addqh_r_ph.c', - 'test_dsp_r2_addqh_r_w.c', - 'test_dsp_r2_addqh_w.c', - 'test_dsp_r2_addu_ph.c', - 'test_dsp_r2_addu_s_ph.c', - 'test_dsp_r2_adduh_qb.c', - 'test_dsp_r2_adduh_r_qb.c', 'test_dsp_r2_append.c', 'test_dsp_r2_balign.c', 'test_dsp_r2_cmpgdu_eq_qb.c',
@@ -137,14 +113,6 @@ tests_dsp = [ 'test_dsp_r2_shrav_r_qb.c', 'test_dsp_r2_shrl_ph.c', 'test_dsp_r2_shrlv_ph.c', - 'test_dsp_r2_subqh_ph.c', - 'test_dsp_r2_subqh_r_ph.c', - 'test_dsp_r2_subqh_r_w.c', - 'test_dsp_r2_subqh_w.c', - 'test_dsp_r2_subu_ph.c', - 'test_dsp_r2_subu_s_ph.c', - 'test_dsp_r2_subuh_qb.c', - 'test_dsp_r2_subuh_r_qb.c', ] foreach src: tests_dsp
Signature · 1 line
2.55.0
PATCH v4 4/32 tests/tcg/mips: Group DSP cmp tests
In reply to Philippe Mathieu-DaudéBuild the 14 per-opcode cmp tests as a single executable, test_dsp_cmp.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mipsel/test_dsp_cmp.c | 84 +++++++++++++++++++++ tests/tcg/mipsel/test_dsp_r1_cmp_eq_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmp_le_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmp_lt_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpgu_eq_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpgu_le_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpgu_lt_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpu_eq_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpu_le_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_cmpu_lt_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_pick_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_pick_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_cmpgdu_eq_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_cmpgdu_le_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_cmpgdu_lt_qb.c | 1 - tests/tcg/mipsel/meson.build | 15 +--- 16 files changed, 85 insertions(+), 28 deletions(-) create mode 100644 tests/tcg/mipsel/test_dsp_cmp.c
tests/tcg/mipsel/test_dsp_cmp.c new file +84 -0
@@ -0,0 +1,84 @@ +/* +* MIPS DSP ASE tests: Compare and Pick instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "test_dsp_runner.h" + +#define main test_dsp_r1_cmp_eq_ph +#include "test_dsp_r1_cmp_eq_ph.c" +#undef main + +#define main test_dsp_r1_cmp_le_ph +#include "test_dsp_r1_cmp_le_ph.c" +#undef main + +#define main test_dsp_r1_cmp_lt_ph +#include "test_dsp_r1_cmp_lt_ph.c" +#undef main + +#define main test_dsp_r1_cmpgu_eq_qb +#include "test_dsp_r1_cmpgu_eq_qb.c" +#undef main + +#define main test_dsp_r1_cmpgu_le_qb +#include "test_dsp_r1_cmpgu_le_qb.c" +#undef main + +#define main test_dsp_r1_cmpgu_lt_qb +#include "test_dsp_r1_cmpgu_lt_qb.c" +#undef main + +#define main test_dsp_r1_cmpu_eq_qb +#include "test_dsp_r1_cmpu_eq_qb.c" +#undef main + +#define main test_dsp_r1_cmpu_le_qb +#include "test_dsp_r1_cmpu_le_qb.c" +#undef main + +#define main test_dsp_r1_cmpu_lt_qb +#include "test_dsp_r1_cmpu_lt_qb.c" +#undef main + +#define main test_dsp_r1_pick_ph +#include "test_dsp_r1_pick_ph.c" +#undef main + +#define main test_dsp_r1_pick_qb +#include "test_dsp_r1_pick_qb.c" +#undef main + +#define main test_dsp_r2_cmpgdu_eq_qb +#include "test_dsp_r2_cmpgdu_eq_qb.c" +#undef main + +#define main test_dsp_r2_cmpgdu_le_qb +#include "test_dsp_r2_cmpgdu_le_qb.c" +#undef main + +#define main test_dsp_r2_cmpgdu_lt_qb +#include "test_dsp_r2_cmpgdu_lt_qb.c" +#undef main + +int main (void ) +{ +TAP_START (); +RUN_TEST (test_dsp_r1_cmp_eq_ph); +RUN_TEST (test_dsp_r1_cmp_le_ph); +RUN_TEST (test_dsp_r1_cmp_lt_ph); +RUN_TEST (test_dsp_r1_cmpgu_eq_qb); +RUN_TEST (test_dsp_r1_cmpgu_le_qb); +RUN_TEST (test_dsp_r1_cmpgu_lt_qb); +RUN_TEST (test_dsp_r1_cmpu_eq_qb); +RUN_TEST (test_dsp_r1_cmpu_le_qb); +RUN_TEST (test_dsp_r1_cmpu_lt_qb); +RUN_TEST (test_dsp_r1_pick_ph); +RUN_TEST (test_dsp_r1_pick_qb); +RUN_TEST (test_dsp_r2_cmpgdu_eq_qb); +RUN_TEST (test_dsp_r2_cmpgdu_le_qb); +RUN_TEST (test_dsp_r2_cmpgdu_lt_qb); + +return tap_done (); +}
tests/tcg/mipsel/test_dsp_r1_cmp_eq_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_cmp_le_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_cmp_lt_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_cmpgu_eq_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_cmpgu_le_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_cmpgu_lt_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_cmpu_eq_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_cmpu_le_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_cmpu_lt_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_pick_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_pick_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_cmpgdu_eq_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_cmpgdu_le_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_cmpgdu_lt_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/meson.build +1 -14
@@ -6,17 +6,9 @@ tests += tcg_tests['multiarch-linux-user']['tests'] tests_dsp = [ 'test_dsp_acc.c', 'test_dsp_arith.c', + 'test_dsp_cmp.c', 'test_dsp_r1_bitrev.c', 'test_dsp_r1_bposge32.c', - 'test_dsp_r1_cmp_eq_ph.c', - 'test_dsp_r1_cmp_le_ph.c', - 'test_dsp_r1_cmp_lt_ph.c', - 'test_dsp_r1_cmpgu_eq_qb.c', - 'test_dsp_r1_cmpgu_le_qb.c', - 'test_dsp_r1_cmpgu_lt_qb.c', - 'test_dsp_r1_cmpu_eq_qb.c', - 'test_dsp_r1_cmpu_le_qb.c', - 'test_dsp_r1_cmpu_lt_qb.c', 'test_dsp_r1_dpaq_s_w_ph.c', 'test_dsp_r1_dpaq_sa_l_w.c', 'test_dsp_r1_dpau_h_qbl.c',
@@ -45,8 +37,6 @@ tests_dsp = [ 'test_dsp_r1_mult.c', 'test_dsp_r1_multu.c', 'test_dsp_r1_packrl_ph.c', - 'test_dsp_r1_pick_ph.c', - 'test_dsp_r1_pick_qb.c', 'test_dsp_r1_preceq_w_phl.c', 'test_dsp_r1_preceq_w_phr.c', 'test_dsp_r1_precequ_ph_qbl.c',
@@ -85,9 +75,6 @@ tests_dsp = [ 'test_dsp_r1_wrdsp.c', 'test_dsp_r2_append.c', 'test_dsp_r2_balign.c', - 'test_dsp_r2_cmpgdu_eq_qb.c', - 'test_dsp_r2_cmpgdu_le_qb.c', - 'test_dsp_r2_cmpgdu_lt_qb.c', 'test_dsp_r2_dpa_w_ph.c', 'test_dsp_r2_dpaqx_s_w_ph.c', 'test_dsp_r2_dpaqx_sa_w_ph.c',
Signature · 1 line
2.55.0
PATCH v4 5/32 tests/tcg/mips: Group DSP ctrl tests
In reply to Philippe Mathieu-DaudéBuild the 6 per-opcode ctrl tests as a single executable, test_dsp_ctrl.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mipsel/test_dsp_ctrl.c | 44 +++++++++++++++++++++++++ tests/tcg/mipsel/test_dsp_r1_bposge32.c | 1 - tests/tcg/mipsel/test_dsp_r1_lbux.c | 1 - tests/tcg/mipsel/test_dsp_r1_lhx.c | 1 - tests/tcg/mipsel/test_dsp_r1_lwx.c | 1 - tests/tcg/mipsel/test_dsp_r1_rddsp.c | 1 - tests/tcg/mipsel/test_dsp_r1_wrdsp.c | 1 - tests/tcg/mipsel/meson.build | 7 +--- 8 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 tests/tcg/mipsel/test_dsp_ctrl.c
tests/tcg/mipsel/test_dsp_ctrl.c new file +44 -0
@@ -0,0 +1,44 @@ +/* +* MIPS DSP ASE tests: Indexed Load and DSPControl access instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "test_dsp_runner.h" + +#define main test_dsp_r1_bposge32 +#include "test_dsp_r1_bposge32.c" +#undef main + +#define main test_dsp_r1_lbux +#include "test_dsp_r1_lbux.c" +#undef main + +#define main test_dsp_r1_lhx +#include "test_dsp_r1_lhx.c" +#undef main + +#define main test_dsp_r1_lwx +#include "test_dsp_r1_lwx.c" +#undef main + +#define main test_dsp_r1_rddsp +#include "test_dsp_r1_rddsp.c" +#undef main + +#define main test_dsp_r1_wrdsp +#include "test_dsp_r1_wrdsp.c" +#undef main + +int main (void ) +{ +TAP_START (); +RUN_TEST (test_dsp_r1_bposge32); +RUN_TEST (test_dsp_r1_lbux); +RUN_TEST (test_dsp_r1_lhx); +RUN_TEST (test_dsp_r1_lwx); +RUN_TEST (test_dsp_r1_rddsp); +RUN_TEST (test_dsp_r1_wrdsp); + +return tap_done (); +}
tests/tcg/mipsel/test_dsp_r1_bposge32.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_lbux.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main (void ) {
tests/tcg/mipsel/test_dsp_r1_lhx.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main (void ) {
tests/tcg/mipsel/test_dsp_r1_lwx.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main (void ) {
tests/tcg/mipsel/test_dsp_r1_rddsp.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_wrdsp.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/meson.build +1 -6
@@ -7,8 +7,8 @@ tests_dsp = [ 'test_dsp_acc.c', 'test_dsp_arith.c', 'test_dsp_cmp.c', + 'test_dsp_ctrl.c', 'test_dsp_r1_bitrev.c', - 'test_dsp_r1_bposge32.c', 'test_dsp_r1_dpaq_s_w_ph.c', 'test_dsp_r1_dpaq_sa_l_w.c', 'test_dsp_r1_dpau_h_qbl.c',
@@ -18,9 +18,6 @@ tests_dsp = [ 'test_dsp_r1_dpsu_h_qbl.c', 'test_dsp_r1_dpsu_h_qbr.c', 'test_dsp_r1_insv.c', - 'test_dsp_r1_lbux.c', - 'test_dsp_r1_lhx.c', - 'test_dsp_r1_lwx.c', 'test_dsp_r1_madd.c', 'test_dsp_r1_maddu.c', 'test_dsp_r1_maq_s_w_phl.c',
@@ -51,7 +48,6 @@ tests_dsp = [ 'test_dsp_r1_precrq_qb_ph.c', 'test_dsp_r1_precrq_rs_ph_w.c', 'test_dsp_r1_precrqu_s_qb_ph.c', - 'test_dsp_r1_rddsp.c', 'test_dsp_r1_repl_ph.c', 'test_dsp_r1_repl_qb.c', 'test_dsp_r1_replv_ph.c',
@@ -72,7 +68,6 @@ tests_dsp = [ 'test_dsp_r1_shrav_r_w.c', 'test_dsp_r1_shrl_qb.c', 'test_dsp_r1_shrlv_qb.c', - 'test_dsp_r1_wrdsp.c', 'test_dsp_r2_append.c', 'test_dsp_r2_balign.c', 'test_dsp_r2_dpa_w_ph.c',
Signature · 1 line
2.55.0
PATCH v4 6/32 tests/tcg/mips: Group DSP dot tests
In reply to Philippe Mathieu-DaudéBuild the 28 per-opcode dot tests as a single executable, test_dsp_dot.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mipsel/test_dsp_dot.c | 154 +++++++++++++++++++ tests/tcg/mipsel/test_dsp_r1_dpaq_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpaq_sa_l_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpau_h_qbl.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpau_h_qbr.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpsq_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpsq_sa_l_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpsu_h_qbl.c | 1 - tests/tcg/mipsel/test_dsp_r1_dpsu_h_qbr.c | 1 - tests/tcg/mipsel/test_dsp_r1_madd.c | 1 - tests/tcg/mipsel/test_dsp_r1_maddu.c | 1 - tests/tcg/mipsel/test_dsp_r1_maq_s_w_phl.c | 1 - tests/tcg/mipsel/test_dsp_r1_maq_s_w_phr.c | 1 - tests/tcg/mipsel/test_dsp_r1_maq_sa_w_phl.c | 1 - tests/tcg/mipsel/test_dsp_r1_maq_sa_w_phr.c | 1 - tests/tcg/mipsel/test_dsp_r1_msub.c | 1 - tests/tcg/mipsel/test_dsp_r1_msubu.c | 1 - tests/tcg/mipsel/test_dsp_r1_mult.c | 1 - tests/tcg/mipsel/test_dsp_r1_multu.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpa_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpaqx_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpaqx_sa_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpax_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dps_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpsqx_s_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpsqx_sa_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_dpsx_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulsa_w_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulsaq_s_w_ph.c | 1 - tests/tcg/mipsel/meson.build | 29 +--- 30 files changed, 155 insertions(+), 56 deletions(-) create mode 100644 tests/tcg/mipsel/test_dsp_dot.c
tests/tcg/mipsel/test_dsp_dot.c new file +154 -0
@@ -0,0 +1,154 @@ +/* +* MIPS DSP ASE tests: Dot Product and Multiply-Accumulate instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "test_dsp_runner.h" + +#define main test_dsp_r1_dpaq_s_w_ph +#include "test_dsp_r1_dpaq_s_w_ph.c" +#undef main + +#define main test_dsp_r1_dpaq_sa_l_w +#include "test_dsp_r1_dpaq_sa_l_w.c" +#undef main + +#define main test_dsp_r1_dpau_h_qbl +#include "test_dsp_r1_dpau_h_qbl.c" +#undef main + +#define main test_dsp_r1_dpau_h_qbr +#include "test_dsp_r1_dpau_h_qbr.c" +#undef main + +#define main test_dsp_r1_dpsq_s_w_ph +#include "test_dsp_r1_dpsq_s_w_ph.c" +#undef main + +#define main test_dsp_r1_dpsq_sa_l_w +#include "test_dsp_r1_dpsq_sa_l_w.c" +#undef main + +#define main test_dsp_r1_dpsu_h_qbl +#include "test_dsp_r1_dpsu_h_qbl.c" +#undef main + +#define main test_dsp_r1_dpsu_h_qbr +#include "test_dsp_r1_dpsu_h_qbr.c" +#undef main + +#define main test_dsp_r1_maq_s_w_phl +#include "test_dsp_r1_maq_s_w_phl.c" +#undef main + +#define main test_dsp_r1_maq_s_w_phr +#include "test_dsp_r1_maq_s_w_phr.c" +#undef main + +#define main test_dsp_r1_maq_sa_w_phl +#include "test_dsp_r1_maq_sa_w_phl.c" +#undef main + +#define main test_dsp_r1_maq_sa_w_phr +#include "test_dsp_r1_maq_sa_w_phr.c" +#undef main + +#define main test_dsp_r1_madd +#include "test_dsp_r1_madd.c" +#undef main + +#define main test_dsp_r1_maddu +#include "test_dsp_r1_maddu.c" +#undef main + +#define main test_dsp_r1_msub +#include "test_dsp_r1_msub.c" +#undef main + +#define main test_dsp_r1_msubu +#include "test_dsp_r1_msubu.c" +#undef main + +#define main test_dsp_r1_mult +#include "test_dsp_r1_mult.c" +#undef main + +#define main test_dsp_r1_multu +#include "test_dsp_r1_multu.c" +#undef main + +#define main test_dsp_r2_dpa_w_ph +#include "test_dsp_r2_dpa_w_ph.c" +#undef main + +#define main test_dsp_r2_dpaqx_s_w_ph +#include "test_dsp_r2_dpaqx_s_w_ph.c" +#undef main + +#define main test_dsp_r2_dpaqx_sa_w_ph +#include "test_dsp_r2_dpaqx_sa_w_ph.c" +#undef main + +#define main test_dsp_r2_dpax_w_ph +#include "test_dsp_r2_dpax_w_ph.c" +#undef main + +#define main test_dsp_r2_dps_w_ph +#include "test_dsp_r2_dps_w_ph.c" +#undef main + +#define main test_dsp_r2_dpsqx_s_w_ph +#include "test_dsp_r2_dpsqx_s_w_ph.c" +#undef main + +#define main test_dsp_r2_dpsqx_sa_w_ph +#include "test_dsp_r2_dpsqx_sa_w_ph.c" +#undef main + +#define main test_dsp_r2_dpsx_w_ph +#include "test_dsp_r2_dpsx_w_ph.c" +#undef main + +#define main test_dsp_r2_mulsa_w_ph +#include "test_dsp_r2_mulsa_w_ph.c" +#undef main + +#define main test_dsp_r2_mulsaq_s_w_ph +#include "test_dsp_r2_mulsaq_s_w_ph.c" +#undef main + +int main (void ) +{ +TAP_START (); +RUN_TEST (test_dsp_r1_dpaq_s_w_ph); +RUN_TEST (test_dsp_r1_dpaq_sa_l_w); +RUN_TEST (test_dsp_r1_dpau_h_qbl); +RUN_TEST (test_dsp_r1_dpau_h_qbr); +RUN_TEST (test_dsp_r1_dpsq_s_w_ph); +RUN_TEST (test_dsp_r1_dpsq_sa_l_w); +RUN_TEST (test_dsp_r1_dpsu_h_qbl); +RUN_TEST (test_dsp_r1_dpsu_h_qbr); +RUN_TEST (test_dsp_r1_maq_s_w_phl); +RUN_TEST (test_dsp_r1_maq_s_w_phr); +RUN_TEST (test_dsp_r1_maq_sa_w_phl); +RUN_TEST (test_dsp_r1_maq_sa_w_phr); +RUN_TEST (test_dsp_r1_madd); +RUN_TEST (test_dsp_r1_maddu); +RUN_TEST (test_dsp_r1_msub); +RUN_TEST (test_dsp_r1_msubu); +RUN_TEST (test_dsp_r1_mult); +RUN_TEST (test_dsp_r1_multu); +RUN_TEST (test_dsp_r2_dpa_w_ph); +RUN_TEST (test_dsp_r2_dpaqx_s_w_ph); +RUN_TEST (test_dsp_r2_dpaqx_sa_w_ph); +RUN_TEST (test_dsp_r2_dpax_w_ph); +RUN_TEST (test_dsp_r2_dps_w_ph); +RUN_TEST (test_dsp_r2_dpsqx_s_w_ph); +RUN_TEST (test_dsp_r2_dpsqx_sa_w_ph); +RUN_TEST (test_dsp_r2_dpsx_w_ph); +RUN_TEST (test_dsp_r2_mulsa_w_ph); +RUN_TEST (test_dsp_r2_mulsaq_s_w_ph); + +return tap_done (); +}
tests/tcg/mipsel/test_dsp_r1_dpaq_s_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_dpaq_sa_l_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_dpau_h_qbl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_dpau_h_qbr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_dpsq_s_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_dpsq_sa_l_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_dpsu_h_qbl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_dpsu_h_qbr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_madd.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_maddu.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_maq_s_w_phl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_maq_s_w_phr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_maq_sa_w_phl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_maq_sa_w_phr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_msub.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_msubu.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_mult.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_multu.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_dpa_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_dpaqx_s_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_dpaqx_sa_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_dpax_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_dps_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_dpsqx_s_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_dpsqx_sa_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_dpsx_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_mulsa_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_mulsaq_s_w_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/meson.build +1 -28
@@ -8,31 +8,14 @@ tests_dsp = [ 'test_dsp_arith.c', 'test_dsp_cmp.c', 'test_dsp_ctrl.c', + 'test_dsp_dot.c', 'test_dsp_r1_bitrev.c', - 'test_dsp_r1_dpaq_s_w_ph.c', - 'test_dsp_r1_dpaq_sa_l_w.c', - 'test_dsp_r1_dpau_h_qbl.c', - 'test_dsp_r1_dpau_h_qbr.c', - 'test_dsp_r1_dpsq_s_w_ph.c', - 'test_dsp_r1_dpsq_sa_l_w.c', - 'test_dsp_r1_dpsu_h_qbl.c', - 'test_dsp_r1_dpsu_h_qbr.c', 'test_dsp_r1_insv.c', - 'test_dsp_r1_madd.c', - 'test_dsp_r1_maddu.c', - 'test_dsp_r1_maq_s_w_phl.c', - 'test_dsp_r1_maq_s_w_phr.c', - 'test_dsp_r1_maq_sa_w_phl.c', - 'test_dsp_r1_maq_sa_w_phr.c', - 'test_dsp_r1_msub.c', - 'test_dsp_r1_msubu.c', 'test_dsp_r1_muleq_s_w_phl.c', 'test_dsp_r1_muleq_s_w_phr.c', 'test_dsp_r1_muleu_s_ph_qbl.c', 'test_dsp_r1_muleu_s_ph_qbr.c', 'test_dsp_r1_mulq_rs_ph.c', - 'test_dsp_r1_mult.c', - 'test_dsp_r1_multu.c', 'test_dsp_r1_packrl_ph.c', 'test_dsp_r1_preceq_w_phl.c', 'test_dsp_r1_preceq_w_phr.c',
@@ -70,21 +53,11 @@ tests_dsp = [ 'test_dsp_r1_shrlv_qb.c', 'test_dsp_r2_append.c', 'test_dsp_r2_balign.c', - 'test_dsp_r2_dpa_w_ph.c', - 'test_dsp_r2_dpaqx_s_w_ph.c', - 'test_dsp_r2_dpaqx_sa_w_ph.c', - 'test_dsp_r2_dpax_w_ph.c', - 'test_dsp_r2_dps_w_ph.c', - 'test_dsp_r2_dpsqx_s_w_ph.c', - 'test_dsp_r2_dpsqx_sa_w_ph.c', - 'test_dsp_r2_dpsx_w_ph.c', 'test_dsp_r2_mul_ph.c', 'test_dsp_r2_mul_s_ph.c', 'test_dsp_r2_mulq_rs_w.c', 'test_dsp_r2_mulq_s_ph.c', 'test_dsp_r2_mulq_s_w.c', - 'test_dsp_r2_mulsa_w_ph.c', - 'test_dsp_r2_mulsaq_s_w_ph.c', 'test_dsp_r2_precr_qb_ph.c', 'test_dsp_r2_precr_sra_ph_w.c', 'test_dsp_r2_precr_sra_r_ph_w.c',
Signature · 1 line
2.55.0
PATCH v4 7/32 tests/tcg/mips: Group DSP mul tests
In reply to Philippe Mathieu-DaudéBuild the 10 per-opcode mul tests as a single executable, test_dsp_mul.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mipsel/test_dsp_mul.c | 64 +++++++++++++++++++ tests/tcg/mipsel/test_dsp_r1_muleq_s_w_phl.c | 1 - tests/tcg/mipsel/test_dsp_r1_muleq_s_w_phr.c | 1 - tests/tcg/mipsel/test_dsp_r1_muleu_s_ph_qbl.c | 1 - tests/tcg/mipsel/test_dsp_r1_muleu_s_ph_qbr.c | 1 - tests/tcg/mipsel/test_dsp_r1_mulq_rs_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mul_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mul_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulq_rs_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulq_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_mulq_s_w.c | 1 - tests/tcg/mipsel/meson.build | 11 +--- 12 files changed, 65 insertions(+), 20 deletions(-) create mode 100644 tests/tcg/mipsel/test_dsp_mul.c
tests/tcg/mipsel/test_dsp_mul.c new file +64 -0
@@ -0,0 +1,64 @@ +/* +* MIPS DSP ASE tests: Multiply instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "test_dsp_runner.h" + +#define main test_dsp_r1_muleq_s_w_phl +#include "test_dsp_r1_muleq_s_w_phl.c" +#undef main + +#define main test_dsp_r1_muleq_s_w_phr +#include "test_dsp_r1_muleq_s_w_phr.c" +#undef main + +#define main test_dsp_r1_muleu_s_ph_qbl +#include "test_dsp_r1_muleu_s_ph_qbl.c" +#undef main + +#define main test_dsp_r1_muleu_s_ph_qbr +#include "test_dsp_r1_muleu_s_ph_qbr.c" +#undef main + +#define main test_dsp_r1_mulq_rs_ph +#include "test_dsp_r1_mulq_rs_ph.c" +#undef main + +#define main test_dsp_r2_mul_ph +#include "test_dsp_r2_mul_ph.c" +#undef main + +#define main test_dsp_r2_mul_s_ph +#include "test_dsp_r2_mul_s_ph.c" +#undef main + +#define main test_dsp_r2_mulq_rs_w +#include "test_dsp_r2_mulq_rs_w.c" +#undef main + +#define main test_dsp_r2_mulq_s_ph +#include "test_dsp_r2_mulq_s_ph.c" +#undef main + +#define main test_dsp_r2_mulq_s_w +#include "test_dsp_r2_mulq_s_w.c" +#undef main + +int main (void ) +{ +TAP_START (); +RUN_TEST (test_dsp_r1_muleq_s_w_phl); +RUN_TEST (test_dsp_r1_muleq_s_w_phr); +RUN_TEST (test_dsp_r1_muleu_s_ph_qbl); +RUN_TEST (test_dsp_r1_muleu_s_ph_qbr); +RUN_TEST (test_dsp_r1_mulq_rs_ph); +RUN_TEST (test_dsp_r2_mul_ph); +RUN_TEST (test_dsp_r2_mul_s_ph); +RUN_TEST (test_dsp_r2_mulq_rs_w); +RUN_TEST (test_dsp_r2_mulq_s_ph); +RUN_TEST (test_dsp_r2_mulq_s_w); + +return tap_done (); +}
tests/tcg/mipsel/test_dsp_r1_muleq_s_w_phl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_muleq_s_w_phr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_muleu_s_ph_qbl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_muleu_s_ph_qbr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_mulq_rs_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_mul_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_mul_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_mulq_rs_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_mulq_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_mulq_s_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/meson.build +1 -10
@@ -9,13 +9,9 @@ tests_dsp = [ 'test_dsp_cmp.c', 'test_dsp_ctrl.c', 'test_dsp_dot.c', + 'test_dsp_mul.c', 'test_dsp_r1_bitrev.c', 'test_dsp_r1_insv.c', - 'test_dsp_r1_muleq_s_w_phl.c', - 'test_dsp_r1_muleq_s_w_phr.c', - 'test_dsp_r1_muleu_s_ph_qbl.c', - 'test_dsp_r1_muleu_s_ph_qbr.c', - 'test_dsp_r1_mulq_rs_ph.c', 'test_dsp_r1_packrl_ph.c', 'test_dsp_r1_preceq_w_phl.c', 'test_dsp_r1_preceq_w_phr.c',
@@ -53,11 +49,6 @@ tests_dsp = [ 'test_dsp_r1_shrlv_qb.c', 'test_dsp_r2_append.c', 'test_dsp_r2_balign.c', - 'test_dsp_r2_mul_ph.c', - 'test_dsp_r2_mul_s_ph.c', - 'test_dsp_r2_mulq_rs_w.c', - 'test_dsp_r2_mulq_s_ph.c', - 'test_dsp_r2_mulq_s_w.c', 'test_dsp_r2_precr_qb_ph.c', 'test_dsp_r2_precr_sra_ph_w.c', 'test_dsp_r2_precr_sra_r_ph_w.c',
Signature · 1 line
2.55.0
PATCH v4 8/32 tests/tcg/mips: Group DSP pack tests
In reply to Philippe Mathieu-DaudéBuild the 27 per-opcode pack tests as a single executable, test_dsp_pack.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mipsel/test_dsp_pack.c | 149 ++++++++++++++++++ tests/tcg/mipsel/test_dsp_r1_bitrev.c | 1 - tests/tcg/mipsel/test_dsp_r1_insv.c | 1 - tests/tcg/mipsel/test_dsp_r1_packrl_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceq_w_phl.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceq_w_phr.c | 1 - tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbl.c | 1 - .../tcg/mipsel/test_dsp_r1_precequ_ph_qbla.c | 1 - tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbr.c | 1 - .../tcg/mipsel/test_dsp_r1_precequ_ph_qbra.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbl.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbla.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbr.c | 1 - tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbra.c | 1 - tests/tcg/mipsel/test_dsp_r1_precrq_ph_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_precrq_qb_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_precrq_rs_ph_w.c | 1 - .../tcg/mipsel/test_dsp_r1_precrqu_s_qb_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_repl_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_repl_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_replv_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_replv_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_append.c | 1 - tests/tcg/mipsel/test_dsp_r2_balign.c | 1 - tests/tcg/mipsel/test_dsp_r2_precr_qb_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_precr_sra_ph_w.c | 1 - .../tcg/mipsel/test_dsp_r2_precr_sra_r_ph_w.c | 1 - tests/tcg/mipsel/test_dsp_r2_prepend.c | 1 - tests/tcg/mipsel/meson.build | 28 +--- 29 files changed, 150 insertions(+), 54 deletions(-) create mode 100644 tests/tcg/mipsel/test_dsp_pack.c
tests/tcg/mipsel/test_dsp_pack.c new file +149 -0
@@ -0,0 +1,149 @@ +/* +* MIPS DSP ASE tests: Precision, Pack, Replicate and bit Insert instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "test_dsp_runner.h" + +#define main test_dsp_r1_bitrev +#include "test_dsp_r1_bitrev.c" +#undef main + +#define main test_dsp_r1_insv +#include "test_dsp_r1_insv.c" +#undef main + +#define main test_dsp_r1_packrl_ph +#include "test_dsp_r1_packrl_ph.c" +#undef main + +#define main test_dsp_r1_preceq_w_phl +#include "test_dsp_r1_preceq_w_phl.c" +#undef main + +#define main test_dsp_r1_preceq_w_phr +#include "test_dsp_r1_preceq_w_phr.c" +#undef main + +#define main test_dsp_r1_precequ_ph_qbl +#include "test_dsp_r1_precequ_ph_qbl.c" +#undef main + +#define main test_dsp_r1_precequ_ph_qbla +#include "test_dsp_r1_precequ_ph_qbla.c" +#undef main + +#define main test_dsp_r1_precequ_ph_qbr +#include "test_dsp_r1_precequ_ph_qbr.c" +#undef main + +#define main test_dsp_r1_precequ_ph_qbra +#include "test_dsp_r1_precequ_ph_qbra.c" +#undef main + +#define main test_dsp_r1_preceu_ph_qbl +#include "test_dsp_r1_preceu_ph_qbl.c" +#undef main + +#define main test_dsp_r1_preceu_ph_qbla +#include "test_dsp_r1_preceu_ph_qbla.c" +#undef main + +#define main test_dsp_r1_preceu_ph_qbr +#include "test_dsp_r1_preceu_ph_qbr.c" +#undef main + +#define main test_dsp_r1_preceu_ph_qbra +#include "test_dsp_r1_preceu_ph_qbra.c" +#undef main + +#define main test_dsp_r1_precrq_ph_w +#include "test_dsp_r1_precrq_ph_w.c" +#undef main + +#define main test_dsp_r1_precrq_qb_ph +#include "test_dsp_r1_precrq_qb_ph.c" +#undef main + +#define main test_dsp_r1_precrq_rs_ph_w +#include "test_dsp_r1_precrq_rs_ph_w.c" +#undef main + +#define main test_dsp_r1_precrqu_s_qb_ph +#include "test_dsp_r1_precrqu_s_qb_ph.c" +#undef main + +#define main test_dsp_r1_repl_ph +#include "test_dsp_r1_repl_ph.c" +#undef main + +#define main test_dsp_r1_repl_qb +#include "test_dsp_r1_repl_qb.c" +#undef main + +#define main test_dsp_r1_replv_ph +#include "test_dsp_r1_replv_ph.c" +#undef main + +#define main test_dsp_r1_replv_qb +#include "test_dsp_r1_replv_qb.c" +#undef main + +#define main test_dsp_r2_append +#include "test_dsp_r2_append.c" +#undef main + +#define main test_dsp_r2_balign +#include "test_dsp_r2_balign.c" +#undef main + +#define main test_dsp_r2_precr_qb_ph +#include "test_dsp_r2_precr_qb_ph.c" +#undef main + +#define main test_dsp_r2_precr_sra_ph_w +#include "test_dsp_r2_precr_sra_ph_w.c" +#undef main + +#define main test_dsp_r2_precr_sra_r_ph_w +#include "test_dsp_r2_precr_sra_r_ph_w.c" +#undef main + +#define main test_dsp_r2_prepend +#include "test_dsp_r2_prepend.c" +#undef main + +int main (void ) +{ +TAP_START (); +RUN_TEST (test_dsp_r1_bitrev); +RUN_TEST (test_dsp_r1_insv); +RUN_TEST (test_dsp_r1_packrl_ph); +RUN_TEST (test_dsp_r1_preceq_w_phl); +RUN_TEST (test_dsp_r1_preceq_w_phr); +RUN_TEST (test_dsp_r1_precequ_ph_qbl); +RUN_TEST (test_dsp_r1_precequ_ph_qbla); +RUN_TEST (test_dsp_r1_precequ_ph_qbr); +RUN_TEST (test_dsp_r1_precequ_ph_qbra); +RUN_TEST (test_dsp_r1_preceu_ph_qbl); +RUN_TEST (test_dsp_r1_preceu_ph_qbla); +RUN_TEST (test_dsp_r1_preceu_ph_qbr); +RUN_TEST (test_dsp_r1_preceu_ph_qbra); +RUN_TEST (test_dsp_r1_precrq_ph_w); +RUN_TEST (test_dsp_r1_precrq_qb_ph); +RUN_TEST (test_dsp_r1_precrq_rs_ph_w); +RUN_TEST (test_dsp_r1_precrqu_s_qb_ph); +RUN_TEST (test_dsp_r1_repl_ph); +RUN_TEST (test_dsp_r1_repl_qb); +RUN_TEST (test_dsp_r1_replv_ph); +RUN_TEST (test_dsp_r1_replv_qb); +RUN_TEST (test_dsp_r2_append); +RUN_TEST (test_dsp_r2_balign); +RUN_TEST (test_dsp_r2_precr_qb_ph); +RUN_TEST (test_dsp_r2_precr_sra_ph_w); +RUN_TEST (test_dsp_r2_precr_sra_r_ph_w); +RUN_TEST (test_dsp_r2_prepend); + +return tap_done (); +}
tests/tcg/mipsel/test_dsp_r1_bitrev.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_insv.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_packrl_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_preceq_w_phl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_preceq_w_phr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbla.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbra.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbl.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbla.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbr.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbra.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_precrq_ph_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_precrq_qb_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_precrq_rs_ph_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_precrqu_s_qb_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_repl_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_repl_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_replv_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_replv_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_append.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_balign.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_precr_qb_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_precr_sra_ph_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_precr_sra_r_ph_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_prepend.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/meson.build +1 -27
@@ -10,27 +10,7 @@ tests_dsp = [ 'test_dsp_ctrl.c', 'test_dsp_dot.c', 'test_dsp_mul.c', - 'test_dsp_r1_bitrev.c', - 'test_dsp_r1_insv.c', - 'test_dsp_r1_packrl_ph.c', - 'test_dsp_r1_preceq_w_phl.c', - 'test_dsp_r1_preceq_w_phr.c', - 'test_dsp_r1_precequ_ph_qbl.c', - 'test_dsp_r1_precequ_ph_qbla.c', - 'test_dsp_r1_precequ_ph_qbr.c', - 'test_dsp_r1_precequ_ph_qbra.c', - 'test_dsp_r1_preceu_ph_qbl.c', - 'test_dsp_r1_preceu_ph_qbla.c', - 'test_dsp_r1_preceu_ph_qbr.c', - 'test_dsp_r1_preceu_ph_qbra.c', - 'test_dsp_r1_precrq_ph_w.c', - 'test_dsp_r1_precrq_qb_ph.c', - 'test_dsp_r1_precrq_rs_ph_w.c', - 'test_dsp_r1_precrqu_s_qb_ph.c', - 'test_dsp_r1_repl_ph.c', - 'test_dsp_r1_repl_qb.c', - 'test_dsp_r1_replv_ph.c', - 'test_dsp_r1_replv_qb.c', + 'test_dsp_pack.c', 'test_dsp_r1_shll_ph.c', 'test_dsp_r1_shll_qb.c', 'test_dsp_r1_shll_s_ph.c',
@@ -47,12 +27,6 @@ tests_dsp = [ 'test_dsp_r1_shrav_r_w.c', 'test_dsp_r1_shrl_qb.c', 'test_dsp_r1_shrlv_qb.c', - 'test_dsp_r2_append.c', - 'test_dsp_r2_balign.c', - 'test_dsp_r2_precr_qb_ph.c', - 'test_dsp_r2_precr_sra_ph_w.c', - 'test_dsp_r2_precr_sra_r_ph_w.c', - 'test_dsp_r2_prepend.c', 'test_dsp_r2_shra_qb.c', 'test_dsp_r2_shra_r_qb.c', 'test_dsp_r2_shrav_qb.c',
Signature · 1 line
2.55.0
PATCH v4 9/32 tests/tcg/mips: Group DSP shift tests
In reply to Philippe Mathieu-DaudéBuild the 22 per-opcode shift tests as a single executable, test_dsp_shift.c, to reduce the number of test binaries. Each opcode reports one TAP line.
All DSP tests now emit TAP: select it in the meson setup.
--- tests/tcg/mipsel/test_dsp_r1_shll_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shll_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_shll_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shll_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_shllv_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shllv_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_shllv_s_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shllv_s_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_shra_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shra_r_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shra_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrav_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrav_r_ph.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrav_r_w.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrl_qb.c | 1 - tests/tcg/mipsel/test_dsp_r1_shrlv_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shra_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shra_r_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shrav_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shrav_r_qb.c | 1 - tests/tcg/mipsel/test_dsp_r2_shrl_ph.c | 1 - tests/tcg/mipsel/test_dsp_r2_shrlv_ph.c | 1 - tests/tcg/mipsel/test_dsp_shift.c | 124 ++++++++++++++++++++++ tests/tcg/mipsel/meson.build | 24 +---- 24 files changed, 126 insertions(+), 44 deletions(-) create mode 100644 tests/tcg/mipsel/test_dsp_shift.c
tests/tcg/mipsel/test_dsp_r1_shll_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shll_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shll_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shll_s_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shllv_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shllv_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shllv_s_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shllv_s_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shra_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shra_r_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shra_r_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shrav_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shrav_r_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shrav_r_w.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shrl_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r1_shrlv_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_shra_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_shra_r_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_shrav_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_shrav_r_qb.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_shrl_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_r2_shrlv_ph.c +0 -1
@@ -1,5 +1,4 @@#include <stdio.h> -#include <assert.h> int main () {
tests/tcg/mipsel/test_dsp_shift.c new file +124 -0
124 lines not on this page · raw message
tests/tcg/mipsel/meson.build +2 -22
@@ -11,28 +11,7 @@ tests_dsp = [ 'test_dsp_dot.c', 'test_dsp_mul.c', 'test_dsp_pack.c', - 'test_dsp_r1_shll_ph.c', - 'test_dsp_r1_shll_qb.c', - 'test_dsp_r1_shll_s_ph.c', - 'test_dsp_r1_shll_s_w.c', - 'test_dsp_r1_shllv_ph.c', - 'test_dsp_r1_shllv_qb.c', - 'test_dsp_r1_shllv_s_ph.c', - 'test_dsp_r1_shllv_s_w.c', - 'test_dsp_r1_shra_ph.c', - 'test_dsp_r1_shra_r_ph.c', - 'test_dsp_r1_shra_r_w.c', - 'test_dsp_r1_shrav_ph.c', - 'test_dsp_r1_shrav_r_ph.c', - 'test_dsp_r1_shrav_r_w.c', - 'test_dsp_r1_shrl_qb.c', - 'test_dsp_r1_shrlv_qb.c', - 'test_dsp_r2_shra_qb.c', - 'test_dsp_r2_shra_r_qb.c', - 'test_dsp_r2_shrav_qb.c', - 'test_dsp_r2_shrav_r_qb.c', - 'test_dsp_r2_shrl_ph.c', - 'test_dsp_r2_shrlv_ph.c', + 'test_dsp_shift.c', ] foreach src: tests_dsp
@@ -41,6 +20,7 @@ foreach src: tests_dsp 'cflags': ['-EL', '-mabi=32', '-march=mips32r2', '-mgp32', '-mdsp', '-mdspr2', '-Wno-unused-but-set-variable', '-Wno-unused-variable'], 'qemu_args': ['-cpu', '74Kf'], + 'protocol': 'tap', } } endforeach
Signature · 1 line
2.55.0
PATCH v4 10/32 tests/tcg/mips: Group Release 6 bitops tests
In reply to Philippe Mathieu-DaudéBuild the 6 per-opcode bitops tests as a single executable, test_mips64r6_bitops.c, to reduce the number of test binaries. Each opcode reports one TAP line.
Prefix the per-case output of test_utils_64.h with '# ' so TAP parsers treat it as a comment.
--- tests/tcg/mips/include/test_utils_64.h | 24 +++++----- tests/tcg/mips64/test_mips64r6_bitops.c | 60 +++++++++++++++++++++++++ tests/tcg/mips64/meson.build | 7 +-- 3 files changed, 73 insertions(+), 18 deletions(-) create mode 100644 tests/tcg/mips64/test_mips64r6_bitops.c
tests/tcg/mips/include/test_utils_64.h +12 -12
@@ -28,6 +28,8 @@#include <inttypes.h> #include <string.h> +#include "../../include/tap.h" +#define PRINT_RESULTS 0
@@ -41,25 +43,21 @@ static inline int32_t check_results_64(const char *isa_ase_name, {#if PRINT_RESULTS uint32_t ii; -printf ("\n" );for (ii =0 ; ii < test_count; ii++) {uint64_t a;memcpy (&a, (b64_result + ii),8 );if (ii %8 !=0 ) { -printf (" 0x%016llxULL,\n" , a); +TAP_INFO (" 0x%016llxULL," , a); }else { -printf (" 0x%016llxULL, /* %3d */\n" , - a, ii); +TAP_INFO (" 0x%016llxULL, /* %3d */" , + a, ii); } } -printf ("\n" );#endif uint32_t i;uint32_t pass_count =0 ;uint32_t fail_count =0 ; -printf ("| %-10s \t| %-20s\t| %-16s \t|" , - isa_ase_name, group_name, instruction_name);for (i =0 ; i < test_count; i++) {if (b64_result[i] == b64_expect[i]) { pass_count++;
@@ -68,8 +66,10 @@ static inline int32_t check_results_64(const char *isa_ase_name, } } -printf (" PASS: %3d \t| FAIL: %3d \t| elapsed time: %5.2f ms \t|\n" , - pass_count, fail_count, elapsed_time); +TAP_INFO ("%-10s \t| %-20s\t| %-16s \t| PASS: %3d \t| FAIL: %3d \t| " +"elapsed time: %5.2f ms \t|" , + isa_ase_name, group_name, instruction_name, + pass_count, fail_count, elapsed_time);if (fail_count >0 ) {return -1 ;
@@ -92,10 +92,10 @@ static inline bool check_binary_op_64_with_input(binary_op_64 op, const char *opuint64_t expected = expect[i * cols + j];uint64_t res =0 ;op (&input1, &input2, &res); -printf ("assert(0x%" PRIx64" == %s(0x%" PRIx64", 0x%" PRIx64"));\n" , - res, op_str, input1, input2); +TAP_INFO ("assert(0x%" PRIx64" == %s(0x%" PRIx64", 0x%" PRIx64"));" , + res, op_str, input1, input2);if (expected != res) { -printf ("// error: expected 0x%" PRIx64"\n" , expected); +TAP_INFO ("error: expected 0x%" PRIx64, expected); ret = false; } }
tests/tcg/mips64/test_mips64r6_bitops.c new file +60 -0
60 lines not on this page · raw message
tests/tcg/mips64/meson.build +1 -6
@@ -28,10 +28,8 @@ endif tests = [] tests_mips64r6 = [ + '../mips64/test_mips64r6_bitops.c', '../mips64/test_mips64r6_and.c', - '../mips64/test_mips64r6_bitswap.c', - '../mips64/test_mips64r6_clo.c', - '../mips64/test_mips64r6_clz.c', '../mips64/test_mips64r6_crc32b.c', '../mips64/test_mips64r6_crc32cb.c', '../mips64/test_mips64r6_crc32cd.c',
@@ -40,9 +38,6 @@ tests_mips64r6 = [ '../mips64/test_mips64r6_crc32d.c', '../mips64/test_mips64r6_crc32h.c', '../mips64/test_mips64r6_crc32w.c', - '../mips64/test_mips64r6_dbitswap.c', - '../mips64/test_mips64r6_dclo.c', - '../mips64/test_mips64r6_dclz.c', '../mips64/test_mips64r6_dmuh.c', '../mips64/test_mips64r6_dmuhu.c', '../mips64/test_mips64r6_dmul.c',
Signature · 1 line
2.55.0
PATCH v4 11/32 tests/tcg/mips: Group Release 6 crc tests
In reply to Philippe Mathieu-DaudéBuild the 8 per-opcode crc tests as a single executable, test_mips64r6_crc.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips64/test_mips64r6_crc.c | 72 ++++++++++++++++++++++++++++ tests/tcg/mips64/meson.build | 9 +--- 2 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 tests/tcg/mips64/test_mips64r6_crc.c
tests/tcg/mips64/test_mips64r6_crc.c new file +72 -0
@@ -0,0 +1,72 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* MIPS64R6 tests: CRC32 */ + +#include "../include/tap.h" + +#define main test_mips64r6_crc32b +#include "test_mips64r6_crc32b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_crc32h +#include "test_mips64r6_crc32h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_crc32w +#include "test_mips64r6_crc32w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_crc32d +#include "test_mips64r6_crc32d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_crc32cb +#include "test_mips64r6_crc32cb.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_crc32ch +#include "test_mips64r6_crc32ch.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_crc32cw +#include "test_mips64r6_crc32cw.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_crc32cd +#include "test_mips64r6_crc32cd.c" +#undef main +#undef TEST_COUNT_TOTAL + +static const struct { +const char *name; +int32_t (*fn)(void ); +} r6_tests[] = { + {"crc32b" , test_mips64r6_crc32b }, + {"crc32h" , test_mips64r6_crc32h }, + {"crc32w" , test_mips64r6_crc32w }, + {"crc32d" , test_mips64r6_crc32d }, + {"crc32cb" , test_mips64r6_crc32cb }, + {"crc32ch" , test_mips64r6_crc32ch }, + {"crc32cw" , test_mips64r6_crc32cw }, + {"crc32cd" , test_mips64r6_crc32cd }, +}; + +int main (void ) +{ +unsigned count =sizeof (r6_tests) /sizeof (r6_tests[0 ]); +unsigned i; + +TAP_START (); +for (i =0 ; i < count; i++) { +tap_report (!r6_tests[i].fn (),"MIPS64R6 CRC32 %s" , + r6_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips64/meson.build +1 -8
@@ -29,15 +29,8 @@ tests = [] tests_mips64r6 = [ '../mips64/test_mips64r6_bitops.c', + '../mips64/test_mips64r6_crc.c', '../mips64/test_mips64r6_and.c', - '../mips64/test_mips64r6_crc32b.c', - '../mips64/test_mips64r6_crc32cb.c', - '../mips64/test_mips64r6_crc32cd.c', - '../mips64/test_mips64r6_crc32ch.c', - '../mips64/test_mips64r6_crc32cw.c', - '../mips64/test_mips64r6_crc32d.c', - '../mips64/test_mips64r6_crc32h.c', - '../mips64/test_mips64r6_crc32w.c', '../mips64/test_mips64r6_dmuh.c', '../mips64/test_mips64r6_dmuhu.c', '../mips64/test_mips64r6_dmul.c',
Signature · 1 line
2.55.0
PATCH v4 12/32 tests/tcg/mips: Group Release 6 logic tests
In reply to Philippe Mathieu-DaudéBuild the 4 per-opcode logic tests as a single executable, test_mips64r6_logic.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips64/test_mips64r6_logic.c | 48 ++++++++++++++++++++++++++ tests/tcg/mips64/meson.build | 5 +-- 2 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 tests/tcg/mips64/test_mips64r6_logic.c
tests/tcg/mips64/test_mips64r6_logic.c new file +48 -0
@@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* MIPS64R6 tests: logical */ + +#include "../include/tap.h" + +#define main test_mips64r6_and +#include "test_mips64r6_and.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_nor +#include "test_mips64r6_nor.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_or +#include "test_mips64r6_or.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_xor +#include "test_mips64r6_xor.c" +#undef main +#undef TEST_COUNT_TOTAL + +static const struct { +const char *name; +int32_t (*fn)(void ); +} r6_tests[] = { + {"and" , test_mips64r6_and }, + {"nor" , test_mips64r6_nor }, + {"or" , test_mips64r6_or }, + {"xor" , test_mips64r6_xor }, +}; + +int main (void ) +{ +unsigned count =sizeof (r6_tests) /sizeof (r6_tests[0 ]); +unsigned i; + +TAP_START (); +for (i =0 ; i < count; i++) { +tap_report (!r6_tests[i].fn (),"MIPS64R6 logical %s" , + r6_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips64/meson.build +1 -4
@@ -30,7 +30,7 @@ tests = [] tests_mips64r6 = [ '../mips64/test_mips64r6_bitops.c', '../mips64/test_mips64r6_crc.c', - '../mips64/test_mips64r6_and.c', + '../mips64/test_mips64r6_logic.c', '../mips64/test_mips64r6_dmuh.c', '../mips64/test_mips64r6_dmuhu.c', '../mips64/test_mips64r6_dmul.c',
@@ -42,12 +42,9 @@ tests_mips64r6 = [ '../mips64/test_mips64r6_muhu.c', '../mips64/test_mips64r6_mul.c', '../mips64/test_mips64r6_mulu.c', - '../mips64/test_mips64r6_nor.c', - '../mips64/test_mips64r6_or.c', '../mips64/test_mips64r6_sllv.c', '../mips64/test_mips64r6_srav.c', '../mips64/test_mips64r6_srlv.c', - '../mips64/test_mips64r6_xor.c', ] foreach src: tests_mips64r6
Signature · 1 line
2.55.0
PATCH v4 13/32 tests/tcg/mips: Group Release 6 multiply tests
In reply to Philippe Mathieu-DaudéBuild the 8 per-opcode multiply tests as a single executable, test_mips64r6_multiply.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips64/test_mips64r6_multiply.c | 72 +++++++++++++++++++++++ tests/tcg/mips64/meson.build | 9 +-- 2 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 tests/tcg/mips64/test_mips64r6_multiply.c
tests/tcg/mips64/test_mips64r6_multiply.c new file +72 -0
@@ -0,0 +1,72 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* MIPS64R6 tests: multiply */ + +#include "../include/tap.h" + +#define main test_mips64r6_mul +#include "test_mips64r6_mul.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_muh +#include "test_mips64r6_muh.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_mulu +#include "test_mips64r6_mulu.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_muhu +#include "test_mips64r6_muhu.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dmul +#include "test_mips64r6_dmul.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dmuh +#include "test_mips64r6_dmuh.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dmulu +#include "test_mips64r6_dmulu.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dmuhu +#include "test_mips64r6_dmuhu.c" +#undef main +#undef TEST_COUNT_TOTAL + +static const struct { +const char *name; +int32_t (*fn)(void ); +} r6_tests[] = { + {"mul" , test_mips64r6_mul }, + {"muh" , test_mips64r6_muh }, + {"mulu" , test_mips64r6_mulu }, + {"muhu" , test_mips64r6_muhu }, + {"dmul" , test_mips64r6_dmul }, + {"dmuh" , test_mips64r6_dmuh }, + {"dmulu" , test_mips64r6_dmulu }, + {"dmuhu" , test_mips64r6_dmuhu }, +}; + +int main (void ) +{ +unsigned count =sizeof (r6_tests) /sizeof (r6_tests[0 ]); +unsigned i; + +TAP_START (); +for (i =0 ; i < count; i++) { +tap_report (!r6_tests[i].fn (),"MIPS64R6 multiply %s" , + r6_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips64/meson.build +1 -8
@@ -31,17 +31,10 @@ tests_mips64r6 = [ '../mips64/test_mips64r6_bitops.c', '../mips64/test_mips64r6_crc.c', '../mips64/test_mips64r6_logic.c', - '../mips64/test_mips64r6_dmuh.c', - '../mips64/test_mips64r6_dmuhu.c', - '../mips64/test_mips64r6_dmul.c', - '../mips64/test_mips64r6_dmulu.c', + '../mips64/test_mips64r6_multiply.c', '../mips64/test_mips64r6_dsllv.c', '../mips64/test_mips64r6_dsrav.c', '../mips64/test_mips64r6_dsrlv.c', - '../mips64/test_mips64r6_muh.c', - '../mips64/test_mips64r6_muhu.c', - '../mips64/test_mips64r6_mul.c', - '../mips64/test_mips64r6_mulu.c', '../mips64/test_mips64r6_sllv.c', '../mips64/test_mips64r6_srav.c', '../mips64/test_mips64r6_srlv.c',
Signature · 1 line
2.55.0
PATCH v4 14/32 tests/tcg/mips: Group Release 6 shift tests
In reply to Philippe Mathieu-DaudéBuild the 6 per-opcode shift tests as a single executable, test_mips64r6_shift.c, to reduce the number of test binaries. Each opcode reports one TAP line.
All Release 6 tests now emit TAP: select it in the meson setup.
--- tests/tcg/mips64/test_mips64r6_shift.c | 60 ++++++++++++++++++++++++++ tests/tcg/mips64/meson.build | 9 +--- 2 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 tests/tcg/mips64/test_mips64r6_shift.c
tests/tcg/mips64/test_mips64r6_shift.c new file +60 -0
@@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* MIPS64R6 tests: variable shift */ + +#include "../include/tap.h" + +#define main test_mips64r6_sllv +#include "test_mips64r6_sllv.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_srav +#include "test_mips64r6_srav.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_srlv +#include "test_mips64r6_srlv.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dsllv +#include "test_mips64r6_dsllv.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dsrav +#include "test_mips64r6_dsrav.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_mips64r6_dsrlv +#include "test_mips64r6_dsrlv.c" +#undef main +#undef TEST_COUNT_TOTAL + +static const struct { +const char *name; +int32_t (*fn)(void ); +} r6_tests[] = { + {"sllv" , test_mips64r6_sllv }, + {"srav" , test_mips64r6_srav }, + {"srlv" , test_mips64r6_srlv }, + {"dsllv" , test_mips64r6_dsllv }, + {"dsrav" , test_mips64r6_dsrav }, + {"dsrlv" , test_mips64r6_dsrlv }, +}; + +int main (void ) +{ +unsigned count =sizeof (r6_tests) /sizeof (r6_tests[0 ]); +unsigned i; + +TAP_START (); +for (i =0 ; i < count; i++) { +tap_report (!r6_tests[i].fn (),"MIPS64R6 variable shift %s" , + r6_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips64/meson.build +2 -7
@@ -32,16 +32,11 @@ tests_mips64r6 = [ '../mips64/test_mips64r6_crc.c', '../mips64/test_mips64r6_logic.c', '../mips64/test_mips64r6_multiply.c', - '../mips64/test_mips64r6_dsllv.c', - '../mips64/test_mips64r6_dsrav.c', - '../mips64/test_mips64r6_dsrlv.c', - '../mips64/test_mips64r6_sllv.c', - '../mips64/test_mips64r6_srav.c', - '../mips64/test_mips64r6_srlv.c', + '../mips64/test_mips64r6_shift.c', ] foreach src: tests_mips64r6 - tests += {src: {'cflags': '-march=mips64r6'}} + tests += {src: {'cflags': '-march=mips64r6', 'protocol': 'tap'}} endforeach foreach src: tests_mips_msa
Signature · 1 line
2.55.0
PATCH v4 15/32 tests/tcg/mips: Group MSA bit-count tests
In reply to Philippe Mathieu-DaudéBuild the 12 per-opcode bit-count tests as a single executable, test_msa_bit_count.c, to reduce the number of test binaries. Each opcode reports one TAP line.
Prefix the per-instruction summary of test_utils_128.h with '# ' so TAP parsers treat it as a comment.
--- tests/tcg/mips/include/test_utils_128.h | 32 ++++---- tests/tcg/mips/test_msa_bit_count.c | 99 +++++++++++++++++++++++++ tests/tcg/mips/meson.build | 17 ++--- tests/tcg/mips64/meson.build | 2 +- tests/tcg/mipsel/meson.build | 2 +- 5 files changed, 120 insertions(+), 32 deletions(-) create mode 100644 tests/tcg/mips/test_msa_bit_count.c
tests/tcg/mips/include/test_utils_128.h +14 -18
@@ -27,6 +27,8 @@#include <inttypes.h> #include <string.h> +#include "../../include/tap.h" +#define PRINT_RESULTS 0#define PRINT_FAILURES 0
@@ -41,26 +43,22 @@ static inline int32_t check_results_128(const char *isa_ase_name, {#if PRINT_RESULTS uint32_t ii; -printf ("\n" );for (ii =0 ; ii < test_count; ii++) {uint64_t a, b;memcpy (&a, (b128_result +2 * ii),8 );memcpy (&b, (b128_result +2 * ii +1 ),8 );if (ii %8 !=0 ) { -printf (" { 0x%016llxULL, 0x%016llxULL, },\n" , a, b); +TAP_INFO (" { 0x%016llxULL, 0x%016llxULL, }," , a, b); }else { -printf (" { 0x%016llxULL, 0x%016llxULL, }, /* %3d */\n" , - a, b, ii); +TAP_INFO (" { 0x%016llxULL, 0x%016llxULL, }, /* %3d */" , + a, b, ii); } } -printf ("\n" );#endif uint32_t i;uint32_t pass_count =0 ;uint32_t fail_count =0 ; -printf ("| %-10s \t| %-20s\t| %-16s \t|" , - isa_ase_name, group_name, instruction_name);for (i =0 ; i < test_count; i++) {if ((b128_result[2 * i] == b128_expect[2 * i]) && (b128_result[2 * i +1 ] == b128_expect[2 * i +1 ])) {
@@ -70,28 +68,26 @@ static inline int32_t check_results_128(const char *isa_ase_name,uint32_t ii;uint64_t a, b; -printf ("\n" ); - -printf ("FAILURE for test case %d!\n" , i); +TAP_INFO ("FAILURE for test case %d!" , i);memcpy (&a, (b128_expect +2 * i),8 );memcpy (&b, (b128_expect +2 * i +1 ),8 ); -printf ("Expected result : { 0x%016llxULL, 0x%016llxULL, },\n" , - a, b); +TAP_INFO ("Expected result : { 0x%016llxULL, 0x%016llxULL, }," , + a, b);memcpy (&a, (b128_result +2 * i),8 );memcpy (&b, (b128_result +2 * i +1 ),8 ); -printf ("Actual result : { 0x%016llxULL, 0x%016llxULL, },\n" , - a, b); - -printf ("\n" ); +TAP_INFO ("Actual result : { 0x%016llxULL, 0x%016llxULL, }," , + a, b);#endif fail_count++; } } -printf (" PASS: %3d \t| FAIL: %3d \t| elapsed time: %5.2f ms \t|\n" , - pass_count, fail_count, elapsed_time); +TAP_INFO ("%-10s \t| %-20s\t| %-16s \t| PASS: %3d \t| FAIL: %3d \t| " +"elapsed time: %5.2f ms \t|" , + isa_ase_name, group_name, instruction_name, + pass_count, fail_count, elapsed_time);if (fail_count >0 ) {return -1 ;
tests/tcg/mips/test_msa_bit_count.c new file +99 -0
99 lines not on this page · raw message
tests/tcg/mips/meson.build +5 -12
@@ -1,5 +1,10 @@ tests = [] +# MSA tests shared by the mipsel and mips64 targets +tests_mips_msa_groups = [ + '../mips/test_msa_bit_count.c', +] + tests += tcg_tests['multiarch-linux-user']['tests'] tests += {
@@ -93,18 +98,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/int-divide/test_msa_div_u_w.c', '../mips/user/ase/msa/int-divide/test_msa_div_u_h.c', '../mips/user/ase/msa/int-divide/test_msa_div_u_d.c', - '../mips/user/ase/msa/bit-count/test_msa_pcnt_h.c', - '../mips/user/ase/msa/bit-count/test_msa_pcnt_b.c', - '../mips/user/ase/msa/bit-count/test_msa_nloc_h.c', - '../mips/user/ase/msa/bit-count/test_msa_pcnt_w.c', - '../mips/user/ase/msa/bit-count/test_msa_nlzc_h.c', - '../mips/user/ase/msa/bit-count/test_msa_pcnt_d.c', - '../mips/user/ase/msa/bit-count/test_msa_nloc_d.c', - '../mips/user/ase/msa/bit-count/test_msa_nloc_w.c', - '../mips/user/ase/msa/bit-count/test_msa_nloc_b.c', - '../mips/user/ase/msa/bit-count/test_msa_nlzc_d.c', - '../mips/user/ase/msa/bit-count/test_msa_nlzc_w.c', - '../mips/user/ase/msa/bit-count/test_msa_nlzc_b.c', '../mips/user/ase/msa/int-add/test_msa_addv_d.c', '../mips/user/ase/msa/int-add/test_msa_adds_a_h.c', '../mips/user/ase/msa/int-add/test_msa_add_a_h.c',
tests/tcg/mips64/meson.build +1 -1
@@ -39,7 +39,7 @@ foreach src: tests_mips64r6 tests += {src: {'cflags': '-march=mips64r6', 'protocol': 'tap'}} endforeach -foreach src: tests_mips_msa +foreach src: tests_mips_msa + tests_mips_msa_groups tests += { src: { 'cflags': ['-march=mips64r6', '-mmsa'],
tests/tcg/mipsel/meson.build +1 -1
@@ -40,7 +40,7 @@ endif tests = [] -foreach src: tests_mips_msa +foreach src: tests_mips_msa + tests_mips_msa_groups tests += { src: { 'cflags': ['-mabi=32', '-march=mips32r5', '-mmsa', '-mno-odd-spreg',
Signature · 1 line
2.55.0
PATCH v4 16/32 tests/tcg/mips: Group MSA bit-move tests
In reply to Philippe Mathieu-DaudéBuild the 11 per-opcode bit-move tests as a single executable, test_msa_bit_move.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_bit_move.c | 93 ++++++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 12 +--- 2 files changed, 94 insertions(+), 11 deletions(-) create mode 100644 tests/tcg/mips/test_msa_bit_move.c
tests/tcg/mips/test_msa_bit_move.c new file +93 -0
@@ -0,0 +1,93 @@ +/* +* MIPS MSA tests: Bit Move instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_binsl_b +#include "user/ase/msa/bit-move/test_msa_binsl_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_binsl_d +#include "user/ase/msa/bit-move/test_msa_binsl_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_binsl_h +#include "user/ase/msa/bit-move/test_msa_binsl_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_binsl_w +#include "user/ase/msa/bit-move/test_msa_binsl_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_binsr_b +#include "user/ase/msa/bit-move/test_msa_binsr_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_binsr_d +#include "user/ase/msa/bit-move/test_msa_binsr_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_binsr_h +#include "user/ase/msa/bit-move/test_msa_binsr_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_binsr_w +#include "user/ase/msa/bit-move/test_msa_binsr_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bmnz_v +#include "user/ase/msa/bit-move/test_msa_bmnz_v.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bmz_v +#include "user/ase/msa/bit-move/test_msa_bmz_v.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bsel_v +#include "user/ase/msa/bit-move/test_msa_bsel_v.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"binsl.b" , test_msa_binsl_b }, + {"binsl.d" , test_msa_binsl_d }, + {"binsl.h" , test_msa_binsl_h }, + {"binsl.w" , test_msa_binsl_w }, + {"binsr.b" , test_msa_binsr_b }, + {"binsr.d" , test_msa_binsr_d }, + {"binsr.h" , test_msa_binsr_h }, + {"binsr.w" , test_msa_binsr_w }, + {"bmnz.v" , test_msa_bmnz_v }, + {"bmz.v" , test_msa_bmz_v }, + {"bsel.v" , test_msa_bsel_v }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Bit Move" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -11
@@ -3,6 +3,7 @@ tests = [] # MSA tests shared by the mipsel and mips64 targets tests_mips_msa_groups = [ '../mips/test_msa_bit_count.c', + '../mips/test_msa_bit_move.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -152,17 +153,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/pack/test_msa_pckod_w.c', '../mips/user/ase/msa/pack/test_msa_vshf_h.c', '../mips/user/ase/msa/pack/test_msa_pckod_d.c', - '../mips/user/ase/msa/bit-move/test_msa_binsr_w.c', - '../mips/user/ase/msa/bit-move/test_msa_binsr_b.c', - '../mips/user/ase/msa/bit-move/test_msa_binsr_d.c', - '../mips/user/ase/msa/bit-move/test_msa_binsr_h.c', - '../mips/user/ase/msa/bit-move/test_msa_binsl_h.c', - '../mips/user/ase/msa/bit-move/test_msa_binsl_w.c', - '../mips/user/ase/msa/bit-move/test_msa_bmnz_v.c', - '../mips/user/ase/msa/bit-move/test_msa_bsel_v.c', - '../mips/user/ase/msa/bit-move/test_msa_bmz_v.c', - '../mips/user/ase/msa/bit-move/test_msa_binsl_d.c', - '../mips/user/ase/msa/bit-move/test_msa_binsl_b.c', '../mips/user/ase/msa/shift/test_msa_sra_d.c', '../mips/user/ase/msa/shift/test_msa_srl_b.c', '../mips/user/ase/msa/shift/test_msa_srl_d.c',
Signature · 1 line
2.55.0
PATCH v4 17/32 tests/tcg/mips: Group MSA bit-set tests
In reply to Philippe Mathieu-DaudéBuild the 12 per-opcode bit-set tests as a single executable, test_msa_bit_set.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_bit_set.c | 99 +++++++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 13 +--- 2 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 tests/tcg/mips/test_msa_bit_set.c
tests/tcg/mips/test_msa_bit_set.c new file +99 -0
@@ -0,0 +1,99 @@ +/* +* MIPS MSA tests: Bit Set instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_bclr_b +#include "user/ase/msa/bit-set/test_msa_bclr_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bclr_d +#include "user/ase/msa/bit-set/test_msa_bclr_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bclr_h +#include "user/ase/msa/bit-set/test_msa_bclr_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bclr_w +#include "user/ase/msa/bit-set/test_msa_bclr_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bneg_b +#include "user/ase/msa/bit-set/test_msa_bneg_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bneg_d +#include "user/ase/msa/bit-set/test_msa_bneg_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bneg_h +#include "user/ase/msa/bit-set/test_msa_bneg_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bneg_w +#include "user/ase/msa/bit-set/test_msa_bneg_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bset_b +#include "user/ase/msa/bit-set/test_msa_bset_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bset_d +#include "user/ase/msa/bit-set/test_msa_bset_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bset_h +#include "user/ase/msa/bit-set/test_msa_bset_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_bset_w +#include "user/ase/msa/bit-set/test_msa_bset_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"bclr.b" , test_msa_bclr_b }, + {"bclr.d" , test_msa_bclr_d }, + {"bclr.h" , test_msa_bclr_h }, + {"bclr.w" , test_msa_bclr_w }, + {"bneg.b" , test_msa_bneg_b }, + {"bneg.d" , test_msa_bneg_d }, + {"bneg.h" , test_msa_bneg_h }, + {"bneg.w" , test_msa_bneg_w }, + {"bset.b" , test_msa_bset_b }, + {"bset.d" , test_msa_bset_d }, + {"bset.h" , test_msa_bset_h }, + {"bset.w" , test_msa_bset_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Bit Set" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -12
@@ -4,6 +4,7 @@ tests = [] tests_mips_msa_groups = [ '../mips/test_msa_bit_count.c', '../mips/test_msa_bit_move.c', + '../mips/test_msa_bit_set.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -250,18 +251,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/int-average/test_msa_aver_u_d.c', '../mips/user/ase/msa/int-average/test_msa_ave_u_b.c', '../mips/user/ase/msa/int-average/test_msa_aver_s_h.c', - '../mips/user/ase/msa/bit-set/test_msa_bneg_b.c', - '../mips/user/ase/msa/bit-set/test_msa_bclr_d.c', - '../mips/user/ase/msa/bit-set/test_msa_bneg_h.c', - '../mips/user/ase/msa/bit-set/test_msa_bset_h.c', - '../mips/user/ase/msa/bit-set/test_msa_bclr_b.c', - '../mips/user/ase/msa/bit-set/test_msa_bclr_h.c', - '../mips/user/ase/msa/bit-set/test_msa_bneg_w.c', - '../mips/user/ase/msa/bit-set/test_msa_bset_w.c', - '../mips/user/ase/msa/bit-set/test_msa_bset_b.c', - '../mips/user/ase/msa/bit-set/test_msa_bclr_w.c', - '../mips/user/ase/msa/bit-set/test_msa_bset_d.c', - '../mips/user/ase/msa/bit-set/test_msa_bneg_d.c', '../mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_h.c', '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_h.c', '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_w.c',
Signature · 1 line
2.55.0
PATCH v4 18/32 tests/tcg/mips: Group MSA fixed-multiply tests
In reply to Philippe Mathieu-DaudéBuild the 12 per-opcode fixed-multiply tests as a single executable, test_msa_fixed_multiply.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_fixed_multiply.c | 99 ++++++++++++++++++++++++ tests/tcg/mips/meson.build | 13 +--- 2 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 tests/tcg/mips/test_msa_fixed_multiply.c
tests/tcg/mips/test_msa_fixed_multiply.c new file +99 -0
@@ -0,0 +1,99 @@ +/* +* MIPS MSA tests: Fixed Multiply instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_madd_q_h +#include "user/ase/msa/fixed-multiply/test_msa_madd_q_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_madd_q_w +#include "user/ase/msa/fixed-multiply/test_msa_madd_q_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_maddr_q_h +#include "user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_maddr_q_w +#include "user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_msub_q_h +#include "user/ase/msa/fixed-multiply/test_msa_msub_q_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_msub_q_w +#include "user/ase/msa/fixed-multiply/test_msa_msub_q_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_msubr_q_h +#include "user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_msubr_q_w +#include "user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mul_q_h +#include "user/ase/msa/fixed-multiply/test_msa_mul_q_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mul_q_w +#include "user/ase/msa/fixed-multiply/test_msa_mul_q_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mulr_q_h +#include "user/ase/msa/fixed-multiply/test_msa_mulr_q_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mulr_q_w +#include "user/ase/msa/fixed-multiply/test_msa_mulr_q_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"madd.q.h" , test_msa_madd_q_h }, + {"madd.q.w" , test_msa_madd_q_w }, + {"maddr.q.h" , test_msa_maddr_q_h }, + {"maddr.q.w" , test_msa_maddr_q_w }, + {"msub.q.h" , test_msa_msub_q_h }, + {"msub.q.w" , test_msa_msub_q_w }, + {"msubr.q.h" , test_msa_msubr_q_h }, + {"msubr.q.w" , test_msa_msubr_q_w }, + {"mul.q.h" , test_msa_mul_q_h }, + {"mul.q.w" , test_msa_mul_q_w }, + {"mulr.q.h" , test_msa_mulr_q_h }, + {"mulr.q.w" , test_msa_mulr_q_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Fixed Multiply" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -12
@@ -5,6 +5,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_bit_count.c', '../mips/test_msa_bit_move.c', '../mips/test_msa_bit_set.c', + '../mips/test_msa_fixed_multiply.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -199,18 +200,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/logic/test_msa_and_v.c', '../mips/user/ase/msa/logic/test_msa_xor_v.c', '../mips/user/ase/msa/move/test_msa_move_v.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_h.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_mul_q_w.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_w.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_h.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_maddr_q_w.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_msub_q_w.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_msub_q_h.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_madd_q_h.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_mul_q_h.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_mulr_q_w.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_madd_q_w.c', - '../mips/user/ase/msa/fixed-multiply/test_msa_msubr_q_h.c', '../mips/user/ase/msa/int-max-min/test_msa_min_u_h.c', '../mips/user/ase/msa/int-max-min/test_msa_max_a_b.c', '../mips/user/ase/msa/int-max-min/test_msa_max_s_b.c',
Signature · 1 line
2.55.0
PATCH v4 19/32 tests/tcg/mips: Group MSA float-max-min tests
In reply to Philippe Mathieu-DaudéBuild the 8 per-opcode float-max-min tests as a single executable, test_msa_float_max_min.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_float_max_min.c | 75 +++++++++++++++++++++++++ tests/tcg/mips/meson.build | 9 +-- 2 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 tests/tcg/mips/test_msa_float_max_min.c
tests/tcg/mips/test_msa_float_max_min.c new file +75 -0
@@ -0,0 +1,75 @@ +/* +* MIPS MSA tests: Float Min / Max instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_fmax_a_d +#include "user/ase/msa/float-max-min/test_msa_fmax_a_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_fmax_a_w +#include "user/ase/msa/float-max-min/test_msa_fmax_a_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_fmax_d +#include "user/ase/msa/float-max-min/test_msa_fmax_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_fmax_w +#include "user/ase/msa/float-max-min/test_msa_fmax_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_fmin_a_d +#include "user/ase/msa/float-max-min/test_msa_fmin_a_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_fmin_a_w +#include "user/ase/msa/float-max-min/test_msa_fmin_a_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_fmin_d +#include "user/ase/msa/float-max-min/test_msa_fmin_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_fmin_w +#include "user/ase/msa/float-max-min/test_msa_fmin_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"fmax.a.d" , test_msa_fmax_a_d }, + {"fmax.a.w" , test_msa_fmax_a_w }, + {"fmax.d" , test_msa_fmax_d }, + {"fmax.w" , test_msa_fmax_w }, + {"fmin.a.d" , test_msa_fmin_a_d }, + {"fmin.a.w" , test_msa_fmin_a_w }, + {"fmin.d" , test_msa_fmin_d }, + {"fmin.w" , test_msa_fmin_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Float Max Min" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -8
@@ -6,6 +6,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_bit_move.c', '../mips/test_msa_bit_set.c', '../mips/test_msa_fixed_multiply.c', + '../mips/test_msa_float_max_min.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -73,14 +74,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/int-subtract/test_msa_asub_u_h.c', '../mips/user/ase/msa/int-subtract/test_msa_asub_s_b.c', '../mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c', - '../mips/user/ase/msa/float-max-min/test_msa_fmin_w.c', - '../mips/user/ase/msa/float-max-min/test_msa_fmax_w.c', - '../mips/user/ase/msa/float-max-min/test_msa_fmax_a_d.c', - '../mips/user/ase/msa/float-max-min/test_msa_fmin_a_w.c', - '../mips/user/ase/msa/float-max-min/test_msa_fmax_a_w.c', - '../mips/user/ase/msa/float-max-min/test_msa_fmax_d.c', - '../mips/user/ase/msa/float-max-min/test_msa_fmin_d.c', - '../mips/user/ase/msa/float-max-min/test_msa_fmin_a_d.c', '../mips/user/ase/msa/int-multiply/test_msa_mulv_w.c', '../mips/user/ase/msa/int-multiply/test_msa_msubv_d.c', '../mips/user/ase/msa/int-multiply/test_msa_msubv_h.c',
Signature · 1 line
2.55.0
PATCH v4 20/32 tests/tcg/mips: Group MSA int-add tests
In reply to Philippe Mathieu-DaudéBuild the 26 per-opcode int-add tests as a single executable, test_msa_int_add.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_int_add.c | 183 ++++++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 27 +---- 2 files changed, 184 insertions(+), 26 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_add.c
tests/tcg/mips/test_msa_int_add.c new file +183 -0
@@ -0,0 +1,183 @@ +/* +* MIPS MSA tests: Int Add instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_add_a_b +#include "user/ase/msa/int-add/test_msa_add_a_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_add_a_d +#include "user/ase/msa/int-add/test_msa_add_a_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_add_a_h +#include "user/ase/msa/int-add/test_msa_add_a_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_add_a_w +#include "user/ase/msa/int-add/test_msa_add_a_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_a_b +#include "user/ase/msa/int-add/test_msa_adds_a_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_a_d +#include "user/ase/msa/int-add/test_msa_adds_a_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_a_h +#include "user/ase/msa/int-add/test_msa_adds_a_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_a_w +#include "user/ase/msa/int-add/test_msa_adds_a_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_s_b +#include "user/ase/msa/int-add/test_msa_adds_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_s_d +#include "user/ase/msa/int-add/test_msa_adds_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_s_h +#include "user/ase/msa/int-add/test_msa_adds_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_s_w +#include "user/ase/msa/int-add/test_msa_adds_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_u_b +#include "user/ase/msa/int-add/test_msa_adds_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_u_d +#include "user/ase/msa/int-add/test_msa_adds_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_u_h +#include "user/ase/msa/int-add/test_msa_adds_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_adds_u_w +#include "user/ase/msa/int-add/test_msa_adds_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_addv_b +#include "user/ase/msa/int-add/test_msa_addv_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_addv_d +#include "user/ase/msa/int-add/test_msa_addv_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_addv_h +#include "user/ase/msa/int-add/test_msa_addv_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_addv_w +#include "user/ase/msa/int-add/test_msa_addv_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hadd_s_d +#include "user/ase/msa/int-add/test_msa_hadd_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hadd_s_h +#include "user/ase/msa/int-add/test_msa_hadd_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hadd_s_w +#include "user/ase/msa/int-add/test_msa_hadd_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hadd_u_d +#include "user/ase/msa/int-add/test_msa_hadd_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hadd_u_h +#include "user/ase/msa/int-add/test_msa_hadd_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hadd_u_w +#include "user/ase/msa/int-add/test_msa_hadd_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"add.a.b" , test_msa_add_a_b }, + {"add.a.d" , test_msa_add_a_d }, + {"add.a.h" , test_msa_add_a_h }, + {"add.a.w" , test_msa_add_a_w }, + {"adds.a.b" , test_msa_adds_a_b }, + {"adds.a.d" , test_msa_adds_a_d }, + {"adds.a.h" , test_msa_adds_a_h }, + {"adds.a.w" , test_msa_adds_a_w }, + {"adds.s.b" , test_msa_adds_s_b }, + {"adds.s.d" , test_msa_adds_s_d }, + {"adds.s.h" , test_msa_adds_s_h }, + {"adds.s.w" , test_msa_adds_s_w }, + {"adds.u.b" , test_msa_adds_u_b }, + {"adds.u.d" , test_msa_adds_u_d }, + {"adds.u.h" , test_msa_adds_u_h }, + {"adds.u.w" , test_msa_adds_u_w }, + {"addv.b" , test_msa_addv_b }, + {"addv.d" , test_msa_addv_d }, + {"addv.h" , test_msa_addv_h }, + {"addv.w" , test_msa_addv_w }, + {"hadd.s.d" , test_msa_hadd_s_d }, + {"hadd.s.h" , test_msa_hadd_s_h }, + {"hadd.s.w" , test_msa_hadd_s_w }, + {"hadd.u.d" , test_msa_hadd_u_d }, + {"hadd.u.h" , test_msa_hadd_u_h }, + {"hadd.u.w" , test_msa_hadd_u_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Int Add" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -26
@@ -7,6 +7,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_bit_set.c', '../mips/test_msa_fixed_multiply.c', '../mips/test_msa_float_max_min.c', + '../mips/test_msa_int_add.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -94,32 +95,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/int-divide/test_msa_div_u_w.c', '../mips/user/ase/msa/int-divide/test_msa_div_u_h.c', '../mips/user/ase/msa/int-divide/test_msa_div_u_d.c', - '../mips/user/ase/msa/int-add/test_msa_addv_d.c', - '../mips/user/ase/msa/int-add/test_msa_adds_a_h.c', - '../mips/user/ase/msa/int-add/test_msa_add_a_h.c', - '../mips/user/ase/msa/int-add/test_msa_adds_a_w.c', - '../mips/user/ase/msa/int-add/test_msa_adds_u_d.c', - '../mips/user/ase/msa/int-add/test_msa_adds_s_h.c', - '../mips/user/ase/msa/int-add/test_msa_adds_s_b.c', - '../mips/user/ase/msa/int-add/test_msa_addv_b.c', - '../mips/user/ase/msa/int-add/test_msa_hadd_s_w.c', - '../mips/user/ase/msa/int-add/test_msa_hadd_u_d.c', - '../mips/user/ase/msa/int-add/test_msa_adds_a_b.c', - '../mips/user/ase/msa/int-add/test_msa_add_a_w.c', - '../mips/user/ase/msa/int-add/test_msa_hadd_u_h.c', - '../mips/user/ase/msa/int-add/test_msa_add_a_b.c', - '../mips/user/ase/msa/int-add/test_msa_adds_s_d.c', - '../mips/user/ase/msa/int-add/test_msa_adds_u_b.c', - '../mips/user/ase/msa/int-add/test_msa_adds_a_d.c', - '../mips/user/ase/msa/int-add/test_msa_adds_s_w.c', - '../mips/user/ase/msa/int-add/test_msa_addv_w.c', - '../mips/user/ase/msa/int-add/test_msa_adds_u_h.c', - '../mips/user/ase/msa/int-add/test_msa_hadd_u_w.c', - '../mips/user/ase/msa/int-add/test_msa_hadd_s_h.c', - '../mips/user/ase/msa/int-add/test_msa_addv_h.c', - '../mips/user/ase/msa/int-add/test_msa_hadd_s_d.c', - '../mips/user/ase/msa/int-add/test_msa_add_a_d.c', - '../mips/user/ase/msa/int-add/test_msa_adds_u_w.c', '../mips/user/ase/msa/interleave/test_msa_ilvr_b.c', '../mips/user/ase/msa/interleave/test_msa_ilvr_d.c', '../mips/user/ase/msa/interleave/test_msa_ilvod_b.c',
Signature · 1 line
2.55.0
PATCH v4 21/32 tests/tcg/mips: Group MSA int-average tests
In reply to Philippe Mathieu-DaudéBuild the 16 per-opcode int-average tests as a single executable, test_msa_int_average.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_int_average.c | 123 ++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 17 +--- 2 files changed, 124 insertions(+), 16 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_average.c
tests/tcg/mips/test_msa_int_average.c new file +123 -0
@@ -0,0 +1,123 @@ +/* +* MIPS MSA tests: Int Average instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_ave_s_b +#include "user/ase/msa/int-average/test_msa_ave_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ave_s_d +#include "user/ase/msa/int-average/test_msa_ave_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ave_s_h +#include "user/ase/msa/int-average/test_msa_ave_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ave_s_w +#include "user/ase/msa/int-average/test_msa_ave_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ave_u_b +#include "user/ase/msa/int-average/test_msa_ave_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ave_u_d +#include "user/ase/msa/int-average/test_msa_ave_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ave_u_h +#include "user/ase/msa/int-average/test_msa_ave_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ave_u_w +#include "user/ase/msa/int-average/test_msa_ave_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_aver_s_b +#include "user/ase/msa/int-average/test_msa_aver_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_aver_s_d +#include "user/ase/msa/int-average/test_msa_aver_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_aver_s_h +#include "user/ase/msa/int-average/test_msa_aver_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_aver_s_w +#include "user/ase/msa/int-average/test_msa_aver_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_aver_u_b +#include "user/ase/msa/int-average/test_msa_aver_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_aver_u_d +#include "user/ase/msa/int-average/test_msa_aver_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_aver_u_h +#include "user/ase/msa/int-average/test_msa_aver_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_aver_u_w +#include "user/ase/msa/int-average/test_msa_aver_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"ave.s.b" , test_msa_ave_s_b }, + {"ave.s.d" , test_msa_ave_s_d }, + {"ave.s.h" , test_msa_ave_s_h }, + {"ave.s.w" , test_msa_ave_s_w }, + {"ave.u.b" , test_msa_ave_u_b }, + {"ave.u.d" , test_msa_ave_u_d }, + {"ave.u.h" , test_msa_ave_u_h }, + {"ave.u.w" , test_msa_ave_u_w }, + {"aver.s.b" , test_msa_aver_s_b }, + {"aver.s.d" , test_msa_aver_s_d }, + {"aver.s.h" , test_msa_aver_s_h }, + {"aver.s.w" , test_msa_aver_s_w }, + {"aver.u.b" , test_msa_aver_u_b }, + {"aver.u.d" , test_msa_aver_u_d }, + {"aver.u.h" , test_msa_aver_u_h }, + {"aver.u.w" , test_msa_aver_u_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Int Average" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -16
@@ -8,6 +8,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_fixed_multiply.c', '../mips/test_msa_float_max_min.c', '../mips/test_msa_int_add.c', + '../mips/test_msa_int_average.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -192,22 +193,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/int-max-min/test_msa_min_s_b.c', '../mips/user/ase/msa/int-max-min/test_msa_min_u_w.c', '../mips/user/ase/msa/int-max-min/test_msa_max_u_w.c', - '../mips/user/ase/msa/int-average/test_msa_aver_s_b.c', - '../mips/user/ase/msa/int-average/test_msa_ave_s_b.c', - '../mips/user/ase/msa/int-average/test_msa_ave_u_w.c', - '../mips/user/ase/msa/int-average/test_msa_ave_s_h.c', - '../mips/user/ase/msa/int-average/test_msa_aver_u_w.c', - '../mips/user/ase/msa/int-average/test_msa_ave_s_w.c', - '../mips/user/ase/msa/int-average/test_msa_aver_u_h.c', - '../mips/user/ase/msa/int-average/test_msa_ave_s_d.c', - '../mips/user/ase/msa/int-average/test_msa_ave_u_h.c', - '../mips/user/ase/msa/int-average/test_msa_aver_u_b.c', - '../mips/user/ase/msa/int-average/test_msa_aver_s_d.c', - '../mips/user/ase/msa/int-average/test_msa_aver_s_w.c', - '../mips/user/ase/msa/int-average/test_msa_ave_u_d.c', - '../mips/user/ase/msa/int-average/test_msa_aver_u_d.c', - '../mips/user/ase/msa/int-average/test_msa_ave_u_b.c', - '../mips/user/ase/msa/int-average/test_msa_aver_s_h.c', '../mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_h.c', '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_h.c', '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_w.c',
Signature · 1 line
2.55.0
PATCH v4 22/32 tests/tcg/mips: Group MSA int-compare tests
In reply to Philippe Mathieu-DaudéBuild the 20 per-opcode int-compare tests as a single executable, test_msa_int_compare.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_int_compare.c | 147 ++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 21 +--- 2 files changed, 148 insertions(+), 20 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_compare.c
tests/tcg/mips/test_msa_int_compare.c new file +147 -0
@@ -0,0 +1,147 @@ +/* +* MIPS MSA tests: Int Compare instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_ceq_b +#include "user/ase/msa/int-compare/test_msa_ceq_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ceq_d +#include "user/ase/msa/int-compare/test_msa_ceq_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ceq_h +#include "user/ase/msa/int-compare/test_msa_ceq_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ceq_w +#include "user/ase/msa/int-compare/test_msa_ceq_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_cle_s_b +#include "user/ase/msa/int-compare/test_msa_cle_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_cle_s_d +#include "user/ase/msa/int-compare/test_msa_cle_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_cle_s_h +#include "user/ase/msa/int-compare/test_msa_cle_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_cle_s_w +#include "user/ase/msa/int-compare/test_msa_cle_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_cle_u_b +#include "user/ase/msa/int-compare/test_msa_cle_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_cle_u_d +#include "user/ase/msa/int-compare/test_msa_cle_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_cle_u_h +#include "user/ase/msa/int-compare/test_msa_cle_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_cle_u_w +#include "user/ase/msa/int-compare/test_msa_cle_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_clt_s_b +#include "user/ase/msa/int-compare/test_msa_clt_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_clt_s_d +#include "user/ase/msa/int-compare/test_msa_clt_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_clt_s_h +#include "user/ase/msa/int-compare/test_msa_clt_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_clt_s_w +#include "user/ase/msa/int-compare/test_msa_clt_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_clt_u_b +#include "user/ase/msa/int-compare/test_msa_clt_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_clt_u_d +#include "user/ase/msa/int-compare/test_msa_clt_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_clt_u_h +#include "user/ase/msa/int-compare/test_msa_clt_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_clt_u_w +#include "user/ase/msa/int-compare/test_msa_clt_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"ceq.b" , test_msa_ceq_b }, + {"ceq.d" , test_msa_ceq_d }, + {"ceq.h" , test_msa_ceq_h }, + {"ceq.w" , test_msa_ceq_w }, + {"cle.s.b" , test_msa_cle_s_b }, + {"cle.s.d" , test_msa_cle_s_d }, + {"cle.s.h" , test_msa_cle_s_h }, + {"cle.s.w" , test_msa_cle_s_w }, + {"cle.u.b" , test_msa_cle_u_b }, + {"cle.u.d" , test_msa_cle_u_d }, + {"cle.u.h" , test_msa_cle_u_h }, + {"cle.u.w" , test_msa_cle_u_w }, + {"clt.s.b" , test_msa_clt_s_b }, + {"clt.s.d" , test_msa_clt_s_d }, + {"clt.s.h" , test_msa_clt_s_h }, + {"clt.s.w" , test_msa_clt_s_w }, + {"clt.u.b" , test_msa_clt_u_b }, + {"clt.u.d" , test_msa_clt_u_d }, + {"clt.u.h" , test_msa_clt_u_h }, + {"clt.u.w" , test_msa_clt_u_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Int Compare" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -20
@@ -9,6 +9,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_float_max_min.c', '../mips/test_msa_int_add.c', '../mips/test_msa_int_average.c', + '../mips/test_msa_int_compare.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -144,26 +145,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/shift/test_msa_srar_w.c', '../mips/user/ase/msa/shift/test_msa_srlr_b.c', '../mips/user/ase/msa/shift/test_msa_srlr_w.c', - '../mips/user/ase/msa/int-compare/test_msa_cle_u_d.c', - '../mips/user/ase/msa/int-compare/test_msa_clt_s_h.c', - '../mips/user/ase/msa/int-compare/test_msa_clt_u_w.c', - '../mips/user/ase/msa/int-compare/test_msa_cle_s_h.c', - '../mips/user/ase/msa/int-compare/test_msa_cle_u_b.c', - '../mips/user/ase/msa/int-compare/test_msa_cle_s_d.c', - '../mips/user/ase/msa/int-compare/test_msa_ceq_w.c', - '../mips/user/ase/msa/int-compare/test_msa_cle_s_w.c', - '../mips/user/ase/msa/int-compare/test_msa_clt_s_w.c', - '../mips/user/ase/msa/int-compare/test_msa_cle_u_w.c', - '../mips/user/ase/msa/int-compare/test_msa_ceq_h.c', - '../mips/user/ase/msa/int-compare/test_msa_cle_s_b.c', - '../mips/user/ase/msa/int-compare/test_msa_clt_s_b.c', - '../mips/user/ase/msa/int-compare/test_msa_ceq_b.c', - '../mips/user/ase/msa/int-compare/test_msa_clt_u_h.c', - '../mips/user/ase/msa/int-compare/test_msa_cle_u_h.c', - '../mips/user/ase/msa/int-compare/test_msa_clt_s_d.c', - '../mips/user/ase/msa/int-compare/test_msa_ceq_d.c', - '../mips/user/ase/msa/int-compare/test_msa_clt_u_b.c', - '../mips/user/ase/msa/int-compare/test_msa_clt_u_d.c', '../mips/user/ase/msa/logic/test_msa_or_v.c', '../mips/user/ase/msa/logic/test_msa_nor_v.c', '../mips/user/ase/msa/logic/test_msa_and_v.c',
Signature · 1 line
2.55.0
PATCH v4 23/32 tests/tcg/mips: Group MSA int-div-mod tests
In reply to Philippe Mathieu-DaudéBuild the 16 per-opcode int-div-mod tests as a single executable, test_msa_int_div_mod.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_int_div_mod.c | 123 ++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 17 +--- 2 files changed, 124 insertions(+), 16 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_div_mod.c
tests/tcg/mips/test_msa_int_div_mod.c new file +123 -0
@@ -0,0 +1,123 @@ +/* +* MIPS MSA tests: Int Divide and Modulo instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_div_s_b +#include "user/ase/msa/int-divide/test_msa_div_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_div_s_d +#include "user/ase/msa/int-divide/test_msa_div_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_div_s_h +#include "user/ase/msa/int-divide/test_msa_div_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_div_s_w +#include "user/ase/msa/int-divide/test_msa_div_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_div_u_b +#include "user/ase/msa/int-divide/test_msa_div_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_div_u_d +#include "user/ase/msa/int-divide/test_msa_div_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_div_u_h +#include "user/ase/msa/int-divide/test_msa_div_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_div_u_w +#include "user/ase/msa/int-divide/test_msa_div_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mod_s_b +#include "user/ase/msa/int-modulo/test_msa_mod_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mod_s_d +#include "user/ase/msa/int-modulo/test_msa_mod_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mod_s_h +#include "user/ase/msa/int-modulo/test_msa_mod_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mod_s_w +#include "user/ase/msa/int-modulo/test_msa_mod_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mod_u_b +#include "user/ase/msa/int-modulo/test_msa_mod_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mod_u_d +#include "user/ase/msa/int-modulo/test_msa_mod_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mod_u_h +#include "user/ase/msa/int-modulo/test_msa_mod_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mod_u_w +#include "user/ase/msa/int-modulo/test_msa_mod_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"div.s.b" , test_msa_div_s_b }, + {"div.s.d" , test_msa_div_s_d }, + {"div.s.h" , test_msa_div_s_h }, + {"div.s.w" , test_msa_div_s_w }, + {"div.u.b" , test_msa_div_u_b }, + {"div.u.d" , test_msa_div_u_d }, + {"div.u.h" , test_msa_div_u_h }, + {"div.u.w" , test_msa_div_u_w }, + {"mod.s.b" , test_msa_mod_s_b }, + {"mod.s.d" , test_msa_mod_s_d }, + {"mod.s.h" , test_msa_mod_s_h }, + {"mod.s.w" , test_msa_mod_s_w }, + {"mod.u.b" , test_msa_mod_u_b }, + {"mod.u.d" , test_msa_mod_u_d }, + {"mod.u.h" , test_msa_mod_u_h }, + {"mod.u.w" , test_msa_mod_u_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Int Divide and Modulo" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -16
@@ -10,6 +10,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_add.c', '../mips/test_msa_int_average.c', '../mips/test_msa_int_compare.c', + '../mips/test_msa_int_div_mod.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -35,14 +36,6 @@ if 'qemu-mips' in emulators endif tests_mips_msa = [ - '../mips/user/ase/msa/int-modulo/test_msa_mod_s_b.c', - '../mips/user/ase/msa/int-modulo/test_msa_mod_u_d.c', - '../mips/user/ase/msa/int-modulo/test_msa_mod_s_d.c', - '../mips/user/ase/msa/int-modulo/test_msa_mod_s_w.c', - '../mips/user/ase/msa/int-modulo/test_msa_mod_s_h.c', - '../mips/user/ase/msa/int-modulo/test_msa_mod_u_b.c', - '../mips/user/ase/msa/int-modulo/test_msa_mod_u_h.c', - '../mips/user/ase/msa/int-modulo/test_msa_mod_u_w.c', '../mips/user/ase/msa/int-subtract/test_msa_asub_s_w.c', '../mips/user/ase/msa/int-subtract/test_msa_hsub_u_d.c', '../mips/user/ase/msa/int-subtract/test_msa_hsub_s_w.c',
@@ -89,14 +82,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/int-multiply/test_msa_mulv_h.c', '../mips/user/ase/msa/int-multiply/test_msa_mulv_d.c', '../mips/user/ase/msa/int-multiply/test_msa_maddv_h.c', - '../mips/user/ase/msa/int-divide/test_msa_div_s_b.c', - '../mips/user/ase/msa/int-divide/test_msa_div_u_b.c', - '../mips/user/ase/msa/int-divide/test_msa_div_s_d.c', - '../mips/user/ase/msa/int-divide/test_msa_div_s_h.c', - '../mips/user/ase/msa/int-divide/test_msa_div_s_w.c', - '../mips/user/ase/msa/int-divide/test_msa_div_u_w.c', - '../mips/user/ase/msa/int-divide/test_msa_div_u_h.c', - '../mips/user/ase/msa/int-divide/test_msa_div_u_d.c', '../mips/user/ase/msa/interleave/test_msa_ilvr_b.c', '../mips/user/ase/msa/interleave/test_msa_ilvr_d.c', '../mips/user/ase/msa/interleave/test_msa_ilvod_b.c',
Signature · 1 line
2.55.0
PATCH v4 24/32 tests/tcg/mips: Group MSA int-dot-product tests
In reply to Philippe Mathieu-DaudéBuild the 18 per-opcode int-dot-product tests as a single executable, test_msa_int_dot_product.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_int_dot_product.c | 135 ++++++++++++++++++++++ tests/tcg/mips/meson.build | 19 +-- 2 files changed, 136 insertions(+), 18 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_dot_product.c
tests/tcg/mips/test_msa_int_dot_product.c new file +135 -0
@@ -0,0 +1,135 @@ +/* +* MIPS MSA tests: Int Dot Product instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_dotp_s_d +#include "user/ase/msa/int-dot-product/test_msa_dotp_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dotp_s_h +#include "user/ase/msa/int-dot-product/test_msa_dotp_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dotp_s_w +#include "user/ase/msa/int-dot-product/test_msa_dotp_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dotp_u_d +#include "user/ase/msa/int-dot-product/test_msa_dotp_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dotp_u_h +#include "user/ase/msa/int-dot-product/test_msa_dotp_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dotp_u_w +#include "user/ase/msa/int-dot-product/test_msa_dotp_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpadd_s_d +#include "user/ase/msa/int-dot-product/test_msa_dpadd_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpadd_s_h +#include "user/ase/msa/int-dot-product/test_msa_dpadd_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpadd_s_w +#include "user/ase/msa/int-dot-product/test_msa_dpadd_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpadd_u_d +#include "user/ase/msa/int-dot-product/test_msa_dpadd_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpadd_u_h +#include "user/ase/msa/int-dot-product/test_msa_dpadd_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpadd_u_w +#include "user/ase/msa/int-dot-product/test_msa_dpadd_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpsub_s_d +#include "user/ase/msa/int-dot-product/test_msa_dpsub_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpsub_s_h +#include "user/ase/msa/int-dot-product/test_msa_dpsub_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpsub_s_w +#include "user/ase/msa/int-dot-product/test_msa_dpsub_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpsub_u_d +#include "user/ase/msa/int-dot-product/test_msa_dpsub_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpsub_u_h +#include "user/ase/msa/int-dot-product/test_msa_dpsub_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_dpsub_u_w +#include "user/ase/msa/int-dot-product/test_msa_dpsub_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"dotp.s.d" , test_msa_dotp_s_d }, + {"dotp.s.h" , test_msa_dotp_s_h }, + {"dotp.s.w" , test_msa_dotp_s_w }, + {"dotp.u.d" , test_msa_dotp_u_d }, + {"dotp.u.h" , test_msa_dotp_u_h }, + {"dotp.u.w" , test_msa_dotp_u_w }, + {"dpadd.s.d" , test_msa_dpadd_s_d }, + {"dpadd.s.h" , test_msa_dpadd_s_h }, + {"dpadd.s.w" , test_msa_dpadd_s_w }, + {"dpadd.u.d" , test_msa_dpadd_u_d }, + {"dpadd.u.h" , test_msa_dpadd_u_h }, + {"dpadd.u.w" , test_msa_dpadd_u_w }, + {"dpsub.s.d" , test_msa_dpsub_s_d }, + {"dpsub.s.h" , test_msa_dpsub_s_h }, + {"dpsub.s.w" , test_msa_dpsub_s_w }, + {"dpsub.u.d" , test_msa_dpsub_u_d }, + {"dpsub.u.h" , test_msa_dpsub_u_h }, + {"dpsub.u.w" , test_msa_dpsub_u_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Int Dot Product" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -18
@@ -11,6 +11,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_average.c', '../mips/test_msa_int_compare.c', '../mips/test_msa_int_div_mod.c', + '../mips/test_msa_int_dot_product.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -159,22 +160,4 @@ tests_mips_msa = [ '../mips/user/ase/msa/int-max-min/test_msa_min_s_b.c', '../mips/user/ase/msa/int-max-min/test_msa_min_u_w.c', '../mips/user/ase/msa/int-max-min/test_msa_max_u_w.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_h.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_h.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_w.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_w.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpadd_s_d.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_d.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dotp_s_h.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dotp_u_h.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dotp_s_d.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_h.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_d.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_s_h.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpadd_u_w.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dotp_s_w.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dotp_u_d.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_d.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dpsub_u_w.c', - '../mips/user/ase/msa/int-dot-product/test_msa_dotp_u_w.c', ]
Signature · 1 line
2.55.0
PATCH v4 25/32 tests/tcg/mips: Group MSA int-max-min tests
In reply to Philippe Mathieu-DaudéBuild the 24 per-opcode int-max-min tests as a single executable, test_msa_int_max_min.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_int_max_min.c | 171 ++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 25 +--- 2 files changed, 172 insertions(+), 24 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_max_min.c
tests/tcg/mips/test_msa_int_max_min.c new file +171 -0
@@ -0,0 +1,171 @@ +/* +* MIPS MSA tests: Int Min / Max instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_max_a_b +#include "user/ase/msa/int-max-min/test_msa_max_a_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_a_d +#include "user/ase/msa/int-max-min/test_msa_max_a_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_a_h +#include "user/ase/msa/int-max-min/test_msa_max_a_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_a_w +#include "user/ase/msa/int-max-min/test_msa_max_a_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_s_b +#include "user/ase/msa/int-max-min/test_msa_max_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_s_d +#include "user/ase/msa/int-max-min/test_msa_max_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_s_h +#include "user/ase/msa/int-max-min/test_msa_max_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_s_w +#include "user/ase/msa/int-max-min/test_msa_max_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_u_b +#include "user/ase/msa/int-max-min/test_msa_max_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_u_d +#include "user/ase/msa/int-max-min/test_msa_max_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_u_h +#include "user/ase/msa/int-max-min/test_msa_max_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_max_u_w +#include "user/ase/msa/int-max-min/test_msa_max_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_a_b +#include "user/ase/msa/int-max-min/test_msa_min_a_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_a_d +#include "user/ase/msa/int-max-min/test_msa_min_a_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_a_h +#include "user/ase/msa/int-max-min/test_msa_min_a_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_a_w +#include "user/ase/msa/int-max-min/test_msa_min_a_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_s_b +#include "user/ase/msa/int-max-min/test_msa_min_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_s_d +#include "user/ase/msa/int-max-min/test_msa_min_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_s_h +#include "user/ase/msa/int-max-min/test_msa_min_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_s_w +#include "user/ase/msa/int-max-min/test_msa_min_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_u_b +#include "user/ase/msa/int-max-min/test_msa_min_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_u_d +#include "user/ase/msa/int-max-min/test_msa_min_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_u_h +#include "user/ase/msa/int-max-min/test_msa_min_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_min_u_w +#include "user/ase/msa/int-max-min/test_msa_min_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"max.a.b" , test_msa_max_a_b }, + {"max.a.d" , test_msa_max_a_d }, + {"max.a.h" , test_msa_max_a_h }, + {"max.a.w" , test_msa_max_a_w }, + {"max.s.b" , test_msa_max_s_b }, + {"max.s.d" , test_msa_max_s_d }, + {"max.s.h" , test_msa_max_s_h }, + {"max.s.w" , test_msa_max_s_w }, + {"max.u.b" , test_msa_max_u_b }, + {"max.u.d" , test_msa_max_u_d }, + {"max.u.h" , test_msa_max_u_h }, + {"max.u.w" , test_msa_max_u_w }, + {"min.a.b" , test_msa_min_a_b }, + {"min.a.d" , test_msa_min_a_d }, + {"min.a.h" , test_msa_min_a_h }, + {"min.a.w" , test_msa_min_a_w }, + {"min.s.b" , test_msa_min_s_b }, + {"min.s.d" , test_msa_min_s_d }, + {"min.s.h" , test_msa_min_s_h }, + {"min.s.w" , test_msa_min_s_w }, + {"min.u.b" , test_msa_min_u_b }, + {"min.u.d" , test_msa_min_u_d }, + {"min.u.h" , test_msa_min_u_h }, + {"min.u.w" , test_msa_min_u_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Int Max Min" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -24
@@ -12,6 +12,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_compare.c', '../mips/test_msa_int_div_mod.c', '../mips/test_msa_int_dot_product.c', + '../mips/test_msa_int_max_min.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -136,28 +137,4 @@ tests_mips_msa = [ '../mips/user/ase/msa/logic/test_msa_and_v.c', '../mips/user/ase/msa/logic/test_msa_xor_v.c', '../mips/user/ase/msa/move/test_msa_move_v.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_u_h.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_a_b.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_s_b.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_a_w.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_s_w.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_s_h.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_u_h.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_a_b.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_a_d.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_u_d.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_u_d.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_u_b.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_s_d.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_a_d.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_a_h.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_a_w.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_s_d.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_u_b.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_s_w.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_a_h.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_s_h.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_s_b.c', - '../mips/user/ase/msa/int-max-min/test_msa_min_u_w.c', - '../mips/user/ase/msa/int-max-min/test_msa_max_u_w.c', ]
Signature · 1 line
2.55.0
PATCH v4 26/32 tests/tcg/mips: Group MSA int-multiply tests
In reply to Philippe Mathieu-DaudéBuild the 12 per-opcode int-multiply tests as a single executable, test_msa_int_multiply.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_int_multiply.c | 99 ++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 13 +--- 2 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_multiply.c
tests/tcg/mips/test_msa_int_multiply.c new file +99 -0
@@ -0,0 +1,99 @@ +/* +* MIPS MSA tests: Int Multiply instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_maddv_b +#include "user/ase/msa/int-multiply/test_msa_maddv_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_maddv_d +#include "user/ase/msa/int-multiply/test_msa_maddv_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_maddv_h +#include "user/ase/msa/int-multiply/test_msa_maddv_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_maddv_w +#include "user/ase/msa/int-multiply/test_msa_maddv_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_msubv_b +#include "user/ase/msa/int-multiply/test_msa_msubv_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_msubv_d +#include "user/ase/msa/int-multiply/test_msa_msubv_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_msubv_h +#include "user/ase/msa/int-multiply/test_msa_msubv_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_msubv_w +#include "user/ase/msa/int-multiply/test_msa_msubv_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mulv_b +#include "user/ase/msa/int-multiply/test_msa_mulv_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mulv_d +#include "user/ase/msa/int-multiply/test_msa_mulv_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mulv_h +#include "user/ase/msa/int-multiply/test_msa_mulv_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_mulv_w +#include "user/ase/msa/int-multiply/test_msa_mulv_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"maddv.b" , test_msa_maddv_b }, + {"maddv.d" , test_msa_maddv_d }, + {"maddv.h" , test_msa_maddv_h }, + {"maddv.w" , test_msa_maddv_w }, + {"msubv.b" , test_msa_msubv_b }, + {"msubv.d" , test_msa_msubv_d }, + {"msubv.h" , test_msa_msubv_h }, + {"msubv.w" , test_msa_msubv_w }, + {"mulv.b" , test_msa_mulv_b }, + {"mulv.d" , test_msa_mulv_d }, + {"mulv.h" , test_msa_mulv_h }, + {"mulv.w" , test_msa_mulv_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Int Multiply" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -12
@@ -13,6 +13,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_div_mod.c', '../mips/test_msa_int_dot_product.c', '../mips/test_msa_int_max_min.c', + '../mips/test_msa_int_multiply.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -72,18 +73,6 @@ tests_mips_msa = [ '../mips/user/ase/msa/int-subtract/test_msa_asub_u_h.c', '../mips/user/ase/msa/int-subtract/test_msa_asub_s_b.c', '../mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c', - '../mips/user/ase/msa/int-multiply/test_msa_mulv_w.c', - '../mips/user/ase/msa/int-multiply/test_msa_msubv_d.c', - '../mips/user/ase/msa/int-multiply/test_msa_msubv_h.c', - '../mips/user/ase/msa/int-multiply/test_msa_maddv_w.c', - '../mips/user/ase/msa/int-multiply/test_msa_msubv_b.c', - '../mips/user/ase/msa/int-multiply/test_msa_mulv_b.c', - '../mips/user/ase/msa/int-multiply/test_msa_maddv_d.c', - '../mips/user/ase/msa/int-multiply/test_msa_msubv_w.c', - '../mips/user/ase/msa/int-multiply/test_msa_maddv_b.c', - '../mips/user/ase/msa/int-multiply/test_msa_mulv_h.c', - '../mips/user/ase/msa/int-multiply/test_msa_mulv_d.c', - '../mips/user/ase/msa/int-multiply/test_msa_maddv_h.c', '../mips/user/ase/msa/interleave/test_msa_ilvr_b.c', '../mips/user/ase/msa/interleave/test_msa_ilvr_d.c', '../mips/user/ase/msa/interleave/test_msa_ilvod_b.c',
Signature · 1 line
2.55.0
PATCH v4 27/32 tests/tcg/mips: Group MSA int-subtract tests
In reply to Philippe Mathieu-DaudéBuild the 34 per-opcode int-subtract tests as a single executable, test_msa_int_subtract.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_int_subtract.c | 231 +++++++++++++++++++++++++ tests/tcg/mips/meson.build | 35 +--- 2 files changed, 232 insertions(+), 34 deletions(-) create mode 100644 tests/tcg/mips/test_msa_int_subtract.c
tests/tcg/mips/test_msa_int_subtract.c new file +231 -0
@@ -0,0 +1,231 @@ +/* +* MIPS MSA tests: Int Subtract instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_asub_s_b +#include "user/ase/msa/int-subtract/test_msa_asub_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_asub_s_d +#include "user/ase/msa/int-subtract/test_msa_asub_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_asub_s_h +#include "user/ase/msa/int-subtract/test_msa_asub_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_asub_s_w +#include "user/ase/msa/int-subtract/test_msa_asub_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_asub_u_b +#include "user/ase/msa/int-subtract/test_msa_asub_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_asub_u_d +#include "user/ase/msa/int-subtract/test_msa_asub_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_asub_u_h +#include "user/ase/msa/int-subtract/test_msa_asub_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_asub_u_w +#include "user/ase/msa/int-subtract/test_msa_asub_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hsub_s_d +#include "user/ase/msa/int-subtract/test_msa_hsub_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hsub_s_h +#include "user/ase/msa/int-subtract/test_msa_hsub_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hsub_s_w +#include "user/ase/msa/int-subtract/test_msa_hsub_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hsub_u_d +#include "user/ase/msa/int-subtract/test_msa_hsub_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hsub_u_h +#include "user/ase/msa/int-subtract/test_msa_hsub_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_hsub_u_w +#include "user/ase/msa/int-subtract/test_msa_hsub_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subs_s_b +#include "user/ase/msa/int-subtract/test_msa_subs_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subs_s_d +#include "user/ase/msa/int-subtract/test_msa_subs_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subs_s_h +#include "user/ase/msa/int-subtract/test_msa_subs_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subs_s_w +#include "user/ase/msa/int-subtract/test_msa_subs_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subs_u_b +#include "user/ase/msa/int-subtract/test_msa_subs_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subs_u_d +#include "user/ase/msa/int-subtract/test_msa_subs_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subs_u_h +#include "user/ase/msa/int-subtract/test_msa_subs_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subs_u_w +#include "user/ase/msa/int-subtract/test_msa_subs_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subsus_u_b +#include "user/ase/msa/int-subtract/test_msa_subsus_u_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subsus_u_d +#include "user/ase/msa/int-subtract/test_msa_subsus_u_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subsus_u_h +#include "user/ase/msa/int-subtract/test_msa_subsus_u_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subsus_u_w +#include "user/ase/msa/int-subtract/test_msa_subsus_u_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subsuu_s_b +#include "user/ase/msa/int-subtract/test_msa_subsuu_s_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subsuu_s_d +#include "user/ase/msa/int-subtract/test_msa_subsuu_s_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subsuu_s_h +#include "user/ase/msa/int-subtract/test_msa_subsuu_s_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subsuu_s_w +#include "user/ase/msa/int-subtract/test_msa_subsuu_s_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subv_b +#include "user/ase/msa/int-subtract/test_msa_subv_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subv_d +#include "user/ase/msa/int-subtract/test_msa_subv_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subv_h +#include "user/ase/msa/int-subtract/test_msa_subv_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_subv_w +#include "user/ase/msa/int-subtract/test_msa_subv_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"asub.s.b" , test_msa_asub_s_b }, + {"asub.s.d" , test_msa_asub_s_d }, + {"asub.s.h" , test_msa_asub_s_h }, + {"asub.s.w" , test_msa_asub_s_w }, + {"asub.u.b" , test_msa_asub_u_b }, + {"asub.u.d" , test_msa_asub_u_d }, + {"asub.u.h" , test_msa_asub_u_h }, + {"asub.u.w" , test_msa_asub_u_w }, + {"hsub.s.d" , test_msa_hsub_s_d }, + {"hsub.s.h" , test_msa_hsub_s_h }, + {"hsub.s.w" , test_msa_hsub_s_w }, + {"hsub.u.d" , test_msa_hsub_u_d }, + {"hsub.u.h" , test_msa_hsub_u_h }, + {"hsub.u.w" , test_msa_hsub_u_w }, + {"subs.s.b" , test_msa_subs_s_b }, + {"subs.s.d" , test_msa_subs_s_d }, + {"subs.s.h" , test_msa_subs_s_h }, + {"subs.s.w" , test_msa_subs_s_w }, + {"subs.u.b" , test_msa_subs_u_b }, + {"subs.u.d" , test_msa_subs_u_d }, + {"subs.u.h" , test_msa_subs_u_h }, + {"subs.u.w" , test_msa_subs_u_w }, + {"subsus.u.b" , test_msa_subsus_u_b }, + {"subsus.u.d" , test_msa_subsus_u_d }, + {"subsus.u.h" , test_msa_subsus_u_h }, + {"subsus.u.w" , test_msa_subsus_u_w }, + {"subsuu.s.b" , test_msa_subsuu_s_b }, + {"subsuu.s.d" , test_msa_subsuu_s_d }, + {"subsuu.s.h" , test_msa_subsuu_s_h }, + {"subsuu.s.w" , test_msa_subsuu_s_w }, + {"subv.b" , test_msa_subv_b }, + {"subv.d" , test_msa_subv_d }, + {"subv.h" , test_msa_subv_h }, + {"subv.w" , test_msa_subv_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Int Subtract" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -34
@@ -14,6 +14,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_dot_product.c', '../mips/test_msa_int_max_min.c', '../mips/test_msa_int_multiply.c', + '../mips/test_msa_int_subtract.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -39,40 +40,6 @@ if 'qemu-mips' in emulators endif tests_mips_msa = [ - '../mips/user/ase/msa/int-subtract/test_msa_asub_s_w.c', - '../mips/user/ase/msa/int-subtract/test_msa_hsub_u_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_hsub_s_w.c', - '../mips/user/ase/msa/int-subtract/test_msa_asub_u_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_asub_u_b.c', - '../mips/user/ase/msa/int-subtract/test_msa_asub_u_w.c', - '../mips/user/ase/msa/int-subtract/test_msa_subsuu_s_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_asub_s_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_subsus_u_w.c', - '../mips/user/ase/msa/int-subtract/test_msa_subsus_u_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_subs_s_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_subs_u_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_hsub_s_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_asub_s_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_subv_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_subs_s_b.c', - '../mips/user/ase/msa/int-subtract/test_msa_subs_u_w.c', - '../mips/user/ase/msa/int-subtract/test_msa_subv_w.c', - '../mips/user/ase/msa/int-subtract/test_msa_subsuu_s_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_subv_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_hsub_s_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_subv_b.c', - '../mips/user/ase/msa/int-subtract/test_msa_subsuu_s_b.c', - '../mips/user/ase/msa/int-subtract/test_msa_subs_u_b.c', - '../mips/user/ase/msa/int-subtract/test_msa_hsub_u_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_subs_s_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_subs_u_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_hsub_u_w.c', - '../mips/user/ase/msa/int-subtract/test_msa_subsus_u_b.c', - '../mips/user/ase/msa/int-subtract/test_msa_subsuu_s_w.c', - '../mips/user/ase/msa/int-subtract/test_msa_subsus_u_d.c', - '../mips/user/ase/msa/int-subtract/test_msa_asub_u_h.c', - '../mips/user/ase/msa/int-subtract/test_msa_asub_s_b.c', - '../mips/user/ase/msa/int-subtract/test_msa_subs_s_w.c', '../mips/user/ase/msa/interleave/test_msa_ilvr_b.c', '../mips/user/ase/msa/interleave/test_msa_ilvr_d.c', '../mips/user/ase/msa/interleave/test_msa_ilvod_b.c',
Signature · 1 line
2.55.0
PATCH v4 28/32 tests/tcg/mips: Group MSA interleave tests
In reply to Philippe Mathieu-DaudéBuild the 16 per-opcode interleave tests as a single executable, test_msa_interleave.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_interleave.c | 123 +++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 17 +--- 2 files changed, 124 insertions(+), 16 deletions(-) create mode 100644 tests/tcg/mips/test_msa_interleave.c
tests/tcg/mips/test_msa_interleave.c new file +123 -0
@@ -0,0 +1,123 @@ +/* +* MIPS MSA tests: Interleave instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_ilvev_b +#include "user/ase/msa/interleave/test_msa_ilvev_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvev_d +#include "user/ase/msa/interleave/test_msa_ilvev_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvev_h +#include "user/ase/msa/interleave/test_msa_ilvev_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvev_w +#include "user/ase/msa/interleave/test_msa_ilvev_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvl_b +#include "user/ase/msa/interleave/test_msa_ilvl_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvl_d +#include "user/ase/msa/interleave/test_msa_ilvl_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvl_h +#include "user/ase/msa/interleave/test_msa_ilvl_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvl_w +#include "user/ase/msa/interleave/test_msa_ilvl_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvod_b +#include "user/ase/msa/interleave/test_msa_ilvod_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvod_d +#include "user/ase/msa/interleave/test_msa_ilvod_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvod_h +#include "user/ase/msa/interleave/test_msa_ilvod_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvod_w +#include "user/ase/msa/interleave/test_msa_ilvod_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvr_b +#include "user/ase/msa/interleave/test_msa_ilvr_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvr_d +#include "user/ase/msa/interleave/test_msa_ilvr_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvr_h +#include "user/ase/msa/interleave/test_msa_ilvr_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_ilvr_w +#include "user/ase/msa/interleave/test_msa_ilvr_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"ilvev.b" , test_msa_ilvev_b }, + {"ilvev.d" , test_msa_ilvev_d }, + {"ilvev.h" , test_msa_ilvev_h }, + {"ilvev.w" , test_msa_ilvev_w }, + {"ilvl.b" , test_msa_ilvl_b }, + {"ilvl.d" , test_msa_ilvl_d }, + {"ilvl.h" , test_msa_ilvl_h }, + {"ilvl.w" , test_msa_ilvl_w }, + {"ilvod.b" , test_msa_ilvod_b }, + {"ilvod.d" , test_msa_ilvod_d }, + {"ilvod.h" , test_msa_ilvod_h }, + {"ilvod.w" , test_msa_ilvod_w }, + {"ilvr.b" , test_msa_ilvr_b }, + {"ilvr.d" , test_msa_ilvr_d }, + {"ilvr.h" , test_msa_ilvr_h }, + {"ilvr.w" , test_msa_ilvr_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Interleave" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -16
@@ -15,6 +15,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_max_min.c', '../mips/test_msa_int_multiply.c', '../mips/test_msa_int_subtract.c', + '../mips/test_msa_interleave.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -40,22 +41,6 @@ if 'qemu-mips' in emulators endif tests_mips_msa = [ - '../mips/user/ase/msa/interleave/test_msa_ilvr_b.c', - '../mips/user/ase/msa/interleave/test_msa_ilvr_d.c', - '../mips/user/ase/msa/interleave/test_msa_ilvod_b.c', - '../mips/user/ase/msa/interleave/test_msa_ilvl_b.c', - '../mips/user/ase/msa/interleave/test_msa_ilvev_w.c', - '../mips/user/ase/msa/interleave/test_msa_ilvr_w.c', - '../mips/user/ase/msa/interleave/test_msa_ilvr_h.c', - '../mips/user/ase/msa/interleave/test_msa_ilvev_h.c', - '../mips/user/ase/msa/interleave/test_msa_ilvev_b.c', - '../mips/user/ase/msa/interleave/test_msa_ilvod_w.c', - '../mips/user/ase/msa/interleave/test_msa_ilvev_d.c', - '../mips/user/ase/msa/interleave/test_msa_ilvl_d.c', - '../mips/user/ase/msa/interleave/test_msa_ilvod_d.c', - '../mips/user/ase/msa/interleave/test_msa_ilvl_h.c', - '../mips/user/ase/msa/interleave/test_msa_ilvl_w.c', - '../mips/user/ase/msa/interleave/test_msa_ilvod_h.c', '../mips/user/ase/msa/pack/test_msa_vshf_b.c', '../mips/user/ase/msa/pack/test_msa_pckev_b.c', '../mips/user/ase/msa/pack/test_msa_vshf_w.c',
Signature · 1 line
2.55.0
PATCH v4 29/32 tests/tcg/mips: Group MSA logic tests
In reply to Philippe Mathieu-DaudéBuild the 5 per-opcode logic tests as a single executable, test_msa_logic.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_logic.c | 57 +++++++++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 6 +--- 2 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 tests/tcg/mips/test_msa_logic.c
tests/tcg/mips/test_msa_logic.c new file +57 -0
@@ -0,0 +1,57 @@ +/* +* MIPS MSA tests: Logic and Move instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_and_v +#include "user/ase/msa/logic/test_msa_and_v.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_nor_v +#include "user/ase/msa/logic/test_msa_nor_v.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_or_v +#include "user/ase/msa/logic/test_msa_or_v.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_xor_v +#include "user/ase/msa/logic/test_msa_xor_v.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_move_v +#include "user/ase/msa/move/test_msa_move_v.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"and.v" , test_msa_and_v }, + {"nor.v" , test_msa_nor_v }, + {"or.v" , test_msa_or_v }, + {"xor.v" , test_msa_xor_v }, + {"move.v" , test_msa_move_v }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Logic and Move" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -5
@@ -16,6 +16,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_multiply.c', '../mips/test_msa_int_subtract.c', '../mips/test_msa_interleave.c', + '../mips/test_msa_logic.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -73,9 +74,4 @@ tests_mips_msa = [ '../mips/user/ase/msa/shift/test_msa_srar_w.c', '../mips/user/ase/msa/shift/test_msa_srlr_b.c', '../mips/user/ase/msa/shift/test_msa_srlr_w.c', - '../mips/user/ase/msa/logic/test_msa_or_v.c', - '../mips/user/ase/msa/logic/test_msa_nor_v.c', - '../mips/user/ase/msa/logic/test_msa_and_v.c', - '../mips/user/ase/msa/logic/test_msa_xor_v.c', - '../mips/user/ase/msa/move/test_msa_move_v.c', ]
Signature · 1 line
2.55.0
PATCH v4 30/32 tests/tcg/mips: Group MSA pack tests
In reply to Philippe Mathieu-DaudéBuild the 12 per-opcode pack tests as a single executable, test_msa_pack.c, to reduce the number of test binaries. Each opcode reports one TAP line.
--- tests/tcg/mips/test_msa_pack.c | 99 ++++++++++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 13 +---- 2 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 tests/tcg/mips/test_msa_pack.c
tests/tcg/mips/test_msa_pack.c new file +99 -0
@@ -0,0 +1,99 @@ +/* +* MIPS MSA tests: Pack instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_pckev_b +#include "user/ase/msa/pack/test_msa_pckev_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_pckev_d +#include "user/ase/msa/pack/test_msa_pckev_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_pckev_h +#include "user/ase/msa/pack/test_msa_pckev_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_pckev_w +#include "user/ase/msa/pack/test_msa_pckev_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_pckod_b +#include "user/ase/msa/pack/test_msa_pckod_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_pckod_d +#include "user/ase/msa/pack/test_msa_pckod_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_pckod_h +#include "user/ase/msa/pack/test_msa_pckod_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_pckod_w +#include "user/ase/msa/pack/test_msa_pckod_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_vshf_b +#include "user/ase/msa/pack/test_msa_vshf_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_vshf_d +#include "user/ase/msa/pack/test_msa_vshf_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_vshf_h +#include "user/ase/msa/pack/test_msa_vshf_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_vshf_w +#include "user/ase/msa/pack/test_msa_vshf_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"pckev.b" , test_msa_pckev_b }, + {"pckev.d" , test_msa_pckev_d }, + {"pckev.h" , test_msa_pckev_h }, + {"pckev.w" , test_msa_pckev_w }, + {"pckod.b" , test_msa_pckod_b }, + {"pckod.d" , test_msa_pckod_d }, + {"pckod.h" , test_msa_pckod_h }, + {"pckod.w" , test_msa_pckod_w }, + {"vshf.b" , test_msa_vshf_b }, + {"vshf.d" , test_msa_vshf_d }, + {"vshf.h" , test_msa_vshf_h }, + {"vshf.w" , test_msa_vshf_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Pack" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -12
@@ -17,6 +17,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_subtract.c', '../mips/test_msa_interleave.c', '../mips/test_msa_logic.c', + '../mips/test_msa_pack.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -42,18 +43,6 @@ if 'qemu-mips' in emulators endif tests_mips_msa = [ - '../mips/user/ase/msa/pack/test_msa_vshf_b.c', - '../mips/user/ase/msa/pack/test_msa_pckev_b.c', - '../mips/user/ase/msa/pack/test_msa_vshf_w.c', - '../mips/user/ase/msa/pack/test_msa_pckod_h.c', - '../mips/user/ase/msa/pack/test_msa_pckod_b.c', - '../mips/user/ase/msa/pack/test_msa_vshf_d.c', - '../mips/user/ase/msa/pack/test_msa_pckev_w.c', - '../mips/user/ase/msa/pack/test_msa_pckev_h.c', - '../mips/user/ase/msa/pack/test_msa_pckev_d.c', - '../mips/user/ase/msa/pack/test_msa_pckod_w.c', - '../mips/user/ase/msa/pack/test_msa_vshf_h.c', - '../mips/user/ase/msa/pack/test_msa_pckod_d.c', '../mips/user/ase/msa/shift/test_msa_sra_d.c', '../mips/user/ase/msa/shift/test_msa_srl_b.c', '../mips/user/ase/msa/shift/test_msa_srl_d.c',
Signature · 1 line
2.55.0
PATCH v4 31/32 tests/tcg/mips: Group MSA shift tests
In reply to Philippe Mathieu-DaudéBuild the 20 per-opcode shift tests as a single executable, test_msa_shift.c, to reduce the number of test binaries. Each opcode reports one TAP line.
All MSA tests now emit TAP: select it in the meson setup.
--- tests/tcg/mips/test_msa_shift.c | 147 ++++++++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 24 +----- tests/tcg/mips64/meson.build | 3 +- tests/tcg/mipsel/meson.build | 3 +- 4 files changed, 152 insertions(+), 25 deletions(-) create mode 100644 tests/tcg/mips/test_msa_shift.c
tests/tcg/mips/test_msa_shift.c new file +147 -0
@@ -0,0 +1,147 @@ +/* +* MIPS MSA tests: Shift instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "../include/tap.h" + +#define main test_msa_sll_b +#include "user/ase/msa/shift/test_msa_sll_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_sll_d +#include "user/ase/msa/shift/test_msa_sll_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_sll_h +#include "user/ase/msa/shift/test_msa_sll_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_sll_w +#include "user/ase/msa/shift/test_msa_sll_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_sra_b +#include "user/ase/msa/shift/test_msa_sra_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_sra_d +#include "user/ase/msa/shift/test_msa_sra_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_sra_h +#include "user/ase/msa/shift/test_msa_sra_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_sra_w +#include "user/ase/msa/shift/test_msa_sra_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srar_b +#include "user/ase/msa/shift/test_msa_srar_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srar_d +#include "user/ase/msa/shift/test_msa_srar_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srar_h +#include "user/ase/msa/shift/test_msa_srar_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srar_w +#include "user/ase/msa/shift/test_msa_srar_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srl_b +#include "user/ase/msa/shift/test_msa_srl_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srl_d +#include "user/ase/msa/shift/test_msa_srl_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srl_h +#include "user/ase/msa/shift/test_msa_srl_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srl_w +#include "user/ase/msa/shift/test_msa_srl_w.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srlr_b +#include "user/ase/msa/shift/test_msa_srlr_b.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srlr_d +#include "user/ase/msa/shift/test_msa_srlr_d.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srlr_h +#include "user/ase/msa/shift/test_msa_srlr_h.c" +#undef main +#undef TEST_COUNT_TOTAL + +#define main test_msa_srlr_w +#include "user/ase/msa/shift/test_msa_srlr_w.c" +#undef main +#undef TEST_COUNT_TOTAL + + +static const struct { +const char *name; +int32_t (*fn)(void ); +} msa_tests[] = { + {"sll.b" , test_msa_sll_b }, + {"sll.d" , test_msa_sll_d }, + {"sll.h" , test_msa_sll_h }, + {"sll.w" , test_msa_sll_w }, + {"sra.b" , test_msa_sra_b }, + {"sra.d" , test_msa_sra_d }, + {"sra.h" , test_msa_sra_h }, + {"sra.w" , test_msa_sra_w }, + {"srar.b" , test_msa_srar_b }, + {"srar.d" , test_msa_srar_d }, + {"srar.h" , test_msa_srar_h }, + {"srar.w" , test_msa_srar_w }, + {"srl.b" , test_msa_srl_b }, + {"srl.d" , test_msa_srl_d }, + {"srl.h" , test_msa_srl_h }, + {"srl.w" , test_msa_srl_w }, + {"srlr.b" , test_msa_srlr_b }, + {"srlr.d" , test_msa_srlr_d }, + {"srlr.h" , test_msa_srlr_h }, + {"srlr.w" , test_msa_srlr_w }, +}; + +int main (void ) +{ +unsigned i; + +TAP_START (); +for (i =0 ; i <sizeof (msa_tests) /sizeof (msa_tests[0 ]); i++) { +tap_report (!msa_tests[i].fn (),"MSA %s %s" , +"Shift" , msa_tests[i].name); + } + +return tap_done (); +}
tests/tcg/mips/meson.build +1 -23
@@ -18,6 +18,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_interleave.c', '../mips/test_msa_logic.c', '../mips/test_msa_pack.c', + '../mips/test_msa_shift.c', ] tests += tcg_tests['multiarch-linux-user']['tests']
@@ -41,26 +42,3 @@ if 'qemu-mips' in emulators } } endif - -tests_mips_msa = [ - '../mips/user/ase/msa/shift/test_msa_sra_d.c', - '../mips/user/ase/msa/shift/test_msa_srl_b.c', - '../mips/user/ase/msa/shift/test_msa_srl_d.c', - '../mips/user/ase/msa/shift/test_msa_sll_b.c', - '../mips/user/ase/msa/shift/test_msa_sra_w.c', - '../mips/user/ase/msa/shift/test_msa_sra_h.c', - '../mips/user/ase/msa/shift/test_msa_srar_h.c', - '../mips/user/ase/msa/shift/test_msa_srlr_h.c', - '../mips/user/ase/msa/shift/test_msa_srl_h.c', - '../mips/user/ase/msa/shift/test_msa_sll_d.c', - '../mips/user/ase/msa/shift/test_msa_srl_w.c', - '../mips/user/ase/msa/shift/test_msa_srar_b.c', - '../mips/user/ase/msa/shift/test_msa_sll_w.c', - '../mips/user/ase/msa/shift/test_msa_sra_b.c', - '../mips/user/ase/msa/shift/test_msa_sll_h.c', - '../mips/user/ase/msa/shift/test_msa_srar_d.c', - '../mips/user/ase/msa/shift/test_msa_srlr_d.c', - '../mips/user/ase/msa/shift/test_msa_srar_w.c', - '../mips/user/ase/msa/shift/test_msa_srlr_b.c', - '../mips/user/ase/msa/shift/test_msa_srlr_w.c', -]
tests/tcg/mips64/meson.build +2 -1
@@ -39,11 +39,12 @@ foreach src: tests_mips64r6 tests += {src: {'cflags': '-march=mips64r6', 'protocol': 'tap'}} endforeach -foreach src: tests_mips_msa + tests_mips_msa_groups +foreach src: tests_mips_msa_groups tests += { src: { 'cflags': ['-march=mips64r6', '-mmsa'], 'qemu_args': ['-cpu', 'I6400'], + 'protocol': 'tap', } } endforeach
tests/tcg/mipsel/meson.build +2 -1
@@ -40,12 +40,13 @@ endif tests = [] -foreach src: tests_mips_msa + tests_mips_msa_groups +foreach src: tests_mips_msa_groups tests += { src: { 'cflags': ['-mabi=32', '-march=mips32r5', '-mmsa', '-mno-odd-spreg', '-mfp64', '-mnan=2008'], 'qemu_args': ['-cpu', 'P5600'], + 'protocol': 'tap', } } endforeach
Signature · 1 line
2.55.0
PATCH v4 32/32 tests/tcg/mips: Add MSA load/store tests
In reply to Philippe Mathieu-DaudéAdd coverage for the MSA LD/ST.B/H/W/D instructions at every source and destination byte offset within a vector-sized block, including accesses that cross a page boundary. Verify per-element endian ordering, destination contents, and source register preservation.
Test both little-endian (P5600, MIPS32R5) and big-endian (I6400, MIPS64R6).
AI-used-for: tests
---
Since this is a TCG test ran under linux-user, ignore checkpatch:
ERROR: use qemu_real_host_page_size() instead of sysconf(_SC_PAGESIZE) #138: FILE: tests/tcg/mips/test_msa_load_store.c:110:
+ long page_size = sysconf(_SC_PAGESIZE);
--- tests/tcg/mips/test_msa_load_store.c | 168 +++++++++++++++++++++++++++ tests/tcg/mips/meson.build | 1 + 2 files changed, 169 insertions(+) create mode 100644 tests/tcg/mips/test_msa_load_store.c
tests/tcg/mips/test_msa_load_store.c new file +168 -0
@@ -0,0 +1,168 @@ +/* +* MIPS MSA tests: Load / Store instructions +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include <errno.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <string.h> +#include <sys/mman.h> +#include <unistd.h> + +#include "../include/tap.h" + +enum { +VECTOR_BYTES =16 , +BUFFER_BYTES =64 , +}; + +#define DEFINE_MSA_COPY (format) \ +static void copy_##format(const uint8_t *source, uint8_t *destination, \ + uint8_t *loaded, uint8_t *after_store) \ +{ \ + __asm__ volatile( \ + "ld." #format " $w0, 0(%[source])\n\t" \ + "st.b $w0, 0(%[loaded])\n\t" \ + "st." #format " $w0, 0(%[destination])\n\t" \ + "st.b $w0, 0(%[after_store])\n\t" \ + : \ + : [source] "r" (source), [destination] "r" (destination), \ + [loaded] "r" (loaded), [after_store] "r" (after_store) \ + : "f0", "memory"); \ +} + +DEFINE_MSA_COPY (b) +DEFINE_MSA_COPY (h ) +DEFINE_MSA_COPY (w) +DEFINE_MSA_COPY (d) + +typedef void (*MsaCopy)(const uint8_t *source, uint8_t *destination, +uint8_t *loaded,uint8_t *after_store); + +static const struct { +const char *name; +unsigned element_bytes; +MsaCopy copy; +} formats[] = { + {"b" ,1 , copy_b }, + {"h" ,2 , copy_h }, + {"w" ,4 , copy_w }, + {"d" ,8 , copy_d }, +}; + +static bool check_format (size_t format_index,const uint8_t *source, +uint8_t *destination,size_t first_offset, +const char *region) +{ + _Alignas(VECTOR_BYTES )uint8_t loaded[VECTOR_BYTES ]; + _Alignas(VECTOR_BYTES )uint8_t after_store[VECTOR_BYTES ]; +uint8_t expected_vector[VECTOR_BYTES ]; +uint8_t expected_memory[BUFFER_BYTES ]; +const uint16_t endian_probe =1 ; +unsigned endian_mask = *(const uint8_t *)&endian_probe ?0 : + formats[format_index].element_bytes -1 ; + +for (size_t source_offset = first_offset; + source_offset < first_offset +VECTOR_BYTES ; source_offset++) { +for (size_t destination_offset = first_offset; + destination_offset < first_offset +VECTOR_BYTES ; + destination_offset++) { +memset (destination,0xa5 ,BUFFER_BYTES ); +memset (expected_memory,0xa5 ,BUFFER_BYTES ); +memcpy (expected_memory + destination_offset, + source + source_offset,VECTOR_BYTES ); + +for (size_t byte =0 ; byte <VECTOR_BYTES ; byte++) { + expected_vector[byte] = + source[source_offset + (byte ^ endian_mask)]; + } + + formats[format_index].copy (source + source_offset, + destination + destination_offset, + loaded, after_store); + +if (memcmp (loaded, expected_vector,VECTOR_BYTES )) { +TAP_INFO ("ld.%s endian mismatch (%s, offset %zu)" , + formats[format_index].name, region, source_offset); +return false; + } +if (memcmp (destination, expected_memory,BUFFER_BYTES )) { +TAP_INFO ("st.%s memory mismatch (%s, offset %zu)" , + formats[format_index].name, region, + destination_offset); +return false; + } +if (memcmp (after_store, loaded,VECTOR_BYTES )) { +TAP_INFO ("st.%s changed its source register (%s)" , + formats[format_index].name, region); +return false; + } + } + } + +return true; +} + +int main (void ) +{ + _Alignas(VECTOR_BYTES )uint8_t source[BUFFER_BYTES ]; + _Alignas(VECTOR_BYTES )uint8_t destination[BUFFER_BYTES ]; +long page_size =sysconf (_SC_PAGESIZE); +size_t mapping_bytes; +uint8_t *source_mapping; +uint8_t *destination_mapping; +uint8_t *page_source; +uint8_t *page_destination; + +TAP_START (); +if (page_size <BUFFER_BYTES ) { +TAP_INFO ("Invalid guest page size: %ld" , page_size); +tap_report (0 ,"MSA ld/st guest page size" ); +return tap_done (); + } + mapping_bytes =4 * (size_t )page_size; + source_mapping =mmap (NULL , mapping_bytes,PROT_NONE , +MAP_PRIVATE |MAP_ANONYMOUS ,-1 ,0 ); + destination_mapping =mmap (NULL , mapping_bytes,PROT_NONE , +MAP_PRIVATE |MAP_ANONYMOUS ,-1 ,0 ); +if (source_mapping ==MAP_FAILED || destination_mapping ==MAP_FAILED ) { +TAP_INFO ("mmap: %s" ,strerror (errno)); +tap_report (0 ,"MSA ld/st mmap" ); +return tap_done (); + } +if (mprotect (source_mapping + page_size,2 * page_size, +PROT_READ |PROT_WRITE ) !=0 || +mprotect (destination_mapping + page_size,2 * page_size, +PROT_READ |PROT_WRITE ) !=0 ) { +TAP_INFO ("mprotect: %s" ,strerror (errno)); +tap_report (0 ,"MSA ld/st mprotect" ); +return tap_done (); + } + + page_source = source_mapping +2 * page_size -BUFFER_BYTES /2 ; + page_destination = destination_mapping +2 * page_size -BUFFER_BYTES /2 ; +for (size_t byte =0 ; byte <BUFFER_BYTES ; byte++) { + source[byte] = page_source[byte] = byte *13 +7 ; + } + +for (size_t format_index =0 ; + format_index <sizeof (formats) /sizeof (formats[0 ]); format_index++) { +bool passed =check_format (format_index, source, destination,0 , +"buffer" ) && +check_format (format_index, page_source, page_destination, +VECTOR_BYTES ,"page boundary" ); + +tap_report (passed,"MSA ld/st.%s" , formats[format_index].name); + } + +if (munmap (source_mapping, mapping_bytes) !=0 || +munmap (destination_mapping, mapping_bytes) !=0 ) { +TAP_INFO ("munmap: %s" ,strerror (errno)); +tap_report (0 ,"MSA ld/st munmap" ); +return tap_done (); + } +return tap_done (); +}
tests/tcg/mips/meson.build +1 -0
@@ -16,6 +16,7 @@ tests_mips_msa_groups = [ '../mips/test_msa_int_multiply.c', '../mips/test_msa_int_subtract.c', '../mips/test_msa_interleave.c', + '../mips/test_msa_load_store.c', '../mips/test_msa_logic.c', '../mips/test_msa_pack.c', '../mips/test_msa_shift.c',
Signature · 1 line
2.55.0