Skip to contentSkip to conversation

tests/tcg: Massage MIPS tests for easier maintenance

PATCH Superseded Philippe Mathieu-Daudé 2 participants 34 messages Oct 30 Arm/Amlogic Meson SoC support

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover tests/tcg: Massage MIPS tests for easier maintenance

Series fully reviewed, will be included in next mips PR.

I'm glad we have many MIPS tests but they are in too many files, taking time to get compiled. In particular on Aarch64 host via x86_64 docker image... Group the test in order to reduce CI build time.

But per v1 review "We can't trade usability for faster compilation", so convert to run one test at a time -- not exiting on the first assert() -- and use TAP protocol to get integrated with meson. For example we can now list each opcode as a TAP subtest with:

  $ meson test --suite tcg-mipsel -v

Now as a maintainer I can relax a bit :)

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é (31):
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       |   2 +-
 tests/tcg/mips/include/test_utils_64.h        |   6 +-
 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          | 163 ++++++++++
 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               | 108 +++++++
 tests/tcg/mipsel/test_dsp_arith.c             | 178 +++++++++++
 tests/tcg/mipsel/test_dsp_cmp.c               |  83 +++++
 tests/tcg/mipsel/test_dsp_ctrl.c              |  43 +++
 tests/tcg/mipsel/test_dsp_dot.c               | 153 +++++++++
 tests/tcg/mipsel/test_dsp_mul.c               |  63 ++++
 tests/tcg/mipsel/test_dsp_pack.c              | 148 +++++++++
 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             | 123 +++++++
 tests/tcg/mips/meson.build                    | 299 ++----------------
 tests/tcg/mips64/meson.build                  |  42 +--
 tests/tcg/mipsel/meson.build                  | 172 +---------
 197 files changed, 3548 insertions(+), 641 deletions(-)
 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
#1 lore raw

PATCH v3 1/31 tests/tcg/mips: Group DSP acc tests

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           | 108 ++++++++++++++++++++++
 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, 135 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
new file mode 100644
index 000000000000..23ef17428b2e
@@ -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 +108 -0

108 lines not on this page · raw message

tests/tcg/mipsel/test_dsp_r1_extp.c +0 -1
index b18bdb34c872..5f9e81f51e97 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extpdp.c +0 -1
index 79ee16e8b87c..6dec2bb31617 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extpdpv.c +0 -1
index f5774eed3cae..80c5a7fa3ee8 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extpv.c +0 -1
index 401b94afadfc..d575750b7ffd 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extr_r_w.c +0 -1
index 489c1931b475..d3244b730297 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extr_rs_w.c +0 -1
index f9d2ed646fa3..6e899ccd4c4b 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extr_s_h.c +0 -1
index 9bc2a63cc2d1..aa36b4e9f31c 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extr_w.c +0 -1
index cf926146d54c..f82e38e34fb7 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extrv_r_w.c +0 -1
index 2403b3afe40f..6af471076904 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extrv_rs_w.c +0 -1
index 10c182a54b23..9a4f5fac7a59 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extrv_s_h.c +0 -1
index feac3e2e334a..d0747331f9ed 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_extrv_w.c +0 -1
index 9e8b238a04d4..b1caee3ff085 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_main.c deleted +0 -6
deleted file mode 100644
index b296b20c9254..000000000000
@@ -1,6 +0,0 @@
-#include<stdio.h>
-
-int main()
-{
-    printf("hello world\n");
-}
tests/tcg/mipsel/test_dsp_r1_mfhi.c +0 -1
index 43a80669d1ea..5d2233d6eea5 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_mflo.c +0 -1
index caeafdb05ce4..3e4046c57ffe 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_mthi.c +0 -1
index 43a80669d1ea..5d2233d6eea5 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_mthlip.c +0 -1
index 85f94d8450ea..9c96751c8cbe 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_mtlo.c +0 -1
index caeafdb05ce4..3e4046c57ffe 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shilo.c +0 -1
index ce8ebc69c2ac..e1b3292c3d42 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shilov.c +0 -1
index e1d6cea4b6de..18e3ee1f213e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/meson.build +1 -20
index c9e869b000f4..77f210a47a70 100644
@@ -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
#2 lore raw

Re: [PATCH v3 01/31] tests/tcg/mips: Group DSP acc tests

tests/tcg/mipsel/test_dsp_acc.c line 87

Quoted 3 lines · Philippe Mathieu-Daudé
tests/tcg/mipsel/test_dsp_acc.c new file +3 -0
+int main(void)
+{
+    RUN_TEST(test_dsp_r1_extp);

Forgot TAP_START() ?

r~

#3 lore raw

Re: [PATCH v3 01/31] tests/tcg/mips: Group DSP acc tests

Quoted 6 lines · Richard Henderson

tests/tcg/mipsel/test_dsp_acc.c line 87

Quoted 3 lines · Philippe Mathieu-Daudé
tests/tcg/mipsel/test_dsp_acc.c new file +3 -0
+int main(void)
+{
+    RUN_TEST(test_dsp_r1_extp);

Forgot TAP_START() ?

Oops thanks...

#4 lore raw

PATCH v3 2/31 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         | 178 ++++++++++++++++++++++
 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, 179 insertions(+), 66 deletions(-)
 create mode 100644 tests/tcg/mipsel/test_dsp_arith.c
tests/tcg/mipsel/test_dsp_arith.c new file +178 -0
new file mode 100644
index 000000000000..df5b5eaedc31
@@ -0,0 +1,178 @@
+/*
+ * 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)
+{
+    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
index aa8411202e20..ba32ddeeb498 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 
 int main()
tests/tcg/mipsel/test_dsp_r1_absq_s_w.c +0 -1
index 3f52a48039cd..699f1adf967e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_addq_ph.c +0 -1
index 96a549637b41..4bb955a9565d 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_addq_s_ph.c +0 -1
index 5f865f6cffd5..47b1c19e77d9 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_addq_s_w.c +0 -1
index 1e13acf68fb9..bb3cbf836aa3 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 
 int main()
tests/tcg/mipsel/test_dsp_r1_addsc.c +0 -1
index ace749f667c4..f348a081e76e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_addu_qb.c +0 -1
index 23ba2e90d1c9..b9c1cca392c6 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_addu_s_qb.c +0 -1
index fe7fd3e6aa2d..4c2fcb9aedc9 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_addwc.c +0 -1
index 8a8d81fab4ca..71f9cf49c9e7 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_modsub.c +0 -1
index c294eebb519d..05278a2323cc 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_raddu_w_qb.c +0 -1
index 77a983c0d20f..d131bd6ca7f3 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_subq_ph.c +0 -1
index fdd7b38b647e..19cc84d9fd17 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_subq_s_ph.c +0 -1
index 64c89ebd5114..08742e926dea 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_subq_s_w.c +0 -1
index 9d456a90f417..9844b250d9d2 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_subu_qb.c +0 -1
index 420909615526..2ec61e819f02 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_subu_s_qb.c +0 -1
index 3d650533d171..2ce247cd7a86 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_absq_s_qb.c +0 -1
index af4683f30475..9944cc18f075 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_addqh_ph.c +0 -1
index 921f0eaf33c7..82827f33f6e4 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_addqh_r_ph.c +0 -1
index 213ba3725006..064e2bbda707 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_addqh_r_w.c +0 -1
index 75a75c50f32d..867fe0bc7f05 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_addqh_w.c +0 -1
index de6926ebbb72..2539e4c178ec 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_addu_ph.c +0 -1
index 1d7a25a2a773..a547341c8b58 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_addu_s_ph.c +0 -1
index 979651bfc9ac..d47faece052e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_adduh_qb.c +0 -1
index a1f5d631b52e..108a348456eb 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_adduh_r_qb.c +0 -1
index 81e98c190d2b..892513a4af7c 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_subqh_ph.c +0 -1
index dbc096734ceb..64c754777838 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_subqh_r_ph.c +0 -1
index 24ef0f1aeb91..717c3931e4df 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_subqh_r_w.c +0 -1
index d460f8630fae..3d20a87b5a94 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_subqh_w.c +0 -1
index 42be3deb80a3..9d41911233c2 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_subu_ph.c +0 -1
index 0d39a017c79d..702eb141d833 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_subu_s_ph.c +0 -1
index 8e4da4f3e544..86afcdc0d660 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_subuh_qb.c +0 -1
index 92cfc764b8c9..ae9ea3f72a36 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_subuh_r_qb.c +0 -1
index dac81d47db60..fc90b9cce0e8 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/meson.build +1 -33
index 77f210a47a70..e7e576ad6c19 100644
@@ -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
#5 lore raw

PATCH v3 3/31 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             | 83 +++++++++++++++++++++
 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, 84 insertions(+), 28 deletions(-)
 create mode 100644 tests/tcg/mipsel/test_dsp_cmp.c
tests/tcg/mipsel/test_dsp_cmp.c new file +83 -0
new file mode 100644
index 000000000000..aa63737e74ae
@@ -0,0 +1,83 @@
+/*
+ * 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)
+{
+    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
index 957bd88ce01f..47406f77c59e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_cmp_le_ph.c +0 -1
index 356f156c5d1f..811646d78e84 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_cmp_lt_ph.c +0 -1
index 3fb4827ad761..430953a77215 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_cmpgu_eq_qb.c +0 -1
index 2615c84c75c7..1fd5b523a44e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_cmpgu_le_qb.c +0 -1
index 65d0813c3b19..da1277065246 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_cmpgu_lt_qb.c +0 -1
index 7dddad98532c..9317f9a3fa44 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_cmpu_eq_qb.c +0 -1
index 680f2a1999d8..8736e7fc45ad 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_cmpu_le_qb.c +0 -1
index 43cfa509ca3c..fbc620adf95d 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_cmpu_lt_qb.c +0 -1
index 074ca5b402de..8132b13a97c2 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_pick_ph.c +0 -1
index 929a002e7544..0a11b5d12ce3 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_pick_qb.c +0 -1
index a79047524662..8def9559d632 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_cmpgdu_eq_qb.c +0 -1
index 2d6340d6fb12..cfc71839591a 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_cmpgdu_le_qb.c +0 -1
index a0ecdca2ac2e..9e7d8260cfa7 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_cmpgdu_lt_qb.c +0 -1
index dba99e392c29..ec964e39074f 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/meson.build +1 -14
index e7e576ad6c19..e8737308c40d 100644
@@ -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
#6 lore raw

PATCH v3 4/31 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        | 43 +++++++++++++++++++++++++
 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, 44 insertions(+), 12 deletions(-)
 create mode 100644 tests/tcg/mipsel/test_dsp_ctrl.c
tests/tcg/mipsel/test_dsp_ctrl.c new file +43 -0
new file mode 100644
index 000000000000..4f7c648d5472
@@ -0,0 +1,43 @@
+/*
+ * 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)
+{
+    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
index d25417ea77b2..f39eae531c8f 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_lbux.c +0 -1
index 2337abea2acb..3436289b5a65 100644
@@ -1,5 +1,4 @@
 #include <stdio.h>
-#include <assert.h>
 
 int main(void)
 {
tests/tcg/mipsel/test_dsp_r1_lhx.c +0 -1
index 10be3b385fee..28795dbf701a 100644
@@ -1,5 +1,4 @@
 #include <stdio.h>
-#include <assert.h>
 
 int main(void)
 {
tests/tcg/mipsel/test_dsp_r1_lwx.c +0 -1
index e6543c9e7eae..ac15edb7cf94 100644
@@ -1,5 +1,4 @@
 #include <stdio.h>
-#include <assert.h>
 
 int main(void)
 {
tests/tcg/mipsel/test_dsp_r1_rddsp.c +0 -1
index 2f3028503324..a0e413614d58 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_wrdsp.c +0 -1
index dc54943a99e8..57869203102e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/meson.build +1 -6
index e8737308c40d..1c2851f56369 100644
@@ -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
#7 lore raw

PATCH v3 5/31 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              | 153 +++++++++++++++++++
 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, 154 insertions(+), 56 deletions(-)
 create mode 100644 tests/tcg/mipsel/test_dsp_dot.c
tests/tcg/mipsel/test_dsp_dot.c new file +153 -0
new file mode 100644
index 000000000000..4086bcd39741
@@ -0,0 +1,153 @@
+/*
+ * 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)
+{
+    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
index a6425b6edc84..3818ba7c2a48 100644
@@ -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
index cbf900713f33..56a3c2f6e1d1 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_dpau_h_qbl.c +0 -1
index 6017b5e73ab2..b90a9e9e72cc 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_dpau_h_qbr.c +0 -1
index e4abb2e2af03..7828182f3151 100644
@@ -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
index 74058fe7ecd0..14698262d589 100644
@@ -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
index eda3b14e2be2..900f3f90bcb8 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_dpsu_h_qbl.c +0 -1
index 94e2bf625499..6958bbeb753b 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_dpsu_h_qbr.c +0 -1
index a1e66356310d..f127d1662714 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_madd.c +0 -1
index af4bfcfe9df3..f724fd9a27c0 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_maddu.c +0 -1
index af4bfcfe9df3..f724fd9a27c0 100644
@@ -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
index 0f7c070155a8..aa29fd5e3821 100644
@@ -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
index 942722a530c2..42833686936c 100644
@@ -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
index d83dce6f3272..9dda4ebdbbe9 100644
@@ -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
index d2331118abb8..1b34664280dc 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_msub.c +0 -1
index 5779e6f47ac7..74146284ffe2 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_msubu.c +0 -1
index e0f9b5a77ae3..2eb728af64b4 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_mult.c +0 -1
index 15e6fde92c0e..c0509396de72 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_multu.c +0 -1
index 85d36c1b621a..1c8a7f1e01e7 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_dpa_w_ph.c +0 -1
index fae49f10eb95..68eae5a08346 100644
@@ -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
index ce8783024685..06b1a0a0d7e8 100644
@@ -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
index d551d64ae293..6dd106d74cae 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_dpax_w_ph.c +0 -1
index 514797cfd1b4..a812c8a7f854 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_dps_w_ph.c +0 -1
index f51f9b9d13d7..a656d219d89f 100644
@@ -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
index e40543fd8292..960f2bbbdf36 100644
@@ -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
index 7da278eacc0e..68f20348c2c9 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_dpsx_w_ph.c +0 -1
index bb49a4031d34..d85b504b402e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_mulsa_w_ph.c +0 -1
index a6940939ca50..842233b2785b 100644
@@ -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
index 06c91a43e7ea..c0f8e51ad389 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/meson.build +1 -28
index 1c2851f56369..c26f5fba06b7 100644
@@ -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
#8 lore raw

PATCH v3 6/31 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               | 63 +++++++++++++++++++
 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, 64 insertions(+), 20 deletions(-)
 create mode 100644 tests/tcg/mipsel/test_dsp_mul.c
tests/tcg/mipsel/test_dsp_mul.c new file +63 -0
new file mode 100644
index 000000000000..d5ac6141cf11
@@ -0,0 +1,63 @@
+/*
+ * 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)
+{
+    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
index b3a5370fe59e..e9b0dc55071b 100644
@@ -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
index 8066d7d02a1e..a8238c673293 100644
@@ -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
index 66a382806a21..ce16164bc853 100644
@@ -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
index 4cc6c8f7cfe1..2baedb9f53a5 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_mulq_rs_ph.c +0 -1
index 370c2a801832..bd2ab49b0717 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_mul_ph.c +0 -1
index c7e9d60d12e2..bb92f6cbc0f1 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_mul_s_ph.c +0 -1
index 33da110de869..092dd531f421 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_mulq_rs_w.c +0 -1
index 7ba633bc17f7..f94c1678af09 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_mulq_s_ph.c +0 -1
index 00e015542e69..8c944c6ea3fa 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_mulq_s_w.c +0 -1
index 9c2be06cc08a..caa8e8d76193 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/meson.build +1 -10
index c26f5fba06b7..4991c14b7bf8 100644
@@ -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
#9 lore raw

PATCH v3 7/31 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              | 148 ++++++++++++++++++
 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, 149 insertions(+), 54 deletions(-)
 create mode 100644 tests/tcg/mipsel/test_dsp_pack.c
tests/tcg/mipsel/test_dsp_pack.c new file +148 -0
new file mode 100644
index 000000000000..7ae3b41ff55e
@@ -0,0 +1,148 @@
+/*
+ * 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)
+{
+    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
index 04d8a3844eb8..08b49aff8353 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_insv.c +0 -1
index 9d674697ccaa..58e1404b36ec 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_packrl_ph.c +0 -1
index 1f8e69992503..32fdb27fa5cd 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_preceq_w_phl.c +0 -1
index bf70bf7d3aec..2d03bb8615e9 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_preceq_w_phr.c +0 -1
index 3f885ef584e6..75a68d75e079 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbl.c +0 -1
index 63b7a9568345..644799d16671 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbla.c +0 -1
index 31627f0bd606..8825e696f39e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbr.c +0 -1
index b6f72d3cbfde..fda12bb5e591 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_precequ_ph_qbra.c +0 -1
index 4764fd031d8a..98cef45cc865 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbl.c +0 -1
index fa95c26cc48f..f5a2b9ec9a6f 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbla.c +0 -1
index 021f21a74440..9eb9800b2323 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbr.c +0 -1
index 03df18c72ca5..81d470de2347 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_preceu_ph_qbra.c +0 -1
index 634327618cce..1698ff2c837a 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_precrq_ph_w.c +0 -1
index 25d45f1a9aa8..1f04c644c44a 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_precrq_qb_ph.c +0 -1
index fe23acce8c47..e5512cd82106 100644
@@ -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
index da6845bf2423..807f33c7ad73 100644
@@ -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
index 7481d5af3a5b..a24b066056d5 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_repl_ph.c +0 -1
index 21074953bdde..13375231b54b 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_repl_qb.c +0 -1
index 6631393ea131..2e65fb715485 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_replv_ph.c +0 -1
index 07fb15f1f795..64a5c1b334f5 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_replv_qb.c +0 -1
index dd1271fedff0..5aecf82f50a5 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_append.c +0 -1
index 9a91e1650dbd..62cf0e76a196 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_balign.c +0 -1
index 537cf0451cc8..62cc0359e21b 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_precr_qb_ph.c +0 -1
index 3a2b3fde0573..dce58816c815 100644
@@ -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
index 5c9baab03d00..9e65e7d2575b 100644
@@ -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
index 6474a108c057..bb7bb97a231f 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_prepend.c +0 -1
index f6bcd47b2da9..a77efa4d6208 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/meson.build +1 -27
index 4991c14b7bf8..247db7d10d79 100644
@@ -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
#10 lore raw

PATCH v3 8/31 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         | 123 ++++++++++++++++++++++
 tests/tcg/mipsel/meson.build              |  24 +----
 24 files changed, 125 insertions(+), 44 deletions(-)
 create mode 100644 tests/tcg/mipsel/test_dsp_shift.c
tests/tcg/mipsel/test_dsp_r1_shll_ph.c +0 -1
index 5fa58ccf6374..336ef50ca8a6 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shll_qb.c +0 -1
index 729716d62618..60cd916766ed 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shll_s_ph.c +0 -1
index 910fea3b317e..833b1d5673c8 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shll_s_w.c +0 -1
index 628c7521027b..1848afb21323 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shllv_ph.c +0 -1
index f98a6322dc1d..bc1664d70d12 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shllv_qb.c +0 -1
index 6d8ff4a259ba..84600fc7fb36 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shllv_s_ph.c +0 -1
index fc9bd32765b8..4c84f3b94164 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shllv_s_w.c +0 -1
index 350c25617adc..5c06b4411a0e 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shra_ph.c +0 -1
index 5b2d840a6bc5..38fdc66e5b66 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shra_r_ph.c +0 -1
index adc4ae68bdc3..c838f8a32fe2 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shra_r_w.c +0 -1
index ec0cf2c72ccb..d722cdecd166 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shrav_ph.c +0 -1
index 6e42aaf8e1a7..c2cad6e67309 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shrav_r_ph.c +0 -1
index f03b978d0544..ec2eea36b947 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shrav_r_w.c +0 -1
index 2ab03bb5daae..af50a92af2a9 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shrl_qb.c +0 -1
index a7e4e6a5e4f5..bf6fab4ceb81 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r1_shrlv_qb.c +0 -1
index db77f6d0e117..99d7aba6dde9 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_shra_qb.c +0 -1
index 48193de87ad0..d4ca7430fdba 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_shra_r_qb.c +0 -1
index 29afa0e4b07b..08d22fd4cd6f 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_shrav_qb.c +0 -1
index b21e1b7ca64a..5015a124b89d 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_shrav_r_qb.c +0 -1
index 9ea8aa0cbb90..1bfc66ec3676 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_shrl_ph.c +0 -1
index 724b9a7a4691..ea53113568e0 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_r2_shrlv_ph.c +0 -1
index ac79aa69acf0..40edd7cab67f 100644
@@ -1,5 +1,4 @@
 #include<stdio.h>
-#include<assert.h>
 
 int main()
 {
tests/tcg/mipsel/test_dsp_shift.c new file +123 -0

123 lines not on this page · raw message

tests/tcg/mipsel/meson.build +2 -22
index 247db7d10d79..9e446eed0f6e 100644
@@ -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
#11 lore raw

PATCH v3 9/31 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  |  6 +--
 tests/tcg/mips64/test_mips64r6_bitops.c | 60 +++++++++++++++++++++++++
 tests/tcg/mips64/meson.build            |  7 +--
 3 files changed, 64 insertions(+), 9 deletions(-)
 create mode 100644 tests/tcg/mips64/test_mips64r6_bitops.c
tests/tcg/mips/include/test_utils_64.h +3 -3
index b785c26d0934..fe9f5f3b000f 100644
@@ -58,7 +58,7 @@ static inline int32_t check_results_64(const char *isa_ase_name,
     uint32_t pass_count = 0;
     uint32_t fail_count = 0;
 
-    printf("| %-10s \t| %-20s\t| %-16s \t|",
+    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]) {
@@ -92,10 +92,10 @@ static inline bool check_binary_op_64_with_input(binary_op_64 op, const char *op
             uint64_t expected = expect[i * cols + j];
             uint64_t res = 0;
             op(&input1, &input2, &res);
-            printf("assert(0x%"PRIx64" == %s(0x%"PRIx64", 0x%"PRIx64"));\n",
+            printf("# assert(0x%"PRIx64" == %s(0x%"PRIx64", 0x%"PRIx64"));\n",
                    res, op_str, input1, input2);
             if (expected != res) {
-                printf("// error: expected 0x%"PRIx64"\n", expected);
+                printf("# error: expected 0x%"PRIx64"\n", 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
index 3b895a169758..cb9e09ed3c29 100644
@@ -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
#12 lore raw

PATCH v3 10/31 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
new file mode 100644
index 000000000000..75943cf21353
@@ -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
index cb9e09ed3c29..0601ed52ab21 100644
@@ -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
#13 lore raw

PATCH v3 11/31 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
new file mode 100644
index 000000000000..063f2c254d78
@@ -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
index 0601ed52ab21..657a1c4d5cc9 100644
@@ -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
#14 lore raw

PATCH v3 12/31 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
new file mode 100644
index 000000000000..e400d418b9fd
@@ -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
index 657a1c4d5cc9..d356689e54bf 100644
@@ -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
#15 lore raw

PATCH v3 13/31 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
new file mode 100644
index 000000000000..928112e35c0d
@@ -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
index d356689e54bf..894f8e9e23e1 100644
@@ -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
#16 lore raw

PATCH v3 14/31 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 |  2 +-
 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, 107 insertions(+), 15 deletions(-)
 create mode 100644 tests/tcg/mips/test_msa_bit_count.c
tests/tcg/mips/include/test_utils_128.h +1 -1
index 0dd38684cf33..9ba877d84b5c 100644
@@ -59,7 +59,7 @@ static inline int32_t check_results_128(const char *isa_ase_name,
     uint32_t pass_count = 0;
     uint32_t fail_count = 0;
 
-    printf("| %-10s \t| %-20s\t| %-16s \t|",
+    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]) &&
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
index 88d598a4f89b..88ec44520377 100644
@@ -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
index 894f8e9e23e1..ebb4006e7eb5 100644
@@ -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
index 9e446eed0f6e..edb59a25454b 100644
@@ -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
#17 lore raw

PATCH v3 15/31 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
new file mode 100644
index 000000000000..02fb3bc486cd
@@ -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
index 88ec44520377..ae755143c18d 100644
@@ -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
#18 lore raw

PATCH v3 16/31 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
new file mode 100644
index 000000000000..840b125c2969
@@ -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
index ae755143c18d..03f3ce57d3cf 100644
@@ -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
#19 lore raw

PATCH v3 17/31 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
new file mode 100644
index 000000000000..7eb5bfe1b539
@@ -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
index 03f3ce57d3cf..17e3fe3e55ae 100644
@@ -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
#20 lore raw

PATCH v3 18/31 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
new file mode 100644
index 000000000000..13f8bc79b0e6
@@ -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
index 17e3fe3e55ae..5e14bc3197a5 100644
@@ -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
#21 lore raw

PATCH v3 19/31 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
new file mode 100644
index 000000000000..c29663c1bfa7
@@ -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
index 5e14bc3197a5..7ef3d6aafa8a 100644
@@ -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
#22 lore raw

PATCH v3 20/31 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
new file mode 100644
index 000000000000..f3ff9fd345bc
@@ -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
index 7ef3d6aafa8a..7da4aece8409 100644
@@ -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
#23 lore raw

PATCH v3 21/31 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
new file mode 100644
index 000000000000..b500772be5d5
@@ -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
index 7da4aece8409..199b1b934a5e 100644
@@ -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
#24 lore raw

PATCH v3 22/31 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
new file mode 100644
index 000000000000..764054c2a57f
@@ -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
index 199b1b934a5e..537de9ea4a2f 100644
@@ -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
#25 lore raw

PATCH v3 23/31 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
new file mode 100644
index 000000000000..fcbd414741b9
@@ -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
index 537de9ea4a2f..2d2dc60789b9 100644
@@ -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
#26 lore raw

PATCH v3 24/31 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
new file mode 100644
index 000000000000..83eac723dd78
@@ -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
index 2d2dc60789b9..c10d4e7342f4 100644
@@ -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
#27 lore raw

PATCH v3 25/31 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
new file mode 100644
index 000000000000..ce8ddafe8776
@@ -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
index c10d4e7342f4..0f4d55a2f26b 100644
@@ -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
#28 lore raw

PATCH v3 26/31 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
new file mode 100644
index 000000000000..84efc16ac463
@@ -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
index 0f4d55a2f26b..516da867cadf 100644
@@ -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
#29 lore raw

PATCH v3 27/31 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
new file mode 100644
index 000000000000..f561ebe25aa4
@@ -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
index 516da867cadf..cc94623f8f20 100644
@@ -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
#30 lore raw

PATCH v3 28/31 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
new file mode 100644
index 000000000000..4e96c3ebf0e9
@@ -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
index cc94623f8f20..ae2c2fa6aa48 100644
@@ -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
#31 lore raw

PATCH v3 29/31 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
new file mode 100644
index 000000000000..d9b911336474
@@ -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
index ae2c2fa6aa48..8a0ae3cdaeb8 100644
@@ -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
#32 lore raw

PATCH v3 30/31 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
new file mode 100644
index 000000000000..14a73d90935b
@@ -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
index 8a0ae3cdaeb8..560d07ad6357 100644
@@ -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
index ebb4006e7eb5..ad69e36d9165 100644
@@ -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
index edb59a25454b..1951c3c437fb 100644
@@ -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
#33 lore raw

PATCH v3 31/31 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 | 163 +++++++++++++++++++++++++++
 tests/tcg/mips/meson.build           |   1 +
 2 files changed, 164 insertions(+)
 create mode 100644 tests/tcg/mips/test_msa_load_store.c
tests/tcg/mips/test_msa_load_store.c new file +163 -0
new file mode 100644
index 000000000000..a3c8f4a8aa89
@@ -0,0 +1,163 @@
+/*
+ * MIPS MSA tests: Load / Store instructions
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#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)) {
+                fprintf(stderr, "ld.%s endian mismatch (%s, offset %zu)\n",
+                        formats[format_index].name, region, source_offset);
+                return false;
+            }
+            if (memcmp(destination, expected_memory, BUFFER_BYTES)) {
+                fprintf(stderr, "st.%s memory mismatch (%s, offset %zu)\n",
+                        formats[format_index].name, region,
+                        destination_offset);
+                return false;
+            }
+            if (memcmp(after_store, loaded, VECTOR_BYTES)) {
+                fprintf(stderr, "st.%s changed its source register (%s)\n",
+                        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;
+
+    if (page_size < BUFFER_BYTES) {
+        fprintf(stderr, "Invalid guest page size: %ld\n", page_size);
+        return 1;
+    }
+    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) {
+        perror("mmap");
+        return 1;
+    }
+    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) {
+        perror("mprotect");
+        return 1;
+    }
+
+    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;
+    }
+
+    TAP_START();
+    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) {
+        perror("munmap");
+        return 1;
+    }
+    return tap_done();
+}
tests/tcg/mips/meson.build +1 -0
index 560d07ad6357..179502504582 100644
@@ -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