Skip to contentSkip to conversation

Qemu MIPS ASE DSP Support

PATCH Superseded Jia Liu 2 participants 19 messages Mar 30, 2012 – Apr 4, 2012 Kbuild

v4 of 12 Superseded Latest is v12 →

lore
Share & tools
lore

Jia Liu

author
#0 lore raw

v4 cover Qemu MIPS ASE DSP Support

This is MIPS ASE DSP instructions support for QEMU. These instructions are grouped according to "Chapter 4. MIPS DSP ASE Instruction Summary" in MIPS ASE DSP manual [1].

[1] MIPS32® Architecture for Programmers VolumeIV-e: The MIPS® DSP Application-Specific Extension to the MIPS32®Architecture
http://www.mips.com/products/product-materials/processor/mips-architecture/

---

Version History:

V4:
Addressed Richard's review comments:
- split transalte.
- tested on i386 machine.
- delete all global env usage so that we don't need to include dyngen-exec.h.
- fix DEF_HELPER_FLAGS_N error.
- fix all ERRORS and WARNINGS found by ./scripts/checkpatch.pl.
- make sample if() code clearer.
- combine helper_cmpgu_cond_* and helper_cmpgdu_cond_*.
- fix bitrev.
- implement repl* and load with no helper.
- using TCG_COND_GE instead of TCG_COND_GT in OPC_BPOSGE32.

Thanks WeiRen for prereviewing and lots of suggestion.

V3:
Addressed Peter's review comments:
- split these changes into more patches.
- add "ULL" suffix for constants which are more than 32 bits wide.

Addressed WeiRen's review comments:
- split these changes into 12 patches.
- more suitable subject and description for every patch.

Addressed Richard's review comments:
- use DEF_HELPER_FLAGS_N instead of DEF_HELPER_N in some insns.
- put most DSP helpers into dsp_helper.c

- fix two testcases error.

V2:
Addressed Stefan's review comments:
- fixed coding style.
- changed acc into unsigned int form int and no initialization in translation.
- added return value in testcases.

V1:
- add MIPS ASE DSP Support.

Jia Liu (11):
Add MIPS DSP internal functions
Use correct acc value to index cpu_HI/cpu_LO rather than using a fix
number
Add MIPS DSP Branch instruction Support
Add MIPS DSP Load instructions Support
Add MIPS DSP Arithmetic instructions Support
Add MIPS DSP GPR-Based Shift instructions Support
Add MIPS DSP Multiply instructions Support
Add MIPS DSP Bit/Manipulation instructions Support
Add MIPS DSP Compare-Pick instructions Support
Add MIPS DSP Accumulator and DSPControl Access instructions Support Add MIPS DSP Testcases

 Makefile.target                                |    3 +
 target-mips/dsp_helper.c                       | 3837 ++++++++++++++++++++++++
 target-mips/helper.h                           |  153 +
 target-mips/translate.c                        | 1201 ++++++++-
 tests/tcg/mips/mips32-dsp/Makefile             |  133 +
 tests/tcg/mips/mips32-dsp/absq_s_ph.c          |   30 +
 tests/tcg/mips/mips32-dsp/absq_s_w.c           |   37 +
 tests/tcg/mips/mips32-dsp/addq_ph.c            |   30 +
 tests/tcg/mips/mips32-dsp/addq_s_ph.c          |   30 +
 tests/tcg/mips/mips32-dsp/addsc.c              |   30 +
 tests/tcg/mips/mips32-dsp/addu_qb.c            |   30 +
 tests/tcg/mips/mips32-dsp/addu_s_qb.c          |   30 +
 tests/tcg/mips/mips32-dsp/addwc.c              |   30 +
 tests/tcg/mips/mips32-dsp/bitrev.c             |   20 +
 tests/tcg/mips/mips32-dsp/bposge32.c           |   44 +
 tests/tcg/mips/mips32-dsp/cmp_eq_ph.c          |   35 +
 tests/tcg/mips/mips32-dsp/cmp_le_ph.c          |   35 +
 tests/tcg/mips/mips32-dsp/cmp_lt_ph.c          |   35 +
 tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c        |   31 +
 tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c        |   31 +
 tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c        |   31 +
 tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c         |   35 +
 tests/tcg/mips/mips32-dsp/cmpu_le_qb.c         |   35 +
 tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c         |   35 +
 tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c        |   31 +
 tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c        |   31 +
 tests/tcg/mips/mips32-dsp/dpau_h_qbl.c         |   27 +
 tests/tcg/mips/mips32-dsp/dpau_h_qbr.c         |   27 +
 tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c        |   27 +
 tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c        |   31 +
 tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c         |   27 +
 tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c         |   27 +
 tests/tcg/mips/mips32-dsp/extp.c               |   44 +
 tests/tcg/mips/mips32-dsp/extpdp.c             |   46 +
 tests/tcg/mips/mips32-dsp/extpdpv.c            |   47 +
 tests/tcg/mips/mips32-dsp/extpv.c              |   45 +
 tests/tcg/mips/mips32-dsp/extr_r_w.c           |   25 +
 tests/tcg/mips/mips32-dsp/extr_rs_w.c          |   25 +
 tests/tcg/mips/mips32-dsp/extr_s_h.c           |   25 +
 tests/tcg/mips/mips32-dsp/extr_w.c             |   25 +
 tests/tcg/mips/mips32-dsp/extrv_r_w.c          |   29 +
 tests/tcg/mips/mips32-dsp/extrv_rs_w.c         |   29 +
 tests/tcg/mips/mips32-dsp/extrv_s_h.c          |   29 +
 tests/tcg/mips/mips32-dsp/extrv_w.c            |   29 +
 tests/tcg/mips/mips32-dsp/insv.c               |   23 +
 tests/tcg/mips/mips32-dsp/lbux.c               |   23 +
 tests/tcg/mips/mips32-dsp/lhx.c                |   23 +
 tests/tcg/mips/mips32-dsp/lwx.c                |   23 +
 tests/tcg/mips/mips32-dsp/madd.c               |   31 +
 tests/tcg/mips/mips32-dsp/maddu.c              |   31 +
 tests/tcg/mips/mips32-dsp/maq_s_w_phl.c        |   31 +
 tests/tcg/mips/mips32-dsp/maq_s_w_phr.c        |   31 +
 tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c       |   31 +
 tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c       |   31 +
 tests/tcg/mips/mips32-dsp/mfhi.c               |   21 +
 tests/tcg/mips/mips32-dsp/mflo.c               |   21 +
 tests/tcg/mips/mips32-dsp/modsub.c             |   30 +
 tests/tcg/mips/mips32-dsp/msub.c               |   30 +
 tests/tcg/mips/mips32-dsp/msubu.c              |   30 +
 tests/tcg/mips/mips32-dsp/mthi.c               |   21 +
 tests/tcg/mips/mips32-dsp/mthlip.c             |   34 +
 tests/tcg/mips/mips32-dsp/mtlo.c               |   21 +
 tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c      |   40 +
 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c     |   25 +
 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c     |   25 +
 tests/tcg/mips/mips32-dsp/mulq_rs_ph.c         |   25 +
 tests/tcg/mips/mips32-dsp/mult.c               |   24 +
 tests/tcg/mips/mips32-dsp/multu.c              |   24 +
 tests/tcg/mips/mips32-dsp/packrl_ph.c          |   21 +
 tests/tcg/mips/mips32-dsp/pick_ph.c            |   23 +
 tests/tcg/mips/mips32-dsp/pick_qb.c            |   23 +
 tests/tcg/mips/mips32-dsp/preceq_w_phl.c       |   20 +
 tests/tcg/mips/mips32-dsp/preceq_w_phr.c       |   20 +
 tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c     |   20 +
 tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c    |   20 +
 tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c     |   20 +
 tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c    |   20 +
 tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c      |   20 +
 tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c     |   20 +
 tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c      |   20 +
 tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c     |   20 +
 tests/tcg/mips/mips32-dsp/precrq_ph_w.c        |   21 +
 tests/tcg/mips/mips32-dsp/precrq_qb_ph.c       |   21 +
 tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c     |   21 +
 tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c    |   21 +
 tests/tcg/mips/mips32-dsp/raddu_w_qb.c         |   20 +
 tests/tcg/mips/mips32-dsp/rddsp.c              |   54 +
 tests/tcg/mips/mips32-dsp/repl_ph.c            |   23 +
 tests/tcg/mips/mips32-dsp/repl_qb.c            |   16 +
 tests/tcg/mips/mips32-dsp/replv_ph.c           |   19 +
 tests/tcg/mips/mips32-dsp/replv_qb.c           |   19 +
 tests/tcg/mips/mips32-dsp/shilo.c              |   27 +
 tests/tcg/mips/mips32-dsp/shilov.c             |   29 +
 tests/tcg/mips/mips32-dsp/shll_ph.c            |   24 +
 tests/tcg/mips/mips32-dsp/shll_qb.c            |   23 +
 tests/tcg/mips/mips32-dsp/shll_s_ph.c          |   24 +
 tests/tcg/mips/mips32-dsp/shll_s_w.c           |   24 +
 tests/tcg/mips/mips32-dsp/shllv_ph.c           |   25 +
 tests/tcg/mips/mips32-dsp/shllv_qb.c           |   24 +
 tests/tcg/mips/mips32-dsp/shllv_s_ph.c         |   25 +
 tests/tcg/mips/mips32-dsp/shllv_s_w.c          |   25 +
 tests/tcg/mips/mips32-dsp/shra_ph.c            |   20 +
 tests/tcg/mips/mips32-dsp/shra_r_ph.c          |   20 +
 tests/tcg/mips/mips32-dsp/shra_r_w.c           |   20 +
 tests/tcg/mips/mips32-dsp/shrav_ph.c           |   21 +
 tests/tcg/mips/mips32-dsp/shrav_r_ph.c         |   21 +
 tests/tcg/mips/mips32-dsp/shrav_r_w.c          |   21 +
 tests/tcg/mips/mips32-dsp/shrl_qb.c            |   20 +
 tests/tcg/mips/mips32-dsp/shrlv_qb.c           |   21 +
 tests/tcg/mips/mips32-dsp/subq_ph.c            |   25 +
 tests/tcg/mips/mips32-dsp/subq_s_ph.c          |   25 +
 tests/tcg/mips/mips32-dsp/subq_s_w.c           |   25 +
 tests/tcg/mips/mips32-dsp/subu_qb.c            |   25 +
 tests/tcg/mips/mips32-dsp/subu_s_qb.c          |   25 +
 tests/tcg/mips/mips32-dsp/wrdsp.c              |   54 +
 tests/tcg/mips/mips32-dspr2/Makefile           |   71 +
 tests/tcg/mips/mips32-dspr2/absq_s_qb.c        |   35 +
 tests/tcg/mips/mips32-dspr2/addqh_ph.c         |   30 +
 tests/tcg/mips/mips32-dspr2/addqh_r_ph.c       |   30 +
 tests/tcg/mips/mips32-dspr2/addqh_r_w.c        |   34 +
 tests/tcg/mips/mips32-dspr2/addqh_w.c          |   34 +
 tests/tcg/mips/mips32-dspr2/addu_ph.c          |   30 +
 tests/tcg/mips/mips32-dspr2/addu_s_ph.c        |   30 +
 tests/tcg/mips/mips32-dspr2/adduh_qb.c         |   30 +
 tests/tcg/mips/mips32-dspr2/adduh_r_qb.c       |   30 +
 tests/tcg/mips/mips32-dspr2/append.c           |   30 +
 tests/tcg/mips/mips32-dspr2/balign.c           |   30 +
 tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c     |   37 +
 tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c     |   37 +
 tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c     |   37 +
 tests/tcg/mips/mips32-dspr2/dpa_w_ph.c         |   27 +
 tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c     |   57 +
 tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c    |   30 +
 tests/tcg/mips/mips32-dspr2/dpax_w_ph.c        |   27 +
 tests/tcg/mips/mips32-dspr2/dps_w_ph.c         |   27 +
 tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c     |   31 +
 tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c    |   31 +
 tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c        |   27 +
 tests/tcg/mips/mips32-dspr2/mul_ph.c           |   25 +
 tests/tcg/mips/mips32-dspr2/mul_s_ph.c         |   25 +
 tests/tcg/mips/mips32-dspr2/muleq_s_w_phl.c    |   40 +
 tests/tcg/mips/mips32-dspr2/mulq_rs_w.c        |   36 +
 tests/tcg/mips/mips32-dspr2/mulq_s_ph.c        |   25 +
 tests/tcg/mips/mips32-dspr2/mulq_s_w.c         |   36 +
 tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c       |   29 +
 tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c    |   29 +
 tests/tcg/mips/mips32-dspr2/precr_qb_ph.c      |   21 +
 tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c   |   32 +
 tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c |   32 +
 tests/tcg/mips/mips32-dspr2/prepend.c          |   30 +
 tests/tcg/mips/mips32-dspr2/shra_qb.c          |   30 +
 tests/tcg/mips/mips32-dspr2/shra_r_qb.c        |   30 +
 tests/tcg/mips/mips32-dspr2/shrav_qb.c         |   32 +
 tests/tcg/mips/mips32-dspr2/shrav_r_qb.c       |   32 +
 tests/tcg/mips/mips32-dspr2/shrl_ph.c          |   20 +
 tests/tcg/mips/mips32-dspr2/shrlv_ph.c         |   21 +
 tests/tcg/mips/mips32-dspr2/subqh_ph.c         |   21 +
 tests/tcg/mips/mips32-dspr2/subqh_r_ph.c       |   21 +
 tests/tcg/mips/mips32-dspr2/subqh_r_w.c        |   21 +
 tests/tcg/mips/mips32-dspr2/subqh_w.c          |   21 +
 tests/tcg/mips/mips32-dspr2/subu_ph.c          |   25 +
 tests/tcg/mips/mips32-dspr2/subu_s_ph.c        |   25 +
 tests/tcg/mips/mips32-dspr2/subuh_qb.c         |   21 +
 tests/tcg/mips/mips32-dspr2/subuh_r_qb.c       |   21 +
 164 files changed, 9770 insertions(+), 24 deletions(-)
 create mode 100644 target-mips/dsp_helper.c
 create mode 100644 tests/tcg/mips/mips32-dsp/Makefile
 create mode 100644 tests/tcg/mips/mips32-dsp/absq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/absq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addsc.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addu_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addu_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addwc.c
 create mode 100644 tests/tcg/mips/mips32-dsp/bitrev.c
 create mode 100644 tests/tcg/mips/mips32-dsp/bposge32.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_eq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_le_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_lt_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpau_h_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpau_h_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpdp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpdpv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_s_h.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_s_h.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/insv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lbux.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lhx.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lwx.c
 create mode 100644 tests/tcg/mips/mips32-dsp/madd.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maddu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_s_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_s_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mfhi.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mflo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/modsub.c
 create mode 100644 tests/tcg/mips/mips32-dsp/msub.c
 create mode 100644 tests/tcg/mips/mips32-dsp/msubu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mthi.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mthlip.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mtlo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mulq_rs_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mult.c
 create mode 100644 tests/tcg/mips/mips32-dsp/multu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/packrl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/pick_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/pick_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceq_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceq_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/raddu_w_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/rddsp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/repl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/repl_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/replv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/replv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shilo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shilov.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrl_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrlv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subu_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subu_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/wrdsp.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/Makefile
 create mode 100644 tests/tcg/mips/mips32-dspr2/absq_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addu_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addu_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/adduh_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/adduh_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/append.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/balign.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpax_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dps_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mul_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mul_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/muleq_s_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/prepend.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shra_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shra_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrav_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrav_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrlv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subu_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subu_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subuh_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subuh_r_qb.c
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH v4 1/11 Add MIPS DSP internal functions

Add internal functions used by MIPS DSP helper functions.

---
 Makefile.target          |    3 +
 target-mips/dsp_helper.c |  973 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 976 insertions(+), 0 deletions(-)
 create mode 100644 target-mips/dsp_helper.c
Makefile.target +3 -0
index 44b2e83..83b2dfc 100644
@@ -99,6 +99,9 @@ endif
 libobj-$(TARGET_SPARC) += int32_helper.o
 libobj-$(TARGET_SPARC64) += int64_helper.o
 libobj-$(TARGET_ALPHA) += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
+ifeq ($(TARGET_BASE_ARCH), mips)
+libobj-y += dsp_helper.o
+endif
 
 libobj-y += disas.o
 libobj-$(CONFIG_TCI_DIS) += tci-dis.o
target-mips/dsp_helper.c new file +973 -0

973 lines not on this page · raw message

Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH v4 2/11 Use correct acc value to index cpu_HI/cpu_LO rather than using a fix number

In reply to Jia Liu

There are 4 accumulator registers (acc) used by MIPS ASE DSP instructions. Each accumulator register is composed of by HIGH and LOW part. Use correct acc value to index cpu_HI/cpu_LO rather than using a fix number (i.e. zero).

---
 target-mips/translate.c |   56 ++++++++++++++++++++++++++++------------------
 1 files changed, 34 insertions(+), 22 deletions(-)
target-mips/translate.c +34 -22
index a663b74..f869146 100644
@@ -1972,6 +1972,7 @@ static void gen_shift (CPUMIPSState *env, DisasContext *ctx, uint32_t opc,
 static void gen_HILO (DisasContext *ctx, uint32_t opc, int reg)
 {
     const char *opn = "hilo";
+    unsigned int acc;
 
     if (reg == 0 && (opc == OPC_MFHI || opc == OPC_MFLO)) {
         /* Treat as NOP. */
@@ -1980,25 +1981,29 @@ static void gen_HILO (DisasContext *ctx, uint32_t opc, int reg)
     }
     switch (opc) {
     case OPC_MFHI:
-        tcg_gen_mov_tl(cpu_gpr[reg], cpu_HI[0]);
+        acc = ((ctx->opcode) >> 21) & 0x03;
+        tcg_gen_mov_tl(cpu_gpr[reg], cpu_HI[acc]);
         opn = "mfhi";
         break;
     case OPC_MFLO:
-        tcg_gen_mov_tl(cpu_gpr[reg], cpu_LO[0]);
+        acc = ((ctx->opcode) >> 21) & 0x03;
+        tcg_gen_mov_tl(cpu_gpr[reg], cpu_LO[acc]);
         opn = "mflo";
         break;
     case OPC_MTHI:
+        acc = ((ctx->opcode) >> 11) & 0x03;
         if (reg != 0)
-            tcg_gen_mov_tl(cpu_HI[0], cpu_gpr[reg]);
+            tcg_gen_mov_tl(cpu_HI[acc], cpu_gpr[reg]);
         else
-            tcg_gen_movi_tl(cpu_HI[0], 0);
+            tcg_gen_movi_tl(cpu_HI[acc], 0);
         opn = "mthi";
         break;
     case OPC_MTLO:
+        acc = ((ctx->opcode) >> 11) & 0x03;
         if (reg != 0)
-            tcg_gen_mov_tl(cpu_LO[0], cpu_gpr[reg]);
+            tcg_gen_mov_tl(cpu_LO[acc], cpu_gpr[reg]);
         else
-            tcg_gen_movi_tl(cpu_LO[0], 0);
+            tcg_gen_movi_tl(cpu_LO[acc], 0);
         opn = "mtlo";
         break;
     }
@@ -2011,6 +2016,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
 {
     const char *opn = "mul/div";
     TCGv t0, t1;
+    unsigned int acc;
 
     switch (opc) {
     case OPC_DIV:
@@ -2073,6 +2079,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
         {
             TCGv_i64 t2 = tcg_temp_new_i64();
             TCGv_i64 t3 = tcg_temp_new_i64();
+           acc = (ctx->opcode >> 11) & 0x03;
 
             tcg_gen_ext_tl_i64(t2, t0);
             tcg_gen_ext_tl_i64(t3, t1);
@@ -2082,8 +2089,8 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
             tcg_gen_shri_i64(t2, t2, 32);
             tcg_gen_trunc_i64_tl(t1, t2);
             tcg_temp_free_i64(t2);
-            tcg_gen_ext32s_tl(cpu_LO[0], t0);
-            tcg_gen_ext32s_tl(cpu_HI[0], t1);
+            tcg_gen_ext32s_tl(cpu_LO[acc], t0);
+            tcg_gen_ext32s_tl(cpu_HI[acc], t1);
         }
         opn = "mult";
         break;
@@ -2091,6 +2098,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
         {
             TCGv_i64 t2 = tcg_temp_new_i64();
             TCGv_i64 t3 = tcg_temp_new_i64();
+           acc = (ctx->opcode >> 11) & 0x03;
 
             tcg_gen_ext32u_tl(t0, t0);
             tcg_gen_ext32u_tl(t1, t1);
@@ -2102,8 +2110,8 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
             tcg_gen_shri_i64(t2, t2, 32);
             tcg_gen_trunc_i64_tl(t1, t2);
             tcg_temp_free_i64(t2);
-            tcg_gen_ext32s_tl(cpu_LO[0], t0);
-            tcg_gen_ext32s_tl(cpu_HI[0], t1);
+            tcg_gen_ext32s_tl(cpu_LO[acc], t0);
+            tcg_gen_ext32s_tl(cpu_HI[acc], t1);
         }
         opn = "multu";
         break;
@@ -2150,19 +2158,20 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
         {
             TCGv_i64 t2 = tcg_temp_new_i64();
             TCGv_i64 t3 = tcg_temp_new_i64();
+           acc = (ctx->opcode >> 11) & 0x03;
 
             tcg_gen_ext_tl_i64(t2, t0);
             tcg_gen_ext_tl_i64(t3, t1);
             tcg_gen_mul_i64(t2, t2, t3);
-            tcg_gen_concat_tl_i64(t3, cpu_LO[0], cpu_HI[0]);
+            tcg_gen_concat_tl_i64(t3, cpu_LO[acc], cpu_HI[acc]);
             tcg_gen_add_i64(t2, t2, t3);
             tcg_temp_free_i64(t3);
             tcg_gen_trunc_i64_tl(t0, t2);
             tcg_gen_shri_i64(t2, t2, 32);
             tcg_gen_trunc_i64_tl(t1, t2);
             tcg_temp_free_i64(t2);
-            tcg_gen_ext32s_tl(cpu_LO[0], t0);
-            tcg_gen_ext32s_tl(cpu_HI[0], t1);
+            tcg_gen_ext32s_tl(cpu_LO[acc], t0);
+            tcg_gen_ext32s_tl(cpu_HI[acc], t1);
         }
         opn = "madd";
         break;
@@ -2170,21 +2179,22 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
        {
             TCGv_i64 t2 = tcg_temp_new_i64();
             TCGv_i64 t3 = tcg_temp_new_i64();
+           acc = (ctx->opcode >> 11) & 0x03;
 
             tcg_gen_ext32u_tl(t0, t0);
             tcg_gen_ext32u_tl(t1, t1);
             tcg_gen_extu_tl_i64(t2, t0);
             tcg_gen_extu_tl_i64(t3, t1);
             tcg_gen_mul_i64(t2, t2, t3);
-            tcg_gen_concat_tl_i64(t3, cpu_LO[0], cpu_HI[0]);
+            tcg_gen_concat_tl_i64(t3, cpu_LO[acc], cpu_HI[acc]);
             tcg_gen_add_i64(t2, t2, t3);
             tcg_temp_free_i64(t3);
             tcg_gen_trunc_i64_tl(t0, t2);
             tcg_gen_shri_i64(t2, t2, 32);
             tcg_gen_trunc_i64_tl(t1, t2);
             tcg_temp_free_i64(t2);
-            tcg_gen_ext32s_tl(cpu_LO[0], t0);
-            tcg_gen_ext32s_tl(cpu_HI[0], t1);
+            tcg_gen_ext32s_tl(cpu_LO[acc], t0);
+            tcg_gen_ext32s_tl(cpu_HI[acc], t1);
         }
         opn = "maddu";
         break;
@@ -2192,19 +2202,20 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
         {
             TCGv_i64 t2 = tcg_temp_new_i64();
             TCGv_i64 t3 = tcg_temp_new_i64();
+           acc = (ctx->opcode >> 11) & 0x03;
 
             tcg_gen_ext_tl_i64(t2, t0);
             tcg_gen_ext_tl_i64(t3, t1);
             tcg_gen_mul_i64(t2, t2, t3);
-            tcg_gen_concat_tl_i64(t3, cpu_LO[0], cpu_HI[0]);
+            tcg_gen_concat_tl_i64(t3, cpu_LO[acc], cpu_HI[acc]);
             tcg_gen_sub_i64(t2, t3, t2);
             tcg_temp_free_i64(t3);
             tcg_gen_trunc_i64_tl(t0, t2);
             tcg_gen_shri_i64(t2, t2, 32);
             tcg_gen_trunc_i64_tl(t1, t2);
             tcg_temp_free_i64(t2);
-            tcg_gen_ext32s_tl(cpu_LO[0], t0);
-            tcg_gen_ext32s_tl(cpu_HI[0], t1);
+            tcg_gen_ext32s_tl(cpu_LO[acc], t0);
+            tcg_gen_ext32s_tl(cpu_HI[acc], t1);
         }
         opn = "msub";
         break;
@@ -2212,21 +2223,22 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
         {
             TCGv_i64 t2 = tcg_temp_new_i64();
             TCGv_i64 t3 = tcg_temp_new_i64();
+           acc = (ctx->opcode >> 11) & 0x03;
 
             tcg_gen_ext32u_tl(t0, t0);
             tcg_gen_ext32u_tl(t1, t1);
             tcg_gen_extu_tl_i64(t2, t0);
             tcg_gen_extu_tl_i64(t3, t1);
             tcg_gen_mul_i64(t2, t2, t3);
-            tcg_gen_concat_tl_i64(t3, cpu_LO[0], cpu_HI[0]);
+            tcg_gen_concat_tl_i64(t3, cpu_LO[acc], cpu_HI[acc]);
             tcg_gen_sub_i64(t2, t3, t2);
             tcg_temp_free_i64(t3);
             tcg_gen_trunc_i64_tl(t0, t2);
             tcg_gen_shri_i64(t2, t2, 32);
             tcg_gen_trunc_i64_tl(t1, t2);
             tcg_temp_free_i64(t2);
-            tcg_gen_ext32s_tl(cpu_LO[0], t0);
-            tcg_gen_ext32s_tl(cpu_HI[0], t1);
+            tcg_gen_ext32s_tl(cpu_LO[acc], t0);
+            tcg_gen_ext32s_tl(cpu_HI[acc], t1);
         }
         opn = "msubu";
         break;
Signature · 1 line
1.7.5.4
author
#3 lore raw

PATCH v4 3/11 Add MIPS DSP Branch instruction Support

In reply to Jia Liu

Add MIPS DSP Branch instruction Support.

---
 target-mips/translate.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)
target-mips/translate.c +19 -2
index f869146..8f8daf2 100644
@@ -331,6 +331,11 @@ enum {
     OPC_DSHD     = (0x05 << 6) | OPC_DBSHFL,
 };
 
+/* MIPS DSP REGIMM opcodes */
+enum {
+    OPC_BPOSGE32 = (0x1C << 16) | OPC_REGIMM,
+};
+
 /* Coprocessor 0 (rs field) */
 #define MASK_CP0(op)       MASK_OP_MAJOR(op) | (op & (0x1F << 21))
 
@@ -2755,6 +2760,12 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,
         }
         btgt = ctx->pc + insn_bytes + offset;
         break;
+    case OPC_BPOSGE32:
+        t0 = cpu_dspctrl;
+        tcg_gen_andi_i32(t0, t0, 0x3F);
+        bcond_compute = 1;
+        btgt = ctx->pc + insn_bytes + offset;
+        break;
     case OPC_J:
     case OPC_JAL:
     case OPC_JALX:
@@ -2943,6 +2954,10 @@ static void gen_compute_branch (DisasContext *ctx, uint32_t opc,
             tcg_gen_setcondi_tl(TCG_COND_LT, bcond, t0, 0);
             MIPS_DEBUG("bltzl %s, " TARGET_FMT_lx, regnames[rs], btgt);
             goto likely;
+        case OPC_BPOSGE32:
+            tcg_gen_setcondi_tl(TCG_COND_GE, bcond, t0, 32);
+            MIPS_DEBUG("bposge32 %s, " TARGET_FMT_lx, t0, btgt);
+            goto not_likely;
         case OPC_BLTZALS:
         case OPC_BLTZAL:
             ctx->hflags |= (opc == OPC_BLTZALS
@@ -11180,8 +11195,6 @@ static void decode_micromips32_opc (CPUMIPSState *env, DisasContext *ctx,
             *is_branch = 1;
             break;
         case BPOSGE64:
-        case BPOSGE32:
-            /* MIPS DSP: not implemented */
             /* Fall through */
         default:
             MIPS_INVAL("pool32i");
@@ -12091,6 +12104,10 @@ static void decode_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch)
             check_insn(env, ctx, ISA_MIPS32R2);
             /* Treat as NOP. */
             break;
+        case OPC_BPOSGE32:    /* MIPS DSP branch */
+            gen_compute_branch(ctx, op1, 4, -1, -2, (int32_t)imm << 2);
+            *is_branch = 1;
+            break;
         default:            /* Invalid */
             MIPS_INVAL("regimm");
             generate_exception(ctx, EXCP_RI);
Signature · 1 line
1.7.5.4
author
#4 lore raw

PATCH v4 4/11 Add MIPS DSP Load instructions Support

In reply to Jia Liu

Add MIPS DSP Load instructions Support.

---
 target-mips/translate.c |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)
target-mips/translate.c +47 -0
index 8f8daf2..608f6de 100644
@@ -312,6 +312,10 @@ enum {
     OPC_MODU_G_2E   = 0x23 | OPC_SPECIAL3,
     OPC_DMOD_G_2E   = 0x26 | OPC_SPECIAL3,
     OPC_DMODU_G_2E  = 0x27 | OPC_SPECIAL3,
+
+    /* MIPS DSP Load */
+    OPC_LX_DSP         = 0x0A | OPC_SPECIAL3,
+
 };
 
 /* BSHFL opcodes */
@@ -336,6 +340,14 @@ enum {
     OPC_BPOSGE32 = (0x1C << 16) | OPC_REGIMM,
 };
 
+#define MASK_LX(op) (MASK_SPECIAL3(op) | (op & (0x1F << 6)))
+/* MIPS DSP Load */
+enum {
+    OPC_LBUX = (0x06 << 6) | OPC_LX_DSP,
+    OPC_LHX  = (0x04 << 6) | OPC_LX_DSP,
+    OPC_LWX  = (0x00 << 6) | OPC_LX_DSP,
+};
+
 /* Coprocessor 0 (rs field) */
 #define MASK_CP0(op)       MASK_OP_MAJOR(op) | (op & (0x1F << 21))
 
@@ -12062,6 +12074,41 @@ static void decode_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch)
             check_insn(env, ctx, INSN_LOONGSON2E);
             gen_loongson_integer(ctx, op1, rd, rs, rt);
             break;
+        case OPC_LX_DSP:
+            op2 = MASK_LX(ctx->opcode);
+            switch (op2) {
+            case OPC_LBUX:
+                {
+                    TCGv addr = tcg_temp_new();
+
+                    save_cpu_state(ctx, 1);
+                    gen_op_addr_add(ctx, addr, cpu_gpr[rs], cpu_gpr[rt]);
+                    op_ld_lbu(cpu_gpr[rd], addr, ctx);
+                    tcg_temp_free_i32(addr);
+                    break;
+                }
+            case OPC_LHX:
+                {
+                    TCGv addr = tcg_temp_new();
+
+                    save_cpu_state(ctx, 1);
+                    gen_op_addr_add(ctx, addr, cpu_gpr[rs], cpu_gpr[rt]);
+                    op_ld_lh(cpu_gpr[rd], addr, ctx);
+                    tcg_temp_free_i32(addr);
+                    break;
+                }
+            case OPC_LWX:
+                {
+                    TCGv addr = tcg_temp_new();
+
+                    save_cpu_state(ctx, 1);
+                    gen_op_addr_add(ctx, addr, cpu_gpr[rs], cpu_gpr[rt]);
+                    op_ld_lw(cpu_gpr[rd], addr, ctx);
+                    tcg_temp_free_i32(addr);
+                    break;
+                }
+            }
+            break;
 #if defined(TARGET_MIPS64)
         case OPC_DEXTM ... OPC_DEXT:
         case OPC_DINSM ... OPC_DINS:
Signature · 1 line
1.7.5.4
#5 lore raw

Re: [Qemu-devel] [PATCH V4 04/11] Add MIPS DSP Load instructions Support

target-mips/translate.c static void decode_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch) · line 12096

Quoted 3 lines · Jia Liu
target-mips/translate.c +3 -0
+                    save_cpu_state(ctx, 1);
+                    gen_op_addr_add(ctx, addr, cpu_gpr[rs], cpu_gpr[rt]);
+                    op_ld_lh(cpu_gpr[rd], addr, ctx);

You should't need to save pc state in these; this should be comparable to

Quoted 4 lines
    case OPC_LB:
        save_cpu_state(ctx, 0);
        op_ld_lb(t0, t0, ctx);
        gen_store_gpr(t0, rt);

r~

author
#6 lore raw

PATCH v4 5/11 Add MIPS DSP Arithmetic instructions Support

In reply to Jia Liu

Add MIPS DSP Arithmetic instructions Support.

---
 target-mips/dsp_helper.c |  876 ++++++++++++++++++++++++++++++++++++++++++++++
 target-mips/helper.h     |   55 +++
 target-mips/translate.c  |  288 +++++++++++++++-
 3 files changed, 1218 insertions(+), 1 deletions(-)
target-mips/dsp_helper.c +876 -0
index 4137e49..5dbddc1 100644
@@ -971,3 +971,879 @@ static inline uint8_t mipsdsp_satu8_sub(CPUMIPSState *env, uint8_t a, uint8_t b)
     return result;
 }
 /*** MIPS DSP internal functions end ***/
+
+#define MIPSDSP_LHI 0xFFFFFFFF00000000ull
+#define MIPSDSP_LLO 0x00000000FFFFFFFFull
+#define MIPSDSP_HI  0xFFFF0000
+#define MIPSDSP_LO  0x0000FFFF
+#define MIPSDSP_Q3  0xFF000000
+#define MIPSDSP_Q2  0x00FF0000
+#define MIPSDSP_Q1  0x0000FF00
+#define MIPSDSP_Q0  0x000000FF
+
+/** DSP Arithmetic Sub-class insns **/
+uint32_t helper_addq_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t  rsh, rsl, rth, rtl, temph, templ;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    temph = mipsdsp_add_i16(env, rsh, rth);
+    templ = mipsdsp_add_i16(env, rsl, rtl);
+    rd = ((unsigned int)temph << 16) | ((unsigned int)templ & 0xFFFF);
+
+    return rd;
+}
+
+uint32_t helper_addq_s_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl, temph, templ;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    temph = mipsdsp_sat_add_i16(env, rsh, rth);
+    templ = mipsdsp_sat_add_i16(env, rsl, rtl);
+    rd = ((uint32_t)temph << 16) | ((uint32_t)templ & 0xFFFF);
+
+    return rd;
+}
+
+uint32_t helper_addq_s_w(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    rd = mipsdsp_sat_add_i32(env, rs, rt);
+    return rd;
+}
+
+uint32_t helper_addu_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    uint8_t  rs0, rs1, rs2, rs3;
+    uint8_t  rt0, rt1, rt2, rt3;
+    uint8_t  temp0, temp1, temp2, temp3;
+
+    rs0 =  rs & MIPSDSP_Q0;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+
+    rt0 =  rt & MIPSDSP_Q0;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+
+    temp0 = mipsdsp_add_u8(env, rs0, rt0);
+    temp1 = mipsdsp_add_u8(env, rs1, rt1);
+    temp2 = mipsdsp_add_u8(env, rs2, rt2);
+    temp3 = mipsdsp_add_u8(env, rs3, rt3);
+
+    rd = (((uint32_t)temp3 << 24) & MIPSDSP_Q3) | \
+         (((uint32_t)temp2 << 16) & MIPSDSP_Q2) | \
+         (((uint32_t)temp1 <<  8) & MIPSDSP_Q1) | \
+         ((uint32_t)temp0         & MIPSDSP_Q0);
+
+    return rd;
+}
+
+uint32_t helper_addu_s_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    uint8_t rs0, rs1, rs2, rs3;
+    uint8_t rt0, rt1, rt2, rt3;
+    uint8_t temp0, temp1, temp2, temp3;
+
+    rs0 =  rs & MIPSDSP_Q0;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+
+    rt0 =  rt & MIPSDSP_Q0;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+
+    temp0 = mipsdsp_sat_add_u8(env, rs0, rt0);
+    temp1 = mipsdsp_sat_add_u8(env, rs1, rt1);
+    temp2 = mipsdsp_sat_add_u8(env, rs2, rt2);
+    temp3 = mipsdsp_sat_add_u8(env, rs3, rt3);
+
+    rd = (((uint8_t)temp3 << 24) & MIPSDSP_Q3) | \
+         (((uint8_t)temp2 << 16) & MIPSDSP_Q2) | \
+         (((uint8_t)temp1 <<  8) & MIPSDSP_Q1) | \
+         ((uint8_t)temp0         & MIPSDSP_Q0);
+
+    return rd;
+}
+
+uint32_t helper_adduh_qb(uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    uint8_t  rs0, rs1, rs2, rs3;
+    uint8_t  rt0, rt1, rt2, rt3;
+    uint8_t  temp0, temp1, temp2, temp3;
+
+    rs0 =  rs & MIPSDSP_Q0;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+
+    rt0 =  rt & MIPSDSP_Q0;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+
+    temp0 = mipsdsp_rshift1_add_u8(rs0, rt0);
+    temp1 = mipsdsp_rshift1_add_u8(rs1, rt1);
+    temp2 = mipsdsp_rshift1_add_u8(rs2, rt2);
+    temp3 = mipsdsp_rshift1_add_u8(rs3, rt3);
+
+    rd = (((uint32_t)temp3 << 24) & MIPSDSP_Q3) | \
+         (((uint32_t)temp2 << 16) & MIPSDSP_Q2) | \
+         (((uint32_t)temp1 <<  8) & MIPSDSP_Q1) | \
+         ((uint32_t)temp0         & MIPSDSP_Q0);
+
+    return rd;
+}
+
+uint32_t helper_adduh_r_qb(uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    uint8_t  rs0, rs1, rs2, rs3;
+    uint8_t  rt0, rt1, rt2, rt3;
+    uint8_t  temp0, temp1, temp2, temp3;
+
+    rs0 =  rs & MIPSDSP_Q0;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+
+    rt0 =  rt & MIPSDSP_Q0;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+
+    temp0 = mipsdsp_rrshift1_add_u8(rs0, rt0);
+    temp1 = mipsdsp_rrshift1_add_u8(rs1, rt1);
+    temp2 = mipsdsp_rrshift1_add_u8(rs2, rt2);
+    temp3 = mipsdsp_rrshift1_add_u8(rs3, rt3);
+
+    rd = (((uint32_t)temp3 << 24) & MIPSDSP_Q3) | \
+         (((uint32_t)temp2 << 16) & MIPSDSP_Q2) | \
+         (((uint32_t)temp1 <<  8) & MIPSDSP_Q1) | \
+         ((uint32_t)temp0         & MIPSDSP_Q0);
+
+    return rd;
+}
+
+uint32_t helper_addu_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl, temph, templ;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    temph = mipsdsp_add_u16(env, rsh, rth);
+    templ = mipsdsp_add_u16(env, rsl, rtl);
+    rd = ((uint32_t)temph << 16) | ((uint32_t)templ & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_addu_s_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl, temph, templ;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    temph = mipsdsp_sat_add_u16(env, rsh, rth);
+    templ = mipsdsp_sat_add_u16(env, rsl, rtl);
+    rd = ((uint32_t)temph << 16) | ((uint32_t)templ & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_addqh_ph(uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    int16_t rsh, rsl, rth, rtl, temph, templ;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    temph = mipsdsp_rshift1_add_q16(rsh, rth);
+    templ = mipsdsp_rshift1_add_q16(rsl, rtl);
+    rd = ((uint32_t)temph << 16) | ((uint32_t)templ & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_addqh_r_ph(uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    int16_t rsh, rsl, rth, rtl, temph, templ;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    temph = mipsdsp_rrshift1_add_q16(rsh, rth);
+    templ = mipsdsp_rrshift1_add_q16(rsl, rtl);
+    rd = ((uint32_t)temph << 16) | ((uint32_t)templ & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_addqh_w(uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+
+    rd = mipsdsp_rshift1_add_q32(rs, rt);
+
+    return rd;
+}
+
+uint32_t helper_addqh_r_w(uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+
+    rd = mipsdsp_rrshift1_add_q32(rs, rt);
+
+    return rd;
+}
+
+uint32_t helper_subq_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl;
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_sub_i16(env, rsh, rth);
+    tempA = mipsdsp_sub_i16(env, rsl, rtl);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_subq_s_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl;
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_sat16_sub(env, rsh, rth);
+    tempA = mipsdsp_sat16_sub(env, rsl, rtl);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_subq_s_w(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+
+    rd = mipsdsp_sat32_sub(env, rs, rt);
+
+    return rd;
+}
+
+uint32_t helper_subu_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint8_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    tempD = mipsdsp_sub_u8(env, rs3, rt3);
+    tempC = mipsdsp_sub_u8(env, rs2, rt2);
+    tempB = mipsdsp_sub_u8(env, rs1, rt1);
+    tempA = mipsdsp_sub_u8(env, rs0, rt0);
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+    return rd;
+}
+
+uint32_t helper_subu_s_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint8_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    tempD = mipsdsp_satu8_sub(env, rs3, rt3);
+    tempC = mipsdsp_satu8_sub(env, rs2, rt2);
+    tempB = mipsdsp_satu8_sub(env, rs1, rt1);
+    tempA = mipsdsp_satu8_sub(env, rs0, rt0);
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_subuh_qb(uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint8_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    tempD = ((uint16_t)rs3 - (uint16_t)rt3) >> 1;
+    tempC = ((uint16_t)rs2 - (uint16_t)rt2) >> 1;
+    tempB = ((uint16_t)rs1 - (uint16_t)rt1) >> 1;
+    tempA = ((uint16_t)rs0 - (uint16_t)rt0) >> 1;
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_subuh_r_qb(uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint8_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    tempD = ((uint16_t)rs3 - (uint16_t)rt3 + 1) >> 1;
+    tempC = ((uint16_t)rs2 - (uint16_t)rt2 + 1) >> 1;
+    tempB = ((uint16_t)rs1 - (uint16_t)rt1 + 1) >> 1;
+    tempA = ((uint16_t)rs0 - (uint16_t)rt0 + 1) >> 1;
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_subu_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_sub_u16_u16(env, rth, rsh);
+    tempA = mipsdsp_sub_u16_u16(env, rtl, rsl);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+    return rd;
+}
+
+uint32_t helper_subu_s_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_satu16_sub_u16_u16(env, rth, rsh);
+    tempA = mipsdsp_satu16_sub_u16_u16(env, rtl, rsl);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_subqh_ph(uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl;
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_rshift1_sub_q16(rsh, rth);
+    tempA = mipsdsp_rshift1_sub_q16(rsl, rtl);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_subqh_r_ph(uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl;
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_rrshift1_sub_q16(rsh, rth);
+    tempA = mipsdsp_rrshift1_sub_q16(rsl, rtl);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_subqh_w(uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+
+    rd = mipsdsp_rshift1_sub_q32(rs, rt);
+
+    return rd;
+}
+
+uint32_t helper_subqh_r_w(uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+
+    rd = mipsdsp_rrshift1_sub_q32(rs, rt);
+
+    return rd;
+}
+
+uint32_t helper_addsc(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    uint64_t temp, tempRs, tempRt;
+    int32_t flag;
+
+    tempRs = (uint64_t)rs & MIPSDSP_LLO;
+    tempRt = (uint64_t)rt & MIPSDSP_LLO;
+
+    temp = tempRs + tempRt;
+    flag = (temp & 0x0100000000ull) >> 32;
+    set_DSPControl_carryflag(env, flag);
+    rd = temp & MIPSDSP_LLO;
+
+    return rd;
+}
+
+uint32_t helper_addwc(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    int32_t temp32, temp31;
+    int64_t rsL, rtL, tempL;
+
+    rsL = (int32_t)rs;
+    rtL = (int32_t)rt;
+    tempL = rsL + rtL + get_DSPControl_carryflag(env);
+    temp31 = (tempL >> 31) & 0x01;
+    temp32 = (tempL >> 32) & 0x01;
+
+    if (temp31 != temp32) {
+        set_DSPControl_overflow_flag(env, 1, 20);
+    }
+
+    rd = tempL & MIPSDSP_LLO;
+
+    return rd;
+}
+
+uint32_t helper_modsub(uint32_t rs, uint32_t rt)
+{
+    int32_t decr;
+    uint16_t lastindex;
+    uint32_t rd;
+
+    decr = rt & MIPSDSP_Q0;
+    lastindex = (rt >> 8) & MIPSDSP_LO;
+
+    if (rs == 0x00000000) {
+        rd = (uint32_t)lastindex;
+    } else {
+        rd = rs - decr;
+    }
+
+    return rd;
+}
+
+uint32_t helper_raddu_w_qb(uint32_t rs)
+{
+    uint8_t  rs3, rs2, rs1, rs0;
+    uint16_t temp;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    temp = (uint16_t)rs3 + (uint16_t)rs2 + (uint16_t)rs1 + (uint16_t)rs0;
+    rd = temp;
+
+    return rd;
+}
+
+uint32_t helper_absq_s_qb(CPUMIPSState *env, uint32_t rt)
+{
+    uint32_t rd;
+    int8_t tempD, tempC, tempB, tempA;
+
+    tempD = (rt & MIPSDSP_Q3) >> 24;
+    tempC = (rt & MIPSDSP_Q2) >> 16;
+    tempB = (rt & MIPSDSP_Q1) >>  8;
+    tempA =  rt & MIPSDSP_Q0;
+
+    rd = (((uint32_t)mipsdsp_sat_abs_u8 (env, tempD) << 24) & MIPSDSP_Q3) | \
+         (((uint32_t)mipsdsp_sat_abs_u8 (env, tempC) << 16) & MIPSDSP_Q2) | \
+         (((uint32_t)mipsdsp_sat_abs_u8 (env, tempB) <<  8) & MIPSDSP_Q1) | \
+         ((uint32_t)mipsdsp_sat_abs_u8 (env, tempA) & MIPSDSP_Q0);
+
+    return rd;
+}
+
+uint32_t helper_absq_s_ph(CPUMIPSState *env, uint32_t rt)
+{
+    uint32_t rd;
+    int16_t tempA, tempB;
+
+    tempA = (rt & MIPSDSP_HI) >> 16;
+    tempB =  rt & MIPSDSP_LO;
+
+    rd = ((uint32_t)mipsdsp_sat_abs_u16 (env, tempA) << 16) | \
+         ((uint32_t)(mipsdsp_sat_abs_u16 (env, tempB)) & 0xFFFF);
+
+    return rd;
+}
+
+uint32_t helper_absq_s_w(CPUMIPSState *env, uint32_t rt)
+{
+    uint32_t rd;
+    int32_t temp;
+
+    temp = rt;
+    rd = mipsdsp_sat_abs_u32(env, temp);
+
+    return rd;
+}
+
+uint32_t helper_precr_qb_ph(uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs2, rs0, rt2, rt0;
+    uint32_t rd;
+
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs0 =  rs & MIPSDSP_Q0;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt0 =  rt & MIPSDSP_Q0;
+    rd = ((uint32_t)rs2 << 24) | ((uint32_t)rs0 << 16) | \
+         ((uint32_t)rt2 <<  8) | (uint32_t)rt0;
+
+    return rd;
+}
+
+uint32_t helper_precrq_qb_ph(uint32_t rs, uint32_t rt)
+{
+    uint8_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    tempD = (rs & MIPSDSP_Q3) >> 24;
+    tempC = (rs & MIPSDSP_Q1) >>  8;
+    tempB = (rt & MIPSDSP_Q3) >> 24;
+    tempA = (rt & MIPSDSP_Q1) >>  8;
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_precr_sra_ph_w(int sa, uint32_t rs, uint32_t rt)
+{
+    uint16_t tempB, tempA;
+
+    if (sa == 0) {
+        tempB = rt & MIPSDSP_LO;
+        tempA = rs & MIPSDSP_LO;
+    } else {
+        tempB = ((int32_t)rt >> sa) & MIPSDSP_LO;
+        tempA = ((int32_t)rs >> sa) & MIPSDSP_LO;
+    }
+    rt = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+
+    return rt;
+}
+
+uint32_t helper_precr_sra_r_ph_w(int sa, uint32_t rs, uint32_t rt)
+{
+    uint64_t tempB, tempA;
+
+    if (sa == 0) {
+        tempB = (rt & MIPSDSP_LO) << 1;
+        tempA = (rs & MIPSDSP_LO) << 1;
+    } else {
+        tempB = ((int32_t)rt >> (sa - 1)) + 1;
+        tempA = ((int32_t)rs >> (sa - 1)) + 1;
+    }
+    rt = (((tempB >> 1) & MIPSDSP_LO) << 16) | ((tempA >> 1) & MIPSDSP_LO);
+
+    return rt;
+}
+
+uint32_t helper_precrq_ph_w(uint32_t rs, uint32_t rt)
+{
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    tempB = (rs & MIPSDSP_HI) >> 16;
+    tempA = (rt & MIPSDSP_HI) >> 16;
+    rd = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_precrq_rs_ph_w(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    tempB = mipsdsp_trunc16_sat16_round(env, rs);
+    tempA = mipsdsp_trunc16_sat16_round(env, rt);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_precrqu_s_qb_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t  tempD, tempC, tempB, tempA;
+    uint16_t rsh, rsl, rth, rtl;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempD = mipsdsp_sat8_reduce_precision(env, rsh);
+    tempC = mipsdsp_sat8_reduce_precision(env, rsl);
+    tempB = mipsdsp_sat8_reduce_precision(env, rth);
+    tempA = mipsdsp_sat8_reduce_precision(env, rtl);
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_preceq_w_phl(uint32_t rt)
+{
+    uint32_t rd;
+
+    rd = rt & MIPSDSP_HI;
+
+    return rd;
+}
+
+uint32_t helper_preceq_w_phr(uint32_t rt)
+{
+    uint16_t rtl;
+    uint32_t rd;
+
+    rtl = rt & MIPSDSP_LO;
+    rd  = rtl << 16;
+
+    return rd;
+}
+
+uint32_t helper_precequ_ph_qbl(uint32_t rt)
+{
+    uint8_t  rt3, rt2;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+
+    tempB = (uint16_t)rt3 << 7;
+    tempA = (uint16_t)rt2 << 7;
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_precequ_ph_qbr(uint32_t rt)
+{
+    uint8_t  rt1, rt0;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rt1 = (rt & MIPSDSP_Q1) >> 8;
+    rt0 =  rt & MIPSDSP_Q0;
+    tempB = (uint16_t)rt1 << 7;
+    tempA = (uint16_t)rt0 << 7;
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_precequ_ph_qbla(uint32_t rt)
+{
+    uint8_t  rt3, rt1;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+
+    tempB = (uint16_t)rt3 << 7;
+    tempA = (uint16_t)rt1 << 7;
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_precequ_ph_qbra(uint32_t rt)
+{
+    uint8_t  rt2, rt0;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt0 =  rt & MIPSDSP_Q0;
+    tempB = (uint16_t)rt2 << 7;
+    tempA = (uint16_t)rt0 << 7;
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_preceu_ph_qbl(uint32_t rt)
+{
+    uint8_t  rt3, rt2;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    tempB = (uint16_t) rt3;
+    tempA = (uint16_t) rt2;
+    rd = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_preceu_ph_qbr(uint32_t rt)
+{
+    uint8_t  rt1, rt0;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rt1 = (rt & MIPSDSP_Q1) >> 8;
+    rt0 =  rt & MIPSDSP_Q0;
+    tempB = (uint16_t) rt1;
+    tempA = (uint16_t) rt0;
+    rd = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+    return rd;
+}
+
+uint32_t helper_preceu_ph_qbla(uint32_t rt)
+{
+    uint8_t  rt3, rt1;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    tempB = (uint16_t) rt3;
+    tempA = (uint16_t) rt1;
+    rd = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_preceu_ph_qbra(uint32_t rt)
+{
+    uint8_t  rt2, rt0;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt0 =  rt & MIPSDSP_Q0;
+    tempB = (uint16_t)rt2;
+    tempA = (uint16_t)rt0;
+    rd = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+    return rd;
+}
+
+#undef MIPSDSP_LHI
+#undef MIPSDSP_LLO
+#undef MIPSDSP_HI
+#undef MIPSDSP_LO
+#undef MIPSDSP_Q0
+#undef MIPSDSP_Q1
+#undef MIPSDSP_Q2
+#undef MIPSDSP_Q3
target-mips/helper.h +55 -0

59 lines not on this page · raw message

target-mips/translate.c +287 -1

312 lines not on this page · raw message

Signature · 1 line
1.7.5.4
author
#7 lore raw

PATCH v4 6/11 Add MIPS DSP GPR-Based Shift instructions Support

In reply to Jia Liu

Add MIPS DSP GPR-Based Shift instructions Support.

---
 target-mips/dsp_helper.c |  411 ++++++++++++++++++++++++++++++++++++++++++++++
 target-mips/helper.h     |   24 +++
 target-mips/translate.c  |  114 +++++++++++++
 3 files changed, 549 insertions(+), 0 deletions(-)
target-mips/dsp_helper.c +411 -0
index 5dbddc1..86f7df1 100644
@@ -1839,6 +1839,417 @@ uint32_t helper_preceu_ph_qbra(uint32_t rt)
     return rd;
 }
 
+/** DSP GPR-Based Shift Sub-class insns **/
+uint32_t helper_shll_qb(CPUMIPSState *env, int sa, uint32_t rt)
+{
+    uint8_t  rt3, rt2, rt1, rt0;
+    uint8_t  tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    tempD = mipsdsp_lshift8(env, rt3, sa);
+    tempC = mipsdsp_lshift8(env, rt2, sa);
+    tempB = mipsdsp_lshift8(env, rt1, sa);
+    tempA = mipsdsp_lshift8(env, rt0, sa);
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | ((uint32_t)tempA);
+
+    return rd;
+}
+
+uint32_t helper_shllv_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs2_0;
+    uint8_t  rt3, rt2, rt1, rt0;
+    uint8_t  tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rs2_0 = rs & 0x07;
+    rt3   = (rt & MIPSDSP_Q3) >> 24;
+    rt2   = (rt & MIPSDSP_Q2) >> 16;
+    rt1   = (rt & MIPSDSP_Q1) >>  8;
+    rt0   =  rt & MIPSDSP_Q0;
+
+    tempD = mipsdsp_lshift8(env, rt3, rs2_0);
+    tempC = mipsdsp_lshift8(env, rt2, rs2_0);
+    tempB = mipsdsp_lshift8(env, rt1, rs2_0);
+    tempA = mipsdsp_lshift8(env, rt0, rs2_0);
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shll_ph(CPUMIPSState *env, int sa, uint32_t rt)
+{
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_lshift16(env, rth, sa);
+    tempA = mipsdsp_lshift16(env, rtl, sa);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shllv_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs3_0;
+    uint16_t rth, rtl, tempB, tempA;
+    uint32_t rd;
+
+    rth   = (rt & MIPSDSP_HI) >> 16;
+    rtl   =  rt & MIPSDSP_LO;
+    rs3_0 = rs & 0x0F;
+
+    tempB = mipsdsp_lshift16(env, rth, rs3_0);
+    tempA = mipsdsp_lshift16(env, rtl, rs3_0);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shll_s_ph(CPUMIPSState *env, int sa, uint32_t rt)
+{
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_sat16_lshift(env, rth, sa);
+    tempA = mipsdsp_sat16_lshift(env, rtl, sa);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shllv_s_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs3_0;
+    uint16_t rth, rtl, tempB, tempA;
+    uint32_t rd;
+
+    rth   = (rt & MIPSDSP_HI) >> 16;
+    rtl   =  rt & MIPSDSP_LO;
+    rs3_0 = rs & 0x0F;
+
+    tempB = mipsdsp_sat16_lshift(env, rth, rs3_0);
+    tempA = mipsdsp_sat16_lshift(env, rtl, rs3_0);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shll_s_w(CPUMIPSState *env, int sa, uint32_t rt)
+{
+    uint32_t temp, rd;
+
+    temp = mipsdsp_sat32_lshift(env, rt, sa);
+    rd   = temp;
+
+    return rd;
+}
+
+uint32_t helper_shllv_s_w(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs4_0;
+    uint32_t rd;
+
+    rs4_0 = rs & 0x1F;
+    rd = mipsdsp_sat32_lshift(env, rt, rs4_0);
+
+    return rd;
+}
+
+uint32_t helper_shrl_qb(int sa, uint32_t rt)
+{
+    uint8_t  rt3, rt2, rt1, rt0;
+    uint8_t  tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    tempD = mipsdsp_rshift8(rt3, sa);
+    tempC = mipsdsp_rshift8(rt2, sa);
+    tempB = mipsdsp_rshift8(rt1, sa);
+    tempA = mipsdsp_rshift8(rt0, sa);
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shrlv_qb(uint32_t rs, uint32_t rt)
+{
+    uint8_t rs2_0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint8_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rs2_0 = rs & 0x07;
+    rt3   = (rt & MIPSDSP_Q3) >> 24;
+    rt2   = (rt & MIPSDSP_Q2) >> 16;
+    rt1   = (rt & MIPSDSP_Q1) >>  8;
+    rt0   =  rt & MIPSDSP_Q0;
+
+    tempD = mipsdsp_rshift8(rt3, rs2_0);
+    tempC = mipsdsp_rshift8(rt2, rs2_0);
+    tempB = mipsdsp_rshift8(rt1, rs2_0);
+    tempA = mipsdsp_rshift8(rt0, rs2_0);
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shrl_ph(int sa, uint32_t rt)
+{
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = rth >> sa;
+    tempA = rtl >> sa;
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shrlv_ph(uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs3_0;
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rs3_0 = rs & 0x0F;
+    rth   = (rt & MIPSDSP_HI) >> 16;
+    rtl   =  rt & MIPSDSP_LO;
+
+    tempB = rth >> rs3_0;
+    tempA = rtl >> rs3_0;
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shra_qb(int sa, uint32_t rt)
+{
+    int8_t  rt3, rt2, rt1, rt0;
+    uint8_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    tempD = rt3 >> sa;
+    tempC = rt2 >> sa;
+    tempB = rt1 >> sa;
+    tempA = rt0 >> sa;
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+          ((uint32_t)tempB << 8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shra_r_qb(int sa, uint32_t rt)
+{
+    int8_t  rt3, rt2, rt1, rt0;
+    uint16_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    if (sa == 0) {
+        tempD = rt3 & 0x00FF;
+        tempC = rt2 & 0x00FF;
+        tempB = rt1 & 0x00FF;
+        tempA = rt0 & 0x00FF;
+    } else {
+        tempD = ((int16_t)rt3 >> (sa - 1)) + 1;
+        tempC = ((int16_t)rt2 >> (sa - 1)) + 1;
+        tempB = ((int16_t)rt1 >> (sa - 1)) + 1;
+        tempA = ((int16_t)rt0 >> (sa - 1)) + 1;
+    }
+
+    rd = ((uint32_t)((tempD >> 1) & 0x00FF) << 24) | \
+         ((uint32_t)((tempC >> 1) & 0x00FF) << 16) | \
+         ((uint32_t)((tempB >> 1) & 0x00FF) <<  8) | \
+         (uint32_t)((tempA >>  1) & 0x00FF) ;
+
+    return rd;
+}
+
+uint32_t helper_shrav_qb(uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs2_0;
+    int8_t   rt3, rt2, rt1, rt0;
+    uint8_t  tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rs2_0 = rs & 0x07;
+    rt3   = (rt & MIPSDSP_Q3) >> 24;
+    rt2   = (rt & MIPSDSP_Q2) >> 16;
+    rt1   = (rt & MIPSDSP_Q1) >>  8;
+    rt0   =  rt & MIPSDSP_Q0;
+
+    if (rs2_0 == 0) {
+        tempD = rt3;
+        tempC = rt2;
+        tempB = rt1;
+        tempA = rt0;
+    } else {
+        tempD = rt3 >> rs2_0;
+        tempC = rt2 >> rs2_0;
+        tempB = rt1 >> rs2_0;
+        tempA = rt0 >> rs2_0;
+    }
+
+    rd = ((uint32_t)tempD << 24) | ((uint32_t)tempC << 16) | \
+         ((uint32_t)tempB <<  8) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shrav_r_qb(uint32_t rs, uint32_t rt)
+{
+    uint8_t rs2_0;
+    int8_t  rt3, rt2, rt1, rt0;
+    uint16_t tempD, tempC, tempB, tempA;
+    uint32_t rd;
+
+    rs2_0 = rs & 0x07;
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    if (rs2_0 == 0) {
+        tempD = (int16_t)rt3 << 1;
+        tempC = (int16_t)rt2 << 1;
+        tempB = (int16_t)rt1 << 1;
+        tempA = (int16_t)rt0 << 1;
+    } else {
+        tempD = ((int16_t)rt3 >> (rs2_0 - 1)) + 1;
+        tempC = ((int16_t)rt2 >> (rs2_0 - 1)) + 1;
+        tempB = ((int16_t)rt1 >> (rs2_0 - 1)) + 1;
+        tempA = ((int16_t)rt0 >> (rs2_0 - 1)) + 1;
+    }
+
+    rd = ((uint32_t)((tempD >> 1) & 0x00FF) << 24) | \
+         ((uint32_t)((tempC >> 1) & 0x00FF) << 16) | \
+         ((uint32_t)((tempB >> 1) & 0x00FF) <<  8) | \
+         (uint32_t)((tempA >>  1) & 0x00FF) ;
+
+    return rd;
+}
+
+uint32_t helper_shra_ph(int sa, uint32_t rt)
+{
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_rashift16(rth, sa);
+    tempA = mipsdsp_rashift16(rtl, sa);
+    rd = ((uint32_t)tempB << 16) | (uint32_t) tempA;
+
+    return rd;
+}
+
+uint32_t helper_shrav_ph(uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs3_0;
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rs3_0 = rs & 0x0F;
+    rth   = (rt & MIPSDSP_HI) >> 16;
+    rtl   =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_rashift16(rth, rs3_0);
+    tempA = mipsdsp_rashift16(rtl, rs3_0);
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shra_r_ph(int sa, uint32_t rt)
+{
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_rnd16_rashift(rth, sa);
+    tempA = mipsdsp_rnd16_rashift(rtl, sa);
+    rd = ((uint32_t)tempB << 16) | (uint32_t) tempA;
+
+    return rd;
+}
+
+uint32_t helper_shrav_r_ph(uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs3_0;
+    uint16_t rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t rd;
+
+    rs3_0 = rs & 0x0F;
+    rth   = (rt & MIPSDSP_HI) >> 16;
+    rtl   =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_rnd16_rashift(rth, rs3_0);
+    tempA = mipsdsp_rnd16_rashift(rtl, rs3_0);
+
+    rd = ((uint32_t)tempB << 16) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_shra_r_w(int sa, uint32_t rt)
+{
+    uint32_t rd;
+
+    rd = mipsdsp_rnd32_rashift(rt, sa);
+
+    return rd;
+}
+
+uint32_t helper_shrav_r_w(uint32_t rs, uint32_t rt)
+{
+    uint8_t rs4_0;
+    uint32_t rd;
+
+    rs4_0 = rs & 0x1F;
+    rd = mipsdsp_rnd32_rashift(rt, rs4_0);
+
+    return rd;
+}
+
 #undef MIPSDSP_LHI
 #undef MIPSDSP_LLO
 #undef MIPSDSP_HI
target-mips/helper.h +24 -0
index 2c4b5e7..14c4574 100644
@@ -352,4 +352,28 @@ DEF_HELPER_FLAGS_1(preceu_ph_qbr, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32)
 DEF_HELPER_FLAGS_1(preceu_ph_qbla, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32)
 DEF_HELPER_FLAGS_1(preceu_ph_qbra, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32)
 
+/* DSP GPR-Based Shift Sub-class insns */
+DEF_HELPER_FLAGS_3(shll_qb, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(shllv_qb, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(shll_ph, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(shllv_ph, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(shll_s_ph, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(shllv_s_ph, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(shll_s_w, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(shllv_s_w, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_2(shrl_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32)
+DEF_HELPER_FLAGS_2(shrlv_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(shrl_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32)
+DEF_HELPER_FLAGS_2(shrlv_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(shra_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32)
+DEF_HELPER_FLAGS_2(shra_r_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32)
+DEF_HELPER_FLAGS_2(shrav_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(shrav_r_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(shra_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32)
+DEF_HELPER_FLAGS_2(shrav_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(shra_r_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32)
+DEF_HELPER_FLAGS_2(shrav_r_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(shra_r_w, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32)
+DEF_HELPER_FLAGS_2(shrav_r_w, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+
 #include "def-helper.h"
target-mips/translate.c +114 -0

132 lines not on this page · raw message

Signature · 1 line
1.7.5.4
author
#8 lore raw

PATCH v4 7/11 Add MIPS DSP Multiply instructions Support

In reply to Jia Liu

Add MIPS DSP Multiply instructions Support.

---
 target-mips/dsp_helper.c |  729 ++++++++++++++++++++++++++++++++++++++++++++++
 target-mips/helper.h     |   34 +++
 target-mips/translate.c  |  264 +++++++++++++++++
 3 files changed, 1027 insertions(+), 0 deletions(-)
target-mips/dsp_helper.c +729 -0
index 86f7df1..893e915 100644
@@ -2250,6 +2250,735 @@ uint32_t helper_shrav_r_w(uint32_t rs, uint32_t rt)
     return rd;
 }
 
+/** DSP Multiply Sub-class insns **/
+uint32_t helper_muleu_s_ph_qbl(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2;
+    uint16_t tempB, tempA, rth, rtl;
+    uint32_t temp;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_mul_u8_u16(env, rs3, rth);
+    tempA = mipsdsp_mul_u8_u16(env, rs2, rtl);
+    temp = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+    rd = temp;
+    return rd;
+}
+
+uint32_t helper_muleu_s_ph_qbr(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs1, rs0;
+    uint16_t tempB, tempA;
+    uint16_t rth,   rtl;
+    uint32_t temp;
+    uint32_t rd;
+
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_mul_u8_u16(env, rs1, rth);
+    tempA = mipsdsp_mul_u8_u16(env, rs0, rtl);
+    temp = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+    rd = temp;
+    return rd;
+}
+
+uint32_t helper_mulq_rs_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t tempB, tempA, rsh, rsl, rth, rtl;
+    int32_t temp;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_rndq15_mul_q15_q15(env, rsh, rth);
+    tempA = mipsdsp_rndq15_mul_q15_q15(env, rsl, rtl);
+    temp = ((uint32_t)tempB << 16) | ((uint32_t)tempA & MIPSDSP_LO);
+    rd = temp;
+
+    return rd;
+}
+
+uint32_t helper_muleq_s_w_phl(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rth;
+    int32_t temp;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    temp = mipsdsp_mul_q15_q15_overflowflag21(env, rsh, rth);
+    rd = temp;
+
+    return rd;
+}
+
+uint32_t helper_muleq_s_w_phr(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t rsl, rtl;
+    int32_t temp;
+    uint32_t rd;
+
+    rsl = rs & MIPSDSP_LO;
+    rtl = rt & MIPSDSP_LO;
+    temp = mipsdsp_mul_q15_q15_overflowflag21(env, rsl, rtl);
+    rd = temp;
+
+    return rd;
+}
+
+void helper_dpau_h_qbl(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2;
+    uint8_t rt3, rt2;
+    uint16_t tempB, tempA;
+    uint64_t tempC, tempBL, tempAL, dotp;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    tempB = mipsdsp_mul_u8_u8(rs3, rt3);
+    tempA = mipsdsp_mul_u8_u8(rs2, rt2);
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL + tempAL;
+    tempC = (((uint64_t)env->active_tc.HI[ac] << 32) |  \
+             ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO)) + dotp;
+
+    env->active_tc.HI[ac] = (tempC & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempC & MIPSDSP_LLO;
+}
+
+void helper_dpau_h_qbr(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs1, rs0;
+    uint8_t rt1, rt0;
+    uint16_t tempB, tempA;
+    uint64_t tempC, tempBL, tempAL, dotp;
+
+    rs1 = (rs & MIPSDSP_Q1) >> 8;
+    rt1 = (rt & MIPSDSP_Q1) >> 8;
+    rs0 = (rs & MIPSDSP_Q0);
+    rt0 = (rt & MIPSDSP_Q0);
+    tempB = mipsdsp_mul_u8_u8(rs1, rt1);
+    tempA = mipsdsp_mul_u8_u8(rs0, rt0);
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL + tempAL;
+    tempC = (((uint64_t)env->active_tc.HI[ac] << 32) | \
+             ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO)) + dotp;
+
+    env->active_tc.HI[ac] = (tempC & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempC & MIPSDSP_LLO;
+}
+
+void helper_dpsu_h_qbl(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs3, rs2, rt3, rt2;
+    uint16_t tempB,  tempA;
+    uint64_t dotp, tempBL, tempAL, tempC;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+
+    tempB = mipsdsp_mul_u8_u8(rs3, rt3);
+    tempA = mipsdsp_mul_u8_u8(rs2, rt2);
+    tempBL = tempB & 0xFFFF;
+    tempAL = tempA & 0xFFFF;
+
+    dotp   = tempBL + tempAL;
+    tempC  = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+             ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    tempC -= dotp;
+
+    env->active_tc.HI[ac] = (tempC & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempC & MIPSDSP_LLO;
+}
+
+void helper_dpsu_h_qbr(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint8_t  rs1, rs0, rt1, rt0;
+    uint16_t tempB,  tempA;
+    uint64_t dotp, tempBL, tempAL, tempC;
+
+    rs1 = (rs & MIPSDSP_Q1) >> 8;
+    rs0 = (rs & MIPSDSP_Q0);
+    rt1 = (rt & MIPSDSP_Q1) >> 8;
+    rt0 = (rt & MIPSDSP_Q0);
+
+    tempB = mipsdsp_mul_u8_u8(rs1, rt1);
+    tempA = mipsdsp_mul_u8_u8(rs0, rt0);
+    tempBL = tempB & 0xFFFF;
+    tempAL = tempA & 0xFFFF;
+
+    dotp   = tempBL + tempAL;
+    tempC  = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+             ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    tempC -= dotp;
+
+    env->active_tc.HI[ac] = (tempC & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempC & MIPSDSP_LLO;
+}
+
+void helper_dpa_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    int32_t  tempA, tempB;
+    int64_t  acc, tempAL, tempBL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = (int32_t)rsh * (int32_t)rth;
+    tempA = (int32_t)rsl * (int32_t)rtl;
+    tempBL = tempB;
+    tempAL = tempA;
+
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    acc += tempBL + tempAL;
+
+    env->active_tc.HI[ac] = (acc & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
+}
+
+void helper_dpax_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    int64_t acc, dotp, tempBL, tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB  = (uint32_t)rsh * (uint32_t)rth;
+    tempA  = (uint32_t)rsl * (uint32_t)rtl;
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp =  tempBL + tempAL;
+    acc  =  ((uint64_t)env->active_tc.HI[ac] << 32) | \
+            ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    acc  += dotp;
+
+    env->active_tc.HI[ac] = (acc & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
+}
+
+void helper_dpaq_s_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    int64_t acc, dotp, tempBL, tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_mul_q15_q15(env, ac, rsh, rth);
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsl, rtl);
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL + tempAL;
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    acc += dotp;
+
+    env->active_tc.HI[ac] = (acc & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
+}
+
+void helper_dpaqx_s_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    int64_t acc, dotp, tempBL, tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_mul_q15_q15(env, ac, rsh, rtl);
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsl, rth);
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL + tempAL;
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    acc += dotp;
+
+    env->active_tc.HI[ac] = (acc & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
+}
+
+void helper_dpaqx_sa_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA, tempC62_31, tempC63;
+    int64_t acc, dotp, tempBL, tempAL, tempC;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_mul_q15_q15(env, ac, rsh, rtl);
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsl, rth);
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL + tempAL;
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    tempC = acc + dotp;
+    tempC63 = (tempC >> 63) & 0x01;
+    tempC62_31 = (tempC >> 31) & 0xFFFFFFFF;
+
+    if ((tempC63 == 0) && (tempC62_31 == 0xFFFFFFFF)) {
+        tempC = 0x80000000;
+        set_DSPControl_overflow_flag(env, 1, 16 + ac);
+    }
+
+    env->active_tc.HI[ac] = (tempC & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempC & MIPSDSP_LLO;
+}
+
+void helper_dps_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    int64_t acc, dotp, tempBL, tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB  = (int32_t)rsh * (int32_t)rth;
+    tempA  = (int32_t)rsl * (int32_t)rtl;
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp =  tempBL + tempAL;
+    acc  =  ((uint64_t)env->active_tc.HI[ac] << 32) | \
+            ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    acc  -= dotp;
+
+    env->active_tc.HI[ac] = (acc & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
+}
+
+void helper_dpsx_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    int32_t  tempB,  tempA;
+    int64_t acc, dotp, tempBL, tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = (int32_t)rsh * (int32_t)rtl;
+    tempA = (int32_t)rsl * (int32_t)rth;
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL + tempAL;
+
+    acc  = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+           ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    acc -= dotp;
+    env->active_tc.HI[ac] = (acc & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
+}
+
+void helper_dpsq_s_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    int64_t acc, dotp, tempBL, tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_mul_q15_q15(env, ac, rsh, rth);
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsl, rtl);
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL + tempAL;
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+           ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    acc -= dotp;
+
+    env->active_tc.HI[ac] = (acc & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
+}
+
+void helper_dpsqx_s_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    int64_t dotp, tempC, tempBL, tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_mul_q15_q15(env, ac, rsh, rtl);
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsl, rth);
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL + tempAL;
+    tempC = (((uint64_t)env->active_tc.HI[ac] << 32) | \
+            ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO)) - dotp;
+
+    env->active_tc.HI[ac] = (tempC & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempC & MIPSDSP_LLO;
+}
+
+void helper_dpsqx_sa_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA, tempC63, tempC62_31;
+    int64_t dotp, tempBL, tempAL, tempC;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_mul_q15_q15(env, ac, rsh, rtl);
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsl, rth);
+
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp   = tempBL + tempAL;
+    tempC  = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+             ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    tempC -= dotp;
+
+    tempC63 = (tempC >> 63) & 0x01;
+    tempC62_31 = (tempC >> 31) & 0xFFFFFFFF;
+
+    if ((tempC63 == 0) && (tempC62_31 != 0)) {
+        tempC = 0x7FFFFFFF;
+        set_DSPControl_overflow_flag(env, 1, 16 + ac);
+    }
+
+    if ((tempC63 == 1) && (tempC62_31 != 0xFFFFFFFF)) {
+        tempC = 0xFFFFFFFF80000000ull;
+        set_DSPControl_overflow_flag(env, 1, 16 + ac);
+    }
+
+    env->active_tc.HI[ac] = (tempC & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempC & MIPSDSP_LLO;
+}
+
+void helper_mulsaq_s_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    int64_t tempBL, tempAL, acc, dotp;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_mul_q15_q15(env, ac, rsh, rth);
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsl, rtl);
+    tempBL = tempB;
+    tempAL = tempA;
+    dotp = tempBL - tempAL;
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    dotp = dotp + acc;
+    env->active_tc.HI[ac] = (dotp & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  dotp & MIPSDSP_LLO;
+}
+
+void helper_dpaq_sa_l_w(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int32_t temp64, temp63, tempacc63, tempdotp63, tempDL63;
+    int64_t dotp, acc;
+    int64_t tempDL[2];
+    uint64_t temp;
+
+    dotp = mipsdsp_mul_q31_q31(env, ac, rs, rt);
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    tempDL[0] = acc + dotp;
+
+    tempacc63  = (acc >> 63) & 0x01;
+    tempdotp63 = (dotp >> 63) & 0x01;
+    tempDL63   = (tempDL[0] >> 63) & 0x01;
+
+    if (((tempacc63 == 1) && (tempdotp63 == 1)) | \
+        (((tempacc63 == 1) || (tempdotp63 == 1)) && tempDL63 == 0)) {
+        tempDL[1] = 1;
+    } else {
+        tempDL[1] = 0;
+    }
+
+    temp = tempDL[0];
+    temp64 = tempDL[1] & 0x01;
+    temp63 = (tempDL[0] >> 63) & 0x01;
+
+    if (temp64 != temp63) {
+        if (temp64 == 1) {
+            temp = 0x8000000000000000ull;
+        } else {
+            temp = 0x7FFFFFFFFFFFFFFFull;
+        }
+
+        set_DSPControl_overflow_flag(env, 1, 16 + ac);
+    }
+
+    env->active_tc.HI[ac] = (temp & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  temp & MIPSDSP_LLO;
+}
+
+void helper_dpsq_sa_l_w(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int32_t temp64, temp63, tempacc63, tempdotp63, tempDL63;
+    int64_t dotp, acc;
+    int64_t tempDL[2];
+    uint64_t temp;
+
+    dotp = mipsdsp_mul_q31_q31(env, ac, rs, rt);
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    tempDL[0] = acc - dotp;
+
+    tempacc63  = (acc >> 63) & 0x01;
+    tempdotp63 = (dotp >> 63) & 0x01;
+    tempDL63   = (tempDL[0] >> 63) & 0x01;
+
+    if (((tempacc63 == 1) && (tempdotp63 == 0)) | \
+        (((tempacc63 == 1) || (tempdotp63 == 0)) && tempDL63 == 0)) {
+        tempDL[1] = 1;
+    } else {
+        tempDL[1] = 0;
+    }
+
+    temp = tempDL[0];
+    temp64 = tempDL[1] & 0x01;
+    temp63 = (tempDL[0] >> 63) & 0x01;
+    if (temp64 != temp63) {
+        if (temp64 == 1) {
+            temp = 0x8000000000000000ull;
+        } else {
+            temp = 0x7FFFFFFFFFFFFFFFull;
+        }
+        set_DSPControl_overflow_flag(env, 1, ac + 16);
+    }
+
+    env->active_tc.HI[ac] = (temp & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  temp & MIPSDSP_LLO;
+}
+
+void helper_maq_s_w_phl(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rth;
+    int32_t  tempA;
+    int64_t tempL, tempAL, acc;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    tempA  = mipsdsp_mul_q15_q15(env, ac, rsh, rth);
+    tempAL = tempA;
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    tempL  = tempAL + acc;
+    env->active_tc.HI[ac] = (tempL & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempL & MIPSDSP_LLO;
+}
+
+void helper_maq_s_w_phr(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsl, rtl;
+    int32_t tempA;
+    int64_t tempL, tempAL, acc;
+
+    rsl = rs & MIPSDSP_LO;
+    rtl = rt & MIPSDSP_LO;
+    tempA  = mipsdsp_mul_q15_q15(env, ac, rsl, rtl);
+    tempAL = tempA;
+    acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    tempL = tempAL + acc;
+
+    env->active_tc.HI[ac] = (tempL & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempL & MIPSDSP_LLO;
+}
+
+void helper_maq_sa_w_phl(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rth;
+    int32_t tempA;
+    int64_t tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsh, rth);
+    tempA = mipsdsp_sat32_acc_q31(env, ac, tempA);
+    tempAL = tempA;
+
+    env->active_tc.HI[ac] = (tempAL & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempAL & MIPSDSP_LLO;
+}
+
+void helper_maq_sa_w_phr(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    int16_t rsl, rtl;
+    int32_t tempA;
+    int64_t tempAL;
+
+    rsl = rs & MIPSDSP_LO;
+    rtl = rs & MIPSDSP_LO;
+
+    tempA = mipsdsp_mul_q15_q15(env, ac, rsl, rtl);
+    tempA = mipsdsp_sat32_acc_q31(env, ac, tempA);
+    tempAL = tempA;
+
+    env->active_tc.HI[ac] = (tempAL & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  tempAL & MIPSDSP_LLO;
+}
+
+uint32_t helper_mul_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_mul_i16_i16(env, rsh, rth);
+    tempA = mipsdsp_mul_i16_i16(env, rsl, rtl);
+
+    rd = ((tempB & MIPSDSP_LO) << 16) | (tempA & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_mul_s_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t  rsh, rsl, rth, rtl;
+    int32_t  tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+    tempB = mipsdsp_sat16_mul_i16_i16(env, rsh, rth);
+    tempA = mipsdsp_sat16_mul_i16_i16(env, rsl, rtl);
+
+    rd = ((tempB & MIPSDSP_LO) << 16) | (tempA & MIPSDSP_LO);
+
+    return rd;
+}
+
+uint32_t helper_mulq_s_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t temp, tempB, tempA;
+    uint32_t rd;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = mipsdsp_sat16_mul_q15_q15(env, rsh, rth);
+    tempA = mipsdsp_sat16_mul_q15_q15(env, rsl, rtl);
+    temp = ((tempB & MIPSDSP_LO) << 16) | (tempA & MIPSDSP_LO);
+    rd = temp;
+
+    return rd;
+}
+
+uint32_t helper_mulq_s_w(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    int32_t tempI;
+    int64_t tempL;
+
+    if ((rs == 0x80000000) && (rt == 0x80000000)) {
+        tempL = 0x7FFFFFFF00000000ull;
+        set_DSPControl_overflow_flag(env, 1, 21);
+    } else {
+        tempL  = ((int64_t)rs * (int64_t)rt) << 1;
+    }
+    tempI = (tempL & MIPSDSP_LHI) >> 32;
+    rd = tempI;
+
+    return rd;
+}
+
+uint32_t helper_mulq_rs_w(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t rd;
+    int32_t tempI;
+    int64_t tempL;
+
+    if ((rs == 0x80000000) && (rt == 0x80000000)) {
+        tempL = 0x7FFFFFFF00000000ull;
+        set_DSPControl_overflow_flag(env, 1, 21);
+    } else {
+        tempL  = ((int64_t)rs * (int64_t)rt) << 1;
+        tempL += 0x80000000;
+    }
+    tempI = (tempL & MIPSDSP_LHI) >> 32;
+    rd = tempI;
+
+    return rd;
+}
+
+void helper_mulsa_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    int32_t tempB, tempA;
+    int64_t dotp, acc, tempBL, tempAL;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    tempB = (int32_t)rsh * (int32_t)rth;
+    tempA = (int32_t)rsl * (int32_t)rtl;
+    tempBL = tempB;
+    tempAL = tempA;
+
+    dotp = tempBL - tempAL;
+    acc  = ((int64_t)env->active_tc.HI[ac] << 32) | \
+           ((int64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    acc = acc + dotp;
+
+    env->active_tc.HI[ac] = (acc & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
+}
+
 #undef MIPSDSP_LHI
 #undef MIPSDSP_LLO
 #undef MIPSDSP_HI
target-mips/helper.h +34 -0
index 14c4574..bd6f3b5 100644
@@ -376,4 +376,38 @@ DEF_HELPER_FLAGS_2(shrav_r_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
 DEF_HELPER_FLAGS_2(shra_r_w, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32)
 DEF_HELPER_FLAGS_2(shrav_r_w, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
 
+/* DSP Multiply Sub-class insns */
+DEF_HELPER_FLAGS_3(muleu_s_ph_qbl, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(muleu_s_ph_qbr, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(mulq_rs_ph, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(muleq_s_w_phl, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(muleq_s_w_phr, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_4(dpau_h_qbl, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpau_h_qbr, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpsu_h_qbl, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpsu_h_qbr, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpa_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpax_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpaq_s_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpaqx_s_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpaqx_sa_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dps_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpsx_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpsq_s_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpsqx_s_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpsqx_sa_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(mulsaq_s_w_ph, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpaq_sa_l_w, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(dpsq_sa_l_w, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(maq_s_w_phl, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(maq_s_w_phr, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(maq_sa_w_phl, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_4(maq_sa_w_phr, 0, void, env, int, i32, i32)
+DEF_HELPER_FLAGS_3(mul_ph, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(mul_s_ph, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(mulq_s_ph, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(mulq_s_w, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(mulq_rs_w, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_4(mulsa_w_ph, 0, void, env, int, i32, i32)
+
 #include "def-helper.h"
target-mips/translate.c +264 -0

306 lines not on this page · raw message

Signature · 1 line
1.7.5.4
author
#9 lore raw

PATCH v4 8/11 Add MIPS DSP Bit/Manipulation instructions Support

In reply to Jia Liu

Add MIPS DSP Bit/Manipulation instructions Support.

---
 target-mips/dsp_helper.c |   42 +++++++++++++++++++
 target-mips/helper.h     |    4 ++
 target-mips/translate.c  |  103 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 149 insertions(+), 0 deletions(-)
target-mips/dsp_helper.c +42 -0
index 893e915..1c5e858 100644
@@ -2979,6 +2979,48 @@ void helper_mulsa_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt)
     env->active_tc.LO[ac] =  acc & MIPSDSP_LLO;
 }
 
+/** DSP Bit/Manipulation Sub-class insns **/
+uint32_t helper_bitrev(uint32_t rt)
+{
+    int32_t temp;
+    uint32_t rd;
+    int i, last;
+
+    temp = rt & MIPSDSP_LO;
+    rd = 0;
+    for (i = 0; i < 16; i++) {
+        last = temp % 2;
+        temp = temp >> 1;
+        rd = rd | (last << (15 - i));
+    }
+
+    return rd;
+}
+
+uint32_t helper_insv(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint32_t pos, size, msb, lsb, rs_f, rt_f;
+    uint32_t temp, temprs, temprt;
+    target_ulong dspc;
+
+    dspc = env->active_tc.DSPControl;
+    pos  = dspc & 0x1F;
+    size = (dspc >> 7) & 0x1F;
+    msb  = pos + size - 1;
+    lsb  = pos;
+
+    if (lsb > msb) {
+        return rt;
+    }
+
+    rs_f = (((int32_t)0x01 << (msb - lsb + 1 + 1)) - 1) << lsb;
+    rt_f = rs_f ^ 0xFFFFFFFF;
+    temprs = rs & rs_f;
+    temprt = rt & rt_f;
+    temp = temprs | temprt;
+    return temp;
+}
+
 #undef MIPSDSP_LHI
 #undef MIPSDSP_LLO
 #undef MIPSDSP_HI
target-mips/helper.h +4 -0
index bd6f3b5..669537b 100644
@@ -410,4 +410,8 @@ DEF_HELPER_FLAGS_3(mulq_s_w, 0, i32, env, i32, i32)
 DEF_HELPER_FLAGS_3(mulq_rs_w, 0, i32, env, i32, i32)
 DEF_HELPER_FLAGS_4(mulsa_w_ph, 0, void, env, int, i32, i32)
 
+/* DSP Bit/Manipulation Sub-class insns */
+DEF_HELPER_FLAGS_1(bitrev, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32)
+DEF_HELPER_FLAGS_3(insv, 0, i32, env, i32, i32)
+
 #include "def-helper.h"
target-mips/translate.c +103 -0

133 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#10 lore raw

Re: [Qemu-devel] [PATCH V4 08/11] Add MIPS DSP Bit/Manipulation instructions Support

target-mips/dsp_helper.c void helper_mulsa_w_ph(CPUMIPSState *env, int ac, uint32_t rs, uint32_t rt) · line 2993

Quoted 9 lines · Jia Liu
target-mips/dsp_helper.c +9 -0
+    int32_t temp;
+    uint32_t rd;
+    int i, last;
+
+    temp = rt & MIPSDSP_LO;
+    rd = 0;
+    for (i = 0; i < 16; i++) {
+        last = temp % 2;
+        temp = temp >> 1;

temp should not be signed, as that % doesn't do what you wanted.

Quoted 4 lines
target-mips/translate.c +4 -0
+                    imm3 = tcg_const_i32(imm);
+                    imm2 = tcg_const_i32(imm);
+                    imm1 = tcg_const_i32(imm);
+                    imm0 = tcg_const_i32(imm);

target-mips/translate.c static void decode_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch) · line 12406

Quoted 10 lines
target-mips/translate.c +10 -0
+                    tcg_gen_shli_i32(imm3, imm3, 24);
+                    tcg_gen_shli_i32(imm2, imm2, 16);
+                    tcg_gen_shli_i32(imm1, imm1, 8);
+                    tcg_gen_or_i32(cpu_gpr[rd], imm3, imm2);
+                    tcg_gen_or_i32(cpu_gpr[rd], cpu_gpr[rd], imm1);
+                    tcg_gen_or_i32(cpu_gpr[rd], cpu_gpr[rd], imm0);
+                    tcg_temp_free(imm3);
+                    tcg_temp_free(imm2);
+                    tcg_temp_free(imm1);
+                    tcg_temp_free(imm0);

Err, this is an *immediate*.

  imm = (ctx->opcode >> 16) & 0xFF;
  tcg_gen_movi(cpu_gpr[rd], imm * 0x01010101);
Quoted 7 lines
target-mips/translate.c +7 -0
+                    rt3 = tcg_const_i32(0);
+                    rt2 = tcg_const_i32(0);
+                    rt1 = tcg_const_i32(0);
+                    rt0 = tcg_const_i32(0);
+
+                    tcg_gen_andi_i32(rt3, cpu_gpr[rt], 0xFF);
+                    tcg_gen_andi_i32(rt2, cpu_gpr[rt], 0xFF);

target-mips/translate.c static void decode_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch) · line 12429

Quoted 10 lines
target-mips/translate.c +10 -0
+                    tcg_gen_andi_i32(rt1, cpu_gpr[rt], 0xFF);
+                    tcg_gen_andi_i32(rt0, cpu_gpr[rt], 0xFF);
+
+                    tcg_gen_shli_i32(rt3, rt3, 24);
+                    tcg_gen_shli_i32(rt2, rt2, 16);
+                    tcg_gen_shli_i32(rt1, rt1, 8);
+
+                    tcg_gen_or_i32(cpu_gpr[rd], rt3, rt2);
+                    tcg_gen_or_i32(cpu_gpr[rd], cpu_gpr[rd], rt1);
+                    tcg_gen_or_i32(cpu_gpr[rd], cpu_gpr[rd], rt0);

I hadn't been asking for you to inline replv, only repl. But if you want to do this, at least only compute t=rt&0xff once. That said, I suspect the * 0x01010101 trick is fairly efficient on most hosts these days.

target-mips/translate.c static void decode_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch) · line 12874

Quoted 4 lines
target-mips/translate.c +4 -0
+                    TCGv temp_rt = tcg_const_i32(rt);
+                    gen_helper_insv(cpu_gpr[rt], cpu_env,
+                                    cpu_gpr[rs], cpu_gpr[rt]);
+                    tcg_temp_free(temp_rt);

temp_rt is unused.

r~

author
#11 lore raw

Re: [Qemu-devel] [PATCH V4 08/11] Add MIPS DSP Bit/Manipulation instructions Support

Quoted 59 lines · Richard Henderson
Quoted 9 lines · Jia Liu

+    int32_t temp;
+    uint32_t rd;
+    int i, last;
+
+    temp = rt & MIPSDSP_LO;
+    rd = 0;
+    for (i = 0; i < 16; i++) {
+        last = temp % 2;
+        temp = temp >> 1;

temp should not be signed, as that % doesn't do what you wanted.

Quoted 6 lines

+                    imm3 = tcg_const_i32(imm);
+                    imm2 = tcg_const_i32(imm);
+                    imm1 = tcg_const_i32(imm);
+                    imm0 = tcg_const_i32(imm);
+                    tcg_gen_shli_i32(imm3, imm3, 24);
+                    tcg_gen_shli_i32(imm2, imm2, 16);

Quoted 8 lines

+                    tcg_gen_shli_i32(imm1, imm1, 8);
+                    tcg_gen_or_i32(cpu_gpr[rd], imm3, imm2);
+                    tcg_gen_or_i32(cpu_gpr[rd], cpu_gpr[rd], imm1);
+                    tcg_gen_or_i32(cpu_gpr[rd], cpu_gpr[rd], imm0);
+                    tcg_temp_free(imm3);
+                    tcg_temp_free(imm2);
+                    tcg_temp_free(imm1);
+                    tcg_temp_free(imm0);

Err, this is an *immediate*.

 imm = (ctx->opcode >> 16) & 0xFF;
 tcg_gen_movi(cpu_gpr[rd], imm * 0x01010101);

Quoted 7 lines

+                    rt3 = tcg_const_i32(0);
+                    rt2 = tcg_const_i32(0);
+                    rt1 = tcg_const_i32(0);
+                    rt0 = tcg_const_i32(0);

target-mips/translate.c +3 -0
+
+                    tcg_gen_andi_i32(rt3, cpu_gpr[rt], 0xFF);
+                    tcg_gen_andi_i32(rt2, cpu_gpr[rt], 0xFF);

target-mips/translate.c static void decode_opc (CPUMIPSState *env, DisasContext *ctx, int *is_branch) · line 12429

Quoted 10 lines
target-mips/translate.c +10 -0
+                    tcg_gen_andi_i32(rt1, cpu_gpr[rt], 0xFF);
+                    tcg_gen_andi_i32(rt0, cpu_gpr[rt], 0xFF);
+
+                    tcg_gen_shli_i32(rt3, rt3, 24);
+                    tcg_gen_shli_i32(rt2, rt2, 16);
+                    tcg_gen_shli_i32(rt1, rt1, 8);
+
+                    tcg_gen_or_i32(cpu_gpr[rd], rt3, rt2);
+                    tcg_gen_or_i32(cpu_gpr[rd], cpu_gpr[rd], rt1);
+                    tcg_gen_or_i32(cpu_gpr[rd], cpu_gpr[rd], rt0);

I hadn't been asking for you to inline replv, only repl. But if you want to do this, at least only compute t=rt&0xff once. That said, I suspect the * 0x01010101 trick is fairly efficient on most hosts these days.

Quoted 7 lines
Quoted 4 lines

+                    TCGv temp_rt = tcg_const_i32(rt);
+                    gen_helper_insv(cpu_gpr[rt], cpu_env,
+                                    cpu_gpr[rs], cpu_gpr[rt]);
+                    tcg_temp_free(temp_rt);

temp_rt is unused.

Thank you very much for pointing the errors!
I'll fix them.

Quoted 4 lines

r~

Regards,
Jia.

author
#12 lore raw

PATCH v4 9/11 Add MIPS DSP Compare-Pick instructions Support

In reply to Jia Liu

Add MIPS DSP Compare-Pick instructions Support.

---
 target-mips/dsp_helper.c |  341 ++++++++++++++++++++++++++++++++++++++++++++++
 target-mips/helper.h     |   17 +++
 target-mips/translate.c  |  135 ++++++++++++++++++
 3 files changed, 493 insertions(+), 0 deletions(-)
target-mips/dsp_helper.c +341 -0
index 1c5e858..27949ab 100644
@@ -3021,6 +3021,347 @@ uint32_t helper_insv(CPUMIPSState *env, uint32_t rs, uint32_t rt)
     return temp;
 }
 
+/** DSP Compare-Pick Sub-class insns **/
+void helper_cmpu_eq_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint32_t cc3 = 0, cc2 = 0, cc1 = 0, cc0 = 0;
+    uint32_t flag;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    cc3 = (rs3 == rt3);
+    cc2 = (rs2 == rt2);
+    cc1 = (rs1 == rt1);
+    cc0 = (rs0 == rt0);
+
+    flag = (cc3 << 3) | (cc2 << 2) | (cc1 << 1) | cc0;
+    set_DSPControl_24(env, flag, 4);
+}
+
+void helper_cmpu_lt_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint32_t cc3 = 0, cc2 = 0, cc1 = 0, cc0 = 0;
+    uint32_t flag;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    cc3 = (rs3 < rt3);
+    cc2 = (rs2 < rt2);
+    cc1 = (rs1 < rt1);
+    cc0 = (rs0 < rt0);
+
+    flag = (cc3 << 3) | (cc2 << 2) | (cc1 << 1) | cc0;
+    set_DSPControl_24(env, flag, 4);
+}
+
+void helper_cmpu_le_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint32_t cc3 = 0, cc2 = 0, cc1 = 0, cc0 = 0;
+    uint32_t flag;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    cc3 = (rs3 <= rt3);
+    cc2 = (rs2 <= rt2);
+    cc1 = (rs1 <= rt1);
+    cc0 = (rs0 <= rt0);
+
+    flag = (cc3 << 3) | (cc2 << 2) | (cc1 << 1) | cc0;
+    set_DSPControl_24(env, flag, 4);
+}
+
+
+uint32_t helper_cmpgu_eq_qb(uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint8_t cc3 = 0, cc2 = 0, cc1 = 0, cc0 = 0;
+    uint32_t temp;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    cc3 = (rs3 == rt3);
+    cc2 = (rs2 == rt2);
+    cc1 = (rs1 == rt1);
+    cc0 = (rs0 == rt0);
+
+    temp = (cc3 << 3) | (cc2 << 2) | (cc1 << 1) | cc0;
+    rd = temp;
+
+    return rd;
+}
+
+uint32_t helper_cmpgu_lt_qb(uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint32_t cc3 = 0, cc2 = 0, cc1 = 0, cc0 = 0;
+    uint32_t temp;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    cc3 = (rs3 < rt3);
+    cc2 = (rs2 < rt2);
+    cc1 = (rs1 < rt1);
+    cc0 = (rs0 < rt0);
+
+    temp = (cc3 << 3) | (cc2 << 2) | (cc1 << 1) | cc0;
+    rd = temp;
+
+    return rd;
+}
+
+uint32_t helper_cmpgu_le_qb(uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint32_t cc3 = 0, cc2 = 0, cc1 = 0, cc0 = 0;
+    uint32_t temp;
+    uint32_t rd;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    cc3 = (rs3 <= rt3);
+    cc2 = (rs2 <= rt2);
+    cc1 = (rs1 <= rt1);
+    cc0 = (rs0 <= rt0);
+
+    temp = (cc3 << 3) | (cc2 << 2) | (cc1 << 1) | cc0;
+    rd = temp;
+
+    return rd;
+}
+
+void helper_cmp_eq_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t flag;
+    int32_t ccA = 0, ccB = 0;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    ccB = (rsh == rth);
+    ccA = (rsl == rtl);
+
+    flag = (ccB << 1) | ccA;
+    set_DSPControl_24(env, flag, 2);
+}
+
+void helper_cmp_lt_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t flag;
+    int32_t ccA = 0, ccB = 0;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    ccB = (rsh < rth);
+    ccA = (rsl < rtl);
+
+    flag = (ccB << 1) | ccA;
+    set_DSPControl_24(env, flag, 2);
+}
+
+void helper_cmp_le_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    int16_t rsh, rsl, rth, rtl;
+    int32_t flag;
+    int32_t ccA = 0, ccB = 0;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    ccB = (rsh <= rth);
+    ccA = (rsl <= rtl);
+
+    flag = (ccB << 1) | ccA;
+    set_DSPControl_24(env, flag, 2);
+}
+
+uint32_t helper_pick_qb(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint8_t rs3, rs2, rs1, rs0;
+    uint8_t rt3, rt2, rt1, rt0;
+    uint8_t tp3, tp2, tp1, tp0;
+
+    uint32_t dsp27, dsp26, dsp25, dsp24, rd;
+    target_ulong dsp;
+
+    rs3 = (rs & MIPSDSP_Q3) >> 24;
+    rs2 = (rs & MIPSDSP_Q2) >> 16;
+    rs1 = (rs & MIPSDSP_Q1) >>  8;
+    rs0 =  rs & MIPSDSP_Q0;
+    rt3 = (rt & MIPSDSP_Q3) >> 24;
+    rt2 = (rt & MIPSDSP_Q2) >> 16;
+    rt1 = (rt & MIPSDSP_Q1) >>  8;
+    rt0 =  rt & MIPSDSP_Q0;
+
+    dsp = env->active_tc.DSPControl;
+    dsp27 = (dsp >> 27) & 0x01;
+    dsp26 = (dsp >> 26) & 0x01;
+    dsp25 = (dsp >> 25) & 0x01;
+    dsp24 = (dsp >> 24) & 0x01;
+
+    tp3 = dsp27 == 1 ? rs3 : rt3;
+    tp2 = dsp26 == 1 ? rs2 : rt2;
+    tp1 = dsp25 == 1 ? rs1 : rt1;
+    tp0 = dsp24 == 1 ? rs0 : rt0;
+
+    rd = ((uint32_t)tp3 << 24) | \
+         ((uint32_t)tp2 << 16) | \
+         ((uint32_t)tp1 <<  8) | \
+         (uint32_t)tp0;
+
+    return rd;
+}
+
+uint32_t helper_pick_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+{
+    uint16_t rsh, rsl, rth, rtl;
+    uint16_t tempB, tempA;
+    uint32_t dsp25, dsp24;
+    uint32_t rd;
+    target_ulong dsp;
+
+    rsh = (rs & MIPSDSP_HI) >> 16;
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rtl =  rt & MIPSDSP_LO;
+
+    dsp = env->active_tc.DSPControl;
+    dsp25 = (dsp >> 25) & 0x01;
+    dsp24 = (dsp >> 24) & 0x01;
+
+    tempB = (dsp25 == 1) ? rsh : rth;
+    tempA = (dsp24 == 1) ? rsl : rtl;
+    rd = (((uint32_t)tempB << 16) & MIPSDSP_HI) | (uint32_t)tempA;
+
+    return rd;
+}
+
+uint32_t helper_append(uint32_t rt, uint32_t rs, int sa)
+{
+    int len;
+    uint32_t temp;
+
+    len = sa & 0x1F;
+
+    if (len == 0) {
+        temp = rt;
+    } else {
+        temp = (rt << len) | (rs & (((uint32_t)0x01 << len) - 1));
+    }
+    rt = temp;
+
+    return temp;
+}
+
+uint32_t helper_prepend(int sa, uint32_t rs, uint32_t rt)
+{
+    uint32_t temp;
+
+    if (sa == 0) {
+        temp = rt;
+    } else {
+        temp = (rs << (32 - sa)) | rt >> sa;
+    }
+
+    rt = temp;
+
+    return rt;
+}
+
+uint32_t helper_balign(uint32_t rt, uint32_t rs, uint32_t bp)
+{
+    uint32_t temp;
+    bp = bp & 0x03;
+
+    if (bp == 0 || bp == 2) {
+        return rt;
+    } else {
+        temp = (rt << (8 * bp)) | (rs >> (8 * (4 - bp)));
+    }
+    rt = temp;
+
+    return rt;
+}
+
+uint32_t helper_packrl_ph(uint32_t rs, uint32_t rt)
+{
+    uint16_t rsl, rth;
+    uint32_t rd;
+
+    rsl =  rs & MIPSDSP_LO;
+    rth = (rt & MIPSDSP_HI) >> 16;
+    rd = (rsl << 16) | rth;
+
+    return rd;
+}
+
 #undef MIPSDSP_LHI
 #undef MIPSDSP_LLO
 #undef MIPSDSP_HI
target-mips/helper.h +17 -0
index 669537b..7737a22 100644
@@ -414,4 +414,21 @@ DEF_HELPER_FLAGS_4(mulsa_w_ph, 0, void, env, int, i32, i32)
 DEF_HELPER_FLAGS_1(bitrev, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32)
 DEF_HELPER_FLAGS_3(insv, 0, i32, env, i32, i32)
 
+/* DSP Compare-Pick Sub-class insns */
+DEF_HELPER_FLAGS_3(cmpu_eq_qb, 0, void, env, i32, i32)
+DEF_HELPER_FLAGS_3(cmpu_lt_qb, 0, void, env, i32, i32)
+DEF_HELPER_FLAGS_3(cmpu_le_qb, 0, void, env, i32, i32)
+DEF_HELPER_FLAGS_2(cmpgu_eq_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(cmpgu_lt_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_2(cmpgu_le_qb, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+DEF_HELPER_FLAGS_3(cmp_eq_ph, 0, void, env, i32, i32)
+DEF_HELPER_FLAGS_3(cmp_lt_ph, 0, void, env, i32, i32)
+DEF_HELPER_FLAGS_3(cmp_le_ph, 0, void, env, i32, i32)
+DEF_HELPER_FLAGS_3(pick_qb, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(pick_ph, 0, i32, env, i32, i32)
+DEF_HELPER_FLAGS_3(append, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32, int)
+DEF_HELPER_FLAGS_3(prepend, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32, i32)
+DEF_HELPER_FLAGS_3(balign, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32, i32)
+DEF_HELPER_FLAGS_2(packrl_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
+
 #include "def-helper.h"
target-mips/translate.c +135 -0

165 lines not on this page · raw message

Signature · 1 line
1.7.5.4
author
#13 lore raw

PATCH v4 10/11 Add MIPS DSP Accumulator and DSPControl Access instructions Support

In reply to Jia Liu

Add MIPS DSP Accumulator and DSPControl Access instructions Support.

---
 target-mips/dsp_helper.c |  465 ++++++++++++++++++++++++++++++++++++++++++++++
 target-mips/helper.h     |   19 ++
 target-mips/translate.c  |  175 +++++++++++++++++
 3 files changed, 659 insertions(+), 0 deletions(-)
target-mips/dsp_helper.c +465 -0
index 27949ab..c1ccddc 100644
@@ -3362,6 +3362,471 @@ uint32_t helper_packrl_ph(uint32_t rs, uint32_t rt)
     return rd;
 }
 
+/** DSP Accumulator and DSPControl Access Sub-class insns **/
+uint32_t helper_extr_w(CPUMIPSState *env, int ac, int shift)
+{
+    int32_t tempI;
+    int64_t tempDL[2];
+
+    mipsdsp__rashift_short_acc(env, tempDL, ac, shift);
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    tempI = (tempDL[0] >> 1) & MIPSDSP_LLO;
+
+    tempDL[0] += 1;
+    if (tempDL[0] == 0) {
+        tempDL[1] += 1;
+    }
+
+    if ((!(tempDL[1] == 0 && (tempDL[0] & MIPSDSP_LHI) == 0x00)) && \
+        (!(tempDL[1] == 1 && (tempDL[0] & MIPSDSP_LHI) == MIPSDSP_LHI))) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    return tempI;
+}
+
+uint32_t helper_extr_r_w(CPUMIPSState *env, int ac, int shift)
+{
+    int32_t tempI;
+    int64_t tempDL[2];
+
+    mipsdsp__rashift_short_acc(env, tempDL, ac, shift);
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    tempDL[0] += 1;
+    if (tempDL[0] == 0) {
+        tempDL[1] += 1;
+    }
+
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 && (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+    tempI = tempDL[0] >> 1;
+
+    return tempI;
+}
+
+uint32_t helper_extr_rs_w(CPUMIPSState *env, int ac, int shift)
+{
+    int32_t tempI, temp64;
+    int64_t tempDL[2];
+
+    mipsdsp__rashift_short_acc(env, tempDL, ac, shift);
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+    tempDL[0] += 1;
+    if (tempDL[0] == 0) {
+        tempDL[1] += 1;
+    }
+    tempI = tempDL[0] >> 1;
+
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        temp64 = tempDL[1];
+        if (temp64 == 0) {
+            tempI = 0x7FFFFFFF;
+        } else {
+            tempI = 0x80000000;
+        }
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    return tempI;
+}
+
+uint32_t helper_extr_s_h(CPUMIPSState *env, int ac, int shift)
+{
+    int64_t temp;
+    uint32_t tempI;
+
+    temp = mipsdsp_rashift_short_acc(env, ac, shift);
+    if (temp > 0x0000000000007FFFull) {
+        temp &= MIPSDSP_LHI;
+        temp |= 0x00007FFF;
+        set_DSPControl_overflow_flag(env, 1, 23);
+    } else if (temp < 0xFFFFFFFFFFFF8000ull) {
+        temp &= MIPSDSP_LHI;
+        temp |= 0xFFFF8000;
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    tempI = temp & 0xFFFFFFFF;
+    return tempI;
+}
+
+uint32_t helper_extrv_s_h(CPUMIPSState *env, int ac, uint32_t rs)
+{
+    uint32_t rd;
+    int32_t shift, tempI;
+    int64_t tempL;
+
+    shift = rs & 0x0F;
+    tempL = mipsdsp_rashift_short_acc(env, ac, shift);
+    if (tempL > 0x000000000007FFFull) {
+        tempI = 0x00007FFF;
+        set_DSPControl_overflow_flag(env, 1, 23);
+    } else if (tempL < 0xFFFFFFFFFFF8000ull) {
+        tempI = 0xFFFF8000;
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+    rd = tempI;
+
+    return rd;
+}
+
+uint32_t helper_extrv_w(CPUMIPSState *env, int ac, uint32_t rs)
+{
+    int32_t shift, tempI;
+    int64_t tempDL[2];
+
+    shift = rs & 0x0F;
+    mipsdsp__rashift_short_acc(env, tempDL, ac, shift);
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    tempI = tempDL[0] >> 1;
+
+    tempDL[0] += 1;
+    if (tempDL[0] == 0) {
+        tempDL[1] += 1;
+    }
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    return tempI;
+}
+
+uint32_t helper_extrv_r_w(CPUMIPSState *env, int ac, uint32_t rs)
+{
+    int32_t shift, tempI;
+    int64_t tempDL[2];
+
+    shift = rs & 0x0F;
+    mipsdsp__rashift_short_acc(env, tempDL, ac, shift);
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    tempDL[0] += 1;
+    if (tempDL[0] == 0) {
+        tempDL[1] += 1;
+    }
+
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+    tempI = tempDL[0] >> 1;
+
+    return tempI;
+}
+
+uint32_t helper_extrv_rs_w(CPUMIPSState *env, int ac, uint32_t rs)
+{
+    int32_t shift, tempI;
+    int64_t tempDL[2];
+
+    shift = rs & 0x0F;
+    mipsdsp__rashift_short_acc(env, tempDL, ac, shift);
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    tempDL[0] += 1;
+    if (tempDL[0] == 0) {
+        tempDL[1] += 1;
+    }
+    tempI = tempDL[0] >> 1;
+
+    if ((tempDL[1] != 0 || (tempDL[0] & MIPSDSP_LHI) != 0) && \
+        (tempDL[1] != 1 || (tempDL[0] & MIPSDSP_LHI) != MIPSDSP_LHI)) {
+        if (tempDL[1] == 0) {
+            tempI = 0x7FFFFFFF;
+        } else {
+            tempI = 0x80000000;
+        }
+        set_DSPControl_overflow_flag(env, 1, 23);
+    }
+
+    return tempI;
+}
+
+uint32_t helper_extp(CPUMIPSState *env, int ac, int size)
+{
+    int32_t start_pos;
+    uint32_t temp;
+    uint64_t acc;
+
+    temp = 0;
+    start_pos = get_DSPControl_pos(env);
+    if (start_pos - (size + 1) >= -1) {
+        acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+              ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+        temp = (acc >> (start_pos - size)) & \
+               (((uint32_t)0x01 << (size + 1)) - 1);
+        set_DSPControl_efi(env, 0);
+    } else {
+        set_DSPControl_efi(env, 1);
+    }
+
+    return temp;
+}
+
+uint32_t helper_extpv(CPUMIPSState *env, int ac, uint32_t rs)
+{
+    int32_t start_pos, size;
+    uint32_t temp;
+    uint64_t acc;
+
+    temp = 0;
+    start_pos = get_DSPControl_pos(env);
+    size = rs & 0x1F;
+
+    if (start_pos - (size + 1) >= -1) {
+        acc = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+              ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+        temp = (acc >> (start_pos - size)) & \
+               (((uint32_t)0x01 << (size + 1)) - 1);
+        set_DSPControl_efi(env, 0);
+    } else {
+        set_DSPControl_efi(env, 1);
+    }
+
+    return temp;
+}
+
+uint32_t helper_extpdp(CPUMIPSState *env, int ac, int size)
+{
+    int32_t start_pos;
+    uint32_t temp;
+    uint64_t acc;
+
+    temp = 0;
+    start_pos = get_DSPControl_pos(env);
+    if (start_pos - (size + 1) >= -1) {
+        acc  = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+               ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+        temp = (acc >> (start_pos - size)) & \
+               (((uint32_t)0x01 << (size + 1)) - 1);
+
+        set_DSPControl_pos(env, start_pos - (size + 1));
+        set_DSPControl_efi(env, 0);
+    } else {
+        set_DSPControl_efi(env, 1);
+    }
+
+    return temp;
+}
+
+uint32_t helper_extpdpv(CPUMIPSState *env, int ac, uint32_t rs)
+{
+    int32_t start_pos, size;
+    uint32_t temp;
+    uint64_t acc;
+
+    temp = 0;
+    start_pos = get_DSPControl_pos(env);
+    size = rs & 0x1F;
+
+    if (start_pos - (size + 1) >= -1) {
+        acc  = ((uint64_t)env->active_tc.HI[ac] << 32) | \
+               ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+        temp = (acc >> (start_pos - size)) & (((int)0x01 << (size + 1)) - 1);
+        set_DSPControl_pos(env, start_pos - (size + 1));
+        set_DSPControl_efi(env, 0);
+    } else {
+        set_DSPControl_efi(env, 1);
+    }
+
+    return temp;
+}
+
+void helper_shilo(CPUMIPSState *env, int ac, int shift)
+{
+    uint8_t  sign;
+    uint64_t temp, acc;
+
+    shift = (shift << 26) >> 26;
+    sign  = (shift >>  5) & 0x01;
+    shift = (sign == 0) ? shift : -shift;
+    acc = (((uint64_t)env->active_tc.HI[ac] << 32) & MIPSDSP_LHI) | \
+          ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+
+    if (shift == 0) {
+        temp = acc;
+    } else {
+        if (sign == 0) {
+            temp = acc >> shift;
+        } else {
+            temp = acc << shift;
+        }
+    }
+
+    env->active_tc.HI[ac] = (temp & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  temp & MIPSDSP_LLO;
+}
+
+void helper_shilov(CPUMIPSState *env, int ac, uint32_t rs)
+{
+    uint8_t sign;
+    int8_t  rs5_0;
+    uint64_t temp, acc;
+
+    rs5_0 = rs & 0x3F;
+    rs    = (rs5_0 << 2) >> 2;
+    sign  = (rs5_0 >> 5) & 0x01;
+    rs5_0 = (sign == 0) ? rs : -rs;
+    acc   = (((uint64_t)env->active_tc.HI[ac] << 32) & MIPSDSP_LHI) | \
+            ((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO);
+    if (rs5_0 == 0) {
+        temp = acc;
+    } else {
+        if (sign == 0) {
+            temp = acc >> rs5_0;
+        } else {
+            temp = acc << rs5_0;
+        }
+    }
+
+    env->active_tc.HI[ac] = (temp & MIPSDSP_LHI) >> 32;
+    env->active_tc.LO[ac] =  temp & MIPSDSP_LLO;
+}
+
+void helper_mthlip(CPUMIPSState *env, int ac, uint32_t rs)
+{
+    int32_t tempA, tempB, pos;
+
+    tempA = rs;
+    tempB = env->active_tc.LO[ac];
+    env->active_tc.HI[ac] = tempB;
+    env->active_tc.LO[ac] = tempA;
+    pos = get_DSPControl_pos(env);
+
+    if (pos > 32) {
+        return;
+    } else {
+        set_DSPControl_pos(env, pos + 32);
+    }
+}
+
+void helper_wrdsp(CPUMIPSState *env, uint32_t rs, int mask_num)
+{
+    uint8_t  mask[6];
+    uint8_t  i;
+    uint32_t newbits, overwrite;
+    target_ulong dsp;
+
+    newbits   = 0x00;
+    overwrite = 0xFFFFFFFF;
+    dsp = env->active_tc.DSPControl;
+
+    for (i = 0; i < 6; i++) {
+        mask[i] = (mask_num >> i) & 0x01;
+    }
+
+    if (mask[0] == 1) {
+        overwrite &= 0xFFFFFFC0;
+        newbits   &= 0xFFFFFFC0;
+        newbits   |= 0x0000003F & rs;
+    }
+
+    if (mask[1] == 1) {
+        overwrite &= 0xFFFFE07F;
+        newbits   &= 0xFFFFE07F;
+        newbits   |= 0x00001F80 & rs;
+    }
+
+    if (mask[2] == 1) {
+        overwrite &= 0xFFFFDFFF;
+        newbits   &= 0xFFFFDFFF;
+        newbits   |= 0x00002000 & rs;
+    }
+
+    if (mask[3] == 1) {
+        overwrite &= 0xFF00FFFF;
+        newbits   &= 0xFF00FFFF;
+        newbits   |= 0x00FF0000 & rs;
+    }
+
+    if (mask[4] == 1) {
+        overwrite &= 0x00FFFFFF;
+        newbits   &= 0x00FFFFFF;
+        newbits   |= 0xFF000000 & rs;
+    }
+
+    if (mask[5] == 1) {
+        overwrite &= 0xFFFFBFFF;
+        newbits   &= 0xFFFFBFFF;
+        newbits   |= 0x00004000 & rs;
+    }
+
+    dsp = dsp & overwrite;
+    dsp = dsp | newbits;
+    env->active_tc.DSPControl = dsp;
+}
+
+uint32_t helper_rddsp(CPUMIPSState *env, uint32_t masknum)
+{
+    uint8_t  mask[6];
+    uint32_t ruler, i;
+    uint32_t temp;
+    uint32_t rd;
+    target_ulong dsp;
+
+    ruler = 0x01;
+    for (i = 0; i < 6; i++) {
+        mask[i] = (masknum & ruler) >> i ;
+        ruler = ruler << 1;
+    }
+
+    temp  = 0x00;
+    dsp = env->active_tc.DSPControl;
+
+    if (mask[0] == 1) {
+        temp |= dsp & 0x3F;
+    }
+
+    if (mask[1] == 1) {
+        temp |= dsp & 0x1F80;
+    }
+
+    if (mask[2] == 1) {
+        temp |= dsp & 0x2000;
+    }
+
+    if (mask[3] == 1) {
+        temp |= dsp & 0x00FF0000;
+    }
+
+    if (mask[4] == 1) {
+        temp |= dsp & 0xFF000000;
+    }
+
+    if (mask[5] == 1) {
+        temp |= dsp & 0x4000;
+    }
+
+    rd = temp;
+
+    return rd;
+}
+
 #undef MIPSDSP_LHI
 #undef MIPSDSP_LLO
 #undef MIPSDSP_HI
target-mips/helper.h +19 -0
index 7737a22..446e66a 100644
@@ -431,4 +431,23 @@ DEF_HELPER_FLAGS_3(prepend, TCG_CALL_CONST | TCG_CALL_PURE, i32, int, i32, i32)
 DEF_HELPER_FLAGS_3(balign, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32, i32)
 DEF_HELPER_FLAGS_2(packrl_ph, TCG_CALL_CONST | TCG_CALL_PURE, i32, i32, i32)
 
+/* DSP Accumulator and DSPControl Access Sub-class insns */
+DEF_HELPER_FLAGS_3(extr_w, 0, i32, env, int, int)
+DEF_HELPER_FLAGS_3(extr_r_w, 0, i32, env, int, int)
+DEF_HELPER_FLAGS_3(extr_rs_w, 0, i32, env, int, int)
+DEF_HELPER_FLAGS_3(extr_s_h, 0, i32, env, int, int)
+DEF_HELPER_FLAGS_3(extrv_s_h, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(extrv_w, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(extrv_r_w, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(extrv_rs_w, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(extp, 0, i32, env, int, int)
+DEF_HELPER_FLAGS_3(extpv, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(extpdp, 0, i32, env, int, int)
+DEF_HELPER_FLAGS_3(extpdpv, 0, i32, env, int, i32)
+DEF_HELPER_FLAGS_3(shilo, 0, void, env, int, int)
+DEF_HELPER_FLAGS_3(shilov, 0, void, env, int, i32)
+DEF_HELPER_FLAGS_3(mthlip, 0, void, env, int, i32)
+DEF_HELPER_FLAGS_3(wrdsp, 0, void, env, i32, int)
+DEF_HELPER_FLAGS_2(rddsp, 0, i32, env, i32)
+
 #include "def-helper.h"
target-mips/translate.c +175 -0

193 lines not on this page · raw message

Signature · 1 line
1.7.5.4
author
#14 lore raw

PATCH v4 11/11 Add MIPS DSP Testcases

In reply to Jia Liu

Add MIPS DSP Testcases.

---
 tests/tcg/mips/mips32-dsp/Makefile             |  133 ++++++++++++++++++++++++
 tests/tcg/mips/mips32-dsp/absq_s_ph.c          |   30 ++++++
 tests/tcg/mips/mips32-dsp/absq_s_w.c           |   37 +++++++
 tests/tcg/mips/mips32-dsp/addq_ph.c            |   30 ++++++
 tests/tcg/mips/mips32-dsp/addq_s_ph.c          |   30 ++++++
 tests/tcg/mips/mips32-dsp/addsc.c              |   30 ++++++
 tests/tcg/mips/mips32-dsp/addu_qb.c            |   30 ++++++
 tests/tcg/mips/mips32-dsp/addu_s_qb.c          |   30 ++++++
 tests/tcg/mips/mips32-dsp/addwc.c              |   30 ++++++
 tests/tcg/mips/mips32-dsp/bitrev.c             |   20 ++++
 tests/tcg/mips/mips32-dsp/bposge32.c           |   44 ++++++++
 tests/tcg/mips/mips32-dsp/cmp_eq_ph.c          |   35 ++++++
 tests/tcg/mips/mips32-dsp/cmp_le_ph.c          |   35 ++++++
 tests/tcg/mips/mips32-dsp/cmp_lt_ph.c          |   35 ++++++
 tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c        |   31 ++++++
 tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c        |   31 ++++++
 tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c        |   31 ++++++
 tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c         |   35 ++++++
 tests/tcg/mips/mips32-dsp/cmpu_le_qb.c         |   35 ++++++
 tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c         |   35 ++++++
 tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c        |   31 ++++++
 tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c        |   31 ++++++
 tests/tcg/mips/mips32-dsp/dpau_h_qbl.c         |   27 +++++
 tests/tcg/mips/mips32-dsp/dpau_h_qbr.c         |   27 +++++
 tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c        |   27 +++++
 tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c        |   31 ++++++
 tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c         |   27 +++++
 tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c         |   27 +++++
 tests/tcg/mips/mips32-dsp/extp.c               |   44 ++++++++
 tests/tcg/mips/mips32-dsp/extpdp.c             |   46 ++++++++
 tests/tcg/mips/mips32-dsp/extpdpv.c            |   47 +++++++++
 tests/tcg/mips/mips32-dsp/extpv.c              |   45 ++++++++
 tests/tcg/mips/mips32-dsp/extr_r_w.c           |   25 +++++
 tests/tcg/mips/mips32-dsp/extr_rs_w.c          |   25 +++++
 tests/tcg/mips/mips32-dsp/extr_s_h.c           |   25 +++++
 tests/tcg/mips/mips32-dsp/extr_w.c             |   25 +++++
 tests/tcg/mips/mips32-dsp/extrv_r_w.c          |   29 +++++
 tests/tcg/mips/mips32-dsp/extrv_rs_w.c         |   29 +++++
 tests/tcg/mips/mips32-dsp/extrv_s_h.c          |   29 +++++
 tests/tcg/mips/mips32-dsp/extrv_w.c            |   29 +++++
 tests/tcg/mips/mips32-dsp/insv.c               |   23 ++++
 tests/tcg/mips/mips32-dsp/lbux.c               |   23 ++++
 tests/tcg/mips/mips32-dsp/lhx.c                |   23 ++++
 tests/tcg/mips/mips32-dsp/lwx.c                |   23 ++++
 tests/tcg/mips/mips32-dsp/madd.c               |   31 ++++++
 tests/tcg/mips/mips32-dsp/maddu.c              |   31 ++++++
 tests/tcg/mips/mips32-dsp/maq_s_w_phl.c        |   31 ++++++
 tests/tcg/mips/mips32-dsp/maq_s_w_phr.c        |   31 ++++++
 tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c       |   31 ++++++
 tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c       |   31 ++++++
 tests/tcg/mips/mips32-dsp/mfhi.c               |   21 ++++
 tests/tcg/mips/mips32-dsp/mflo.c               |   21 ++++
 tests/tcg/mips/mips32-dsp/modsub.c             |   30 ++++++
 tests/tcg/mips/mips32-dsp/msub.c               |   30 ++++++
 tests/tcg/mips/mips32-dsp/msubu.c              |   30 ++++++
 tests/tcg/mips/mips32-dsp/mthi.c               |   21 ++++
 tests/tcg/mips/mips32-dsp/mthlip.c             |   34 ++++++
 tests/tcg/mips/mips32-dsp/mtlo.c               |   21 ++++
 tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c      |   40 +++++++
 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c     |   25 +++++
 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c     |   25 +++++
 tests/tcg/mips/mips32-dsp/mulq_rs_ph.c         |   25 +++++
 tests/tcg/mips/mips32-dsp/mult.c               |   24 +++++
 tests/tcg/mips/mips32-dsp/multu.c              |   24 +++++
 tests/tcg/mips/mips32-dsp/packrl_ph.c          |   21 ++++
 tests/tcg/mips/mips32-dsp/pick_ph.c            |   23 ++++
 tests/tcg/mips/mips32-dsp/pick_qb.c            |   23 ++++
 tests/tcg/mips/mips32-dsp/preceq_w_phl.c       |   20 ++++
 tests/tcg/mips/mips32-dsp/preceq_w_phr.c       |   20 ++++
 tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c     |   20 ++++
 tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c    |   20 ++++
 tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c     |   20 ++++
 tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c    |   20 ++++
 tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c      |   20 ++++
 tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c     |   20 ++++
 tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c      |   20 ++++
 tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c     |   20 ++++
 tests/tcg/mips/mips32-dsp/precrq_ph_w.c        |   21 ++++
 tests/tcg/mips/mips32-dsp/precrq_qb_ph.c       |   21 ++++
 tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c     |   21 ++++
 tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c    |   21 ++++
 tests/tcg/mips/mips32-dsp/raddu_w_qb.c         |   20 ++++
 tests/tcg/mips/mips32-dsp/rddsp.c              |   54 ++++++++++
 tests/tcg/mips/mips32-dsp/repl_ph.c            |   23 ++++
 tests/tcg/mips/mips32-dsp/repl_qb.c            |   16 +++
 tests/tcg/mips/mips32-dsp/replv_ph.c           |   19 ++++
 tests/tcg/mips/mips32-dsp/replv_qb.c           |   19 ++++
 tests/tcg/mips/mips32-dsp/shilo.c              |   27 +++++
 tests/tcg/mips/mips32-dsp/shilov.c             |   29 +++++
 tests/tcg/mips/mips32-dsp/shll_ph.c            |   24 +++++
 tests/tcg/mips/mips32-dsp/shll_qb.c            |   23 ++++
 tests/tcg/mips/mips32-dsp/shll_s_ph.c          |   24 +++++
 tests/tcg/mips/mips32-dsp/shll_s_w.c           |   24 +++++
 tests/tcg/mips/mips32-dsp/shllv_ph.c           |   25 +++++
 tests/tcg/mips/mips32-dsp/shllv_qb.c           |   24 +++++
 tests/tcg/mips/mips32-dsp/shllv_s_ph.c         |   25 +++++
 tests/tcg/mips/mips32-dsp/shllv_s_w.c          |   25 +++++
 tests/tcg/mips/mips32-dsp/shra_ph.c            |   20 ++++
 tests/tcg/mips/mips32-dsp/shra_r_ph.c          |   20 ++++
 tests/tcg/mips/mips32-dsp/shra_r_w.c           |   20 ++++
 tests/tcg/mips/mips32-dsp/shrav_ph.c           |   21 ++++
 tests/tcg/mips/mips32-dsp/shrav_r_ph.c         |   21 ++++
 tests/tcg/mips/mips32-dsp/shrav_r_w.c          |   21 ++++
 tests/tcg/mips/mips32-dsp/shrl_qb.c            |   20 ++++
 tests/tcg/mips/mips32-dsp/shrlv_qb.c           |   21 ++++
 tests/tcg/mips/mips32-dsp/subq_ph.c            |   25 +++++
 tests/tcg/mips/mips32-dsp/subq_s_ph.c          |   25 +++++
 tests/tcg/mips/mips32-dsp/subq_s_w.c           |   25 +++++
 tests/tcg/mips/mips32-dsp/subu_qb.c            |   25 +++++
 tests/tcg/mips/mips32-dsp/subu_s_qb.c          |   25 +++++
 tests/tcg/mips/mips32-dsp/wrdsp.c              |   54 ++++++++++
 tests/tcg/mips/mips32-dspr2/Makefile           |   71 +++++++++++++
 tests/tcg/mips/mips32-dspr2/absq_s_qb.c        |   35 ++++++
 tests/tcg/mips/mips32-dspr2/addqh_ph.c         |   30 ++++++
 tests/tcg/mips/mips32-dspr2/addqh_r_ph.c       |   30 ++++++
 tests/tcg/mips/mips32-dspr2/addqh_r_w.c        |   34 ++++++
 tests/tcg/mips/mips32-dspr2/addqh_w.c          |   34 ++++++
 tests/tcg/mips/mips32-dspr2/addu_ph.c          |   30 ++++++
 tests/tcg/mips/mips32-dspr2/addu_s_ph.c        |   30 ++++++
 tests/tcg/mips/mips32-dspr2/adduh_qb.c         |   30 ++++++
 tests/tcg/mips/mips32-dspr2/adduh_r_qb.c       |   30 ++++++
 tests/tcg/mips/mips32-dspr2/append.c           |   30 ++++++
 tests/tcg/mips/mips32-dspr2/balign.c           |   30 ++++++
 tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c     |   37 +++++++
 tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c     |   37 +++++++
 tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c     |   37 +++++++
 tests/tcg/mips/mips32-dspr2/dpa_w_ph.c         |   27 +++++
 tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c     |   57 ++++++++++
 tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c    |   30 ++++++
 tests/tcg/mips/mips32-dspr2/dpax_w_ph.c        |   27 +++++
 tests/tcg/mips/mips32-dspr2/dps_w_ph.c         |   27 +++++
 tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c     |   31 ++++++
 tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c    |   31 ++++++
 tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c        |   27 +++++
 tests/tcg/mips/mips32-dspr2/mul_ph.c           |   25 +++++
 tests/tcg/mips/mips32-dspr2/mul_s_ph.c         |   25 +++++
 tests/tcg/mips/mips32-dspr2/muleq_s_w_phl.c    |   40 +++++++
 tests/tcg/mips/mips32-dspr2/mulq_rs_w.c        |   36 +++++++
 tests/tcg/mips/mips32-dspr2/mulq_s_ph.c        |   25 +++++
 tests/tcg/mips/mips32-dspr2/mulq_s_w.c         |   36 +++++++
 tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c       |   29 +++++
 tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c    |   29 +++++
 tests/tcg/mips/mips32-dspr2/precr_qb_ph.c      |   21 ++++
 tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c   |   32 ++++++
 tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c |   32 ++++++
 tests/tcg/mips/mips32-dspr2/prepend.c          |   30 ++++++
 tests/tcg/mips/mips32-dspr2/shra_qb.c          |   30 ++++++
 tests/tcg/mips/mips32-dspr2/shra_r_qb.c        |   30 ++++++
 tests/tcg/mips/mips32-dspr2/shrav_qb.c         |   32 ++++++
 tests/tcg/mips/mips32-dspr2/shrav_r_qb.c       |   32 ++++++
 tests/tcg/mips/mips32-dspr2/shrl_ph.c          |   20 ++++
 tests/tcg/mips/mips32-dspr2/shrlv_ph.c         |   21 ++++
 tests/tcg/mips/mips32-dspr2/subqh_ph.c         |   21 ++++
 tests/tcg/mips/mips32-dspr2/subqh_r_ph.c       |   21 ++++
 tests/tcg/mips/mips32-dspr2/subqh_r_w.c        |   21 ++++
 tests/tcg/mips/mips32-dspr2/subqh_w.c          |   21 ++++
 tests/tcg/mips/mips32-dspr2/subu_ph.c          |   25 +++++
 tests/tcg/mips/mips32-dspr2/subu_s_ph.c        |   25 +++++
 tests/tcg/mips/mips32-dspr2/subuh_qb.c         |   21 ++++
 tests/tcg/mips/mips32-dspr2/subuh_r_qb.c       |   21 ++++
 160 files changed, 4600 insertions(+), 0 deletions(-)
 create mode 100644 tests/tcg/mips/mips32-dsp/Makefile
 create mode 100644 tests/tcg/mips/mips32-dsp/absq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/absq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addsc.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addu_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addu_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addwc.c
 create mode 100644 tests/tcg/mips/mips32-dsp/bitrev.c
 create mode 100644 tests/tcg/mips/mips32-dsp/bposge32.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_eq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_le_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_lt_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpau_h_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpau_h_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpdp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpdpv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_s_h.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_s_h.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/insv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lbux.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lhx.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lwx.c
 create mode 100644 tests/tcg/mips/mips32-dsp/madd.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maddu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_s_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_s_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mfhi.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mflo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/modsub.c
 create mode 100644 tests/tcg/mips/mips32-dsp/msub.c
 create mode 100644 tests/tcg/mips/mips32-dsp/msubu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mthi.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mthlip.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mtlo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mulq_rs_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mult.c
 create mode 100644 tests/tcg/mips/mips32-dsp/multu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/packrl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/pick_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/pick_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceq_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceq_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/raddu_w_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/rddsp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/repl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/repl_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/replv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/replv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shilo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shilov.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrl_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrlv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subu_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subu_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/wrdsp.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/Makefile
 create mode 100644 tests/tcg/mips/mips32-dspr2/absq_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addu_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addu_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/adduh_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/adduh_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/append.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/balign.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpax_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dps_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mul_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mul_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/muleq_s_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/prepend.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shra_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shra_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrav_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrav_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrlv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subu_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subu_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subuh_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subuh_r_qb.c
tests/tcg/mips/mips32-dsp/Makefile new file +133 -0
new file mode 100644
index 0000000..ee8a386
@@ -0,0 +1,133 @@
+-include ../../config-host.mak
+
+CROSS=mipsel-unknown-linux-gnu-
+
+SIM=qemu-mipsel
+
+CC      = $(CROSS)gcc
+CFLAGS  = -march=mips32r2 -mgp32 -mdsp -static
+
+TESTCASES = absq_s_ph.tst
+TESTCASES += absq_s_w.tst
+TESTCASES += addq_ph.tst
+TESTCASES += addq_s_ph.tst
+TESTCASES += addsc.tst
+TESTCASES += addu_qb.tst
+TESTCASES += addu_s_qb.tst
+TESTCASES += addwc.tst
+TESTCASES += bitrev.tst
+TESTCASES += bposge32.tst
+TESTCASES += cmp_eq_ph.tst
+TESTCASES += cmpgu_eq_qb.tst
+TESTCASES += cmpgu_le_qb.tst
+TESTCASES += cmpgu_lt_qb.tst
+TESTCASES += cmp_le_ph.tst
+TESTCASES += cmp_lt_ph.tst
+TESTCASES += cmpu_eq_qb.tst
+TESTCASES += cmpu_le_qb.tst
+TESTCASES += cmpu_lt_qb.tst
+TESTCASES += dpaq_sa_l_w.tst
+TESTCASES += dpaq_s_w_ph.tst
+TESTCASES += dpau_h_qbl.tst
+TESTCASES += dpau_h_qbr.tst
+TESTCASES += dpsq_sa_l_w.tst
+TESTCASES += dpsq_s_w_ph.tst
+TESTCASES += dpsu_h_qbl.tst
+TESTCASES += dpsu_h_qbr.tst
+TESTCASES += extp.tst
+TESTCASES += extpdp.tst
+TESTCASES += extpdpv.tst
+TESTCASES += extpv.tst
+TESTCASES += extr_rs_w.tst
+TESTCASES += extr_r_w.tst
+TESTCASES += extr_s_h.tst
+TESTCASES += extrv_rs_w.tst
+TESTCASES += extrv_r_w.tst
+TESTCASES += extrv_s_h.tst
+TESTCASES += extrv_w.tst
+TESTCASES += extr_w.tst
+TESTCASES += insv.tst
+TESTCASES += lbux.tst
+TESTCASES += lhx.tst
+TESTCASES += lwx.tst
+TESTCASES += madd.tst
+TESTCASES += maddu.tst
+TESTCASES += maq_sa_w_phl.tst
+TESTCASES += maq_sa_w_phr.tst
+TESTCASES += maq_s_w_phl.tst
+TESTCASES += maq_s_w_phr.tst
+TESTCASES += mfhi.tst
+TESTCASES += mflo.tst
+TESTCASES += modsub.tst
+TESTCASES += msub.tst
+TESTCASES += msubu.tst
+TESTCASES += mthi.tst
+TESTCASES += mthlip.tst
+TESTCASES += mtlo.tst
+TESTCASES += muleq_s_w_phr.tst
+TESTCASES += muleu_s_ph_qbl.tst
+TESTCASES += muleu_s_ph_qbr.tst
+TESTCASES += mulq_rs_ph.tst
+TESTCASES += mult.tst
+TESTCASES += multu.tst
+TESTCASES += packrl_ph.tst
+TESTCASES += pick_ph.tst
+TESTCASES += pick_qb.tst
+TESTCASES += precequ_ph_qbla.tst
+TESTCASES += precequ_ph_qbl.tst
+TESTCASES += precequ_ph_qbra.tst
+TESTCASES += precequ_ph_qbr.tst
+TESTCASES += preceq_w_phl.tst
+TESTCASES += preceq_w_phr.tst
+TESTCASES += preceu_ph_qbla.tst
+TESTCASES += preceu_ph_qbl.tst
+TESTCASES += preceu_ph_qbra.tst
+TESTCASES += preceu_ph_qbr.tst
+TESTCASES += precrq_ph_w.tst
+TESTCASES += precrq_qb_ph.tst
+TESTCASES += precrq_rs_ph_w.tst
+TESTCASES += precrqu_s_qb_ph.tst
+TESTCASES += raddu_w_qb.tst
+TESTCASES += rddsp.tst
+TESTCASES += repl_ph.tst
+TESTCASES += repl_qb.tst
+TESTCASES += replv_ph.tst
+TESTCASES += replv_qb.tst
+TESTCASES += shilo.tst
+TESTCASES += shilov.tst
+TESTCASES += shll_ph.tst
+TESTCASES += shll_qb.tst
+TESTCASES += shll_s_ph.tst
+TESTCASES += shll_s_w.tst
+TESTCASES += shllv_ph.tst
+TESTCASES += shllv_qb.tst
+TESTCASES += shllv_s_ph.tst
+TESTCASES += shllv_s_w.tst
+TESTCASES += shra_ph.tst
+TESTCASES += shra_r_ph.tst
+TESTCASES += shra_r_w.tst
+TESTCASES += shrav_ph.tst
+TESTCASES += shrav_r_ph.tst
+TESTCASES += shrav_r_w.tst
+TESTCASES += shrl_qb.tst
+TESTCASES += shrlv_qb.tst
+TESTCASES += subq_ph.tst
+TESTCASES += subq_s_ph.tst
+TESTCASES += subq_s_w.tst
+TESTCASES += subu_qb.tst
+TESTCASES += subu_s_qb.tst
+TESTCASES += wrdsp.tst
+
+all: $(TESTCASES)
+
+%.tst: %.c
+	$(CC) $(CFLAGS) $< -o $@
+
+check: $(TESTCASES)
+	@for case in $(TESTCASES); do \
+        echo $(SIM) ./$$case;\
+        $(SIM) ./$$case; \
+	done
+
+clean:
+	$(RM) -rf $(TESTCASES)
tests/tcg/mips/mips32-dsp/absq_s_ph.c new file +30 -0
new file mode 100644
index 0000000..22db463
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt     = 0x10017EFD;
+    result = 0x10017EFD;
+
+    __asm
+        ("absq_s.ph %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    rt     = 0x8000A536;
+    result = 0x7FFF5ACA;
+
+    __asm
+        ("absq_s.ph %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/absq_s_w.c new file +37 -0
new file mode 100644
index 0000000..3f52a48
@@ -0,0 +1,37 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt     = 0x80000000;
+    result = 0x7FFFFFFF;
+    __asm
+        ("absq_s.w %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    rt     = 0x80030000;
+    result = 0x7FFD0000;
+    __asm
+        ("absq_s.w %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    rt     = 0x31036080;
+    result = 0x31036080;
+    __asm
+        ("absq_s.w %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/addq_ph.c new file +30 -0
new file mode 100644
index 0000000..2d9b6fc
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0xFFFFFFFF;
+    rt     = 0x10101010;
+    result = 0x100F100F;
+    __asm
+        ("addq.ph   %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    rs     = 0x3712847D;
+    rt     = 0x0031AF2D;
+    result = 0x374333AA;
+    __asm
+        ("addq.ph   %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/addq_s_ph.c new file +30 -0
new file mode 100644
index 0000000..ace1ecd
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0xFFFFFFFF;
+    rt     = 0x10101010;
+    result = 0x100F100F;
+    __asm
+        ("addq_s.ph   %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    rs     = 0x3712847D;
+    rt     = 0x0031AF2D;
+    result = 0x37438000;
+    __asm
+        ("addq_s.ph   %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/addsc.c new file +30 -0
new file mode 100644
index 0000000..9ad974a
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x0000000F;
+    rt     = 0x00000001;
+    result = 0x00000010;
+    __asm
+        ("addsc %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    rs     = 0xFFFF0FFF;
+    rt     = 0x00010111;
+    result = 0x00001110;
+    __asm
+        ("addsc %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/addu_qb.c new file +30 -0
new file mode 100644
index 0000000..1b98e5e
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x00FF00FF;
+    rt     = 0x00010001;
+    result = 0x00000000;
+    __asm
+        ("addu.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    rs     = 0xFFFF1111;
+    rt     = 0x00020001;
+    result = 0xFF011112;
+    __asm
+        ("addu.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/addu_s_qb.c new file +30 -0
new file mode 100644
index 0000000..46717ee
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x10FF01FF;
+    rt     = 0x10010001;
+    result = 0x20FF01FF;
+    __asm
+        ("addu_s.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    rs     = 0xFFFF1111;
+    rt     = 0x00020001;
+    result = 0xFFFF1112;
+    __asm
+        ("addu_s.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/addwc.c new file +30 -0
new file mode 100644
index 0000000..d47ac65
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x10FF01FF;
+    rt     = 0x10010001;
+    result = 0x21000200;
+    __asm
+        ("addwc %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    rs     = 0xFFFF1111;
+    rt     = 0x00020001;
+    result = 0x00011112;
+    __asm
+        ("addwc %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/bitrev.c new file +20 -0
new file mode 100644
index 0000000..04d8a38
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt     = 0x12345678;
+    result = 0x00001E6A;
+
+    __asm
+        ("bitrev %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/bposge32.c new file +44 -0

44 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/cmp_eq_ph.c new file +35 -0
new file mode 100644
index 0000000..957bd88
@@ -0,0 +1,35 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x11777066;
+    rt     = 0x55AA33FF;
+    result = 0x00;
+    __asm
+        ("cmp.eq.ph %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+
+    rd = (rd >> 24) & 0x03;
+    assert(rd == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11777066;
+    result = 0x03;
+    __asm
+        ("cmp.eq.ph %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    rd = (rd >> 24) & 0x03;
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/cmp_le_ph.c new file +35 -0
new file mode 100644
index 0000000..356f156
@@ -0,0 +1,35 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x11777066;
+    rt     = 0x55AA33FF;
+    result = 0x02;
+    __asm
+        ("cmp.le.ph %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+
+    rd = (rd >> 24) & 0x03;
+    assert(rd == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11777066;
+    result = 0x03;
+    __asm
+        ("cmp.le.ph %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    rd = (rd >> 24) & 0x03;
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/cmp_lt_ph.c new file +35 -0
new file mode 100644
index 0000000..3fb4827
@@ -0,0 +1,35 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x11777066;
+    rt     = 0x55AA33FF;
+    result = 0x02;
+    __asm
+        ("cmp.lt.ph %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+
+    rd = (rd >> 24) & 0x03;
+    assert(rd == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11777066;
+    result = 0x00;
+    __asm
+        ("cmp.lt.ph %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    rd = (rd >> 24) & 0x03;
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c new file +31 -0
new file mode 100644
index 0000000..2615c84
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x11777066;
+    rt     = 0x55AA70FF;
+    result = 0x02;
+    __asm
+        ("cmpgu.eq.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+
+    assert(rd == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11777066;
+    result = 0x0F;
+    __asm
+        ("cmpgu.eq.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c new file +31 -0
new file mode 100644
index 0000000..65d0813
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x11777066;
+    rt     = 0x55AA70FF;
+    result = 0x0F;
+    __asm
+        ("cmpgu.le.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+
+    assert(rd == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11766066;
+    result = 0x09;
+    __asm
+        ("cmpgu.le.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c new file +31 -0
new file mode 100644
index 0000000..7dddad9
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x11777066;
+    rt     = 0x55AA70FF;
+    result = 0x0D;
+    __asm
+        ("cmpgu.lt.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+
+    assert(rd == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11766066;
+    result = 0x00;
+    __asm
+        ("cmpgu.lt.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c new file +35 -0
new file mode 100644
index 0000000..680f2a1
@@ -0,0 +1,35 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt;
+    int dsp;
+    int result;
+
+    rs         = 0x11777066;
+    rt         = 0x55AA70FF;
+    result     = 0x02;
+    __asm
+        ("cmpu.eq.qb %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 24) & 0x0F;
+    assert(dsp == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11777066;
+    result = 0x0F;
+    __asm
+        ("cmpu.eq.qb %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 24) & 0x0F;
+    assert(dsp == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/cmpu_le_qb.c new file +35 -0
new file mode 100644
index 0000000..43cfa50
@@ -0,0 +1,35 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt;
+    int dsp;
+    int result;
+
+    rs         = 0x11777066;
+    rt         = 0x55AA70FF;
+    result     = 0x0F;
+    __asm
+        ("cmpu.le.qb %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 24) & 0x0F;
+    assert(dsp == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11777066;
+    result = 0x0F;
+    __asm
+        ("cmpu.le.qb %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 24) & 0x0F;
+    assert(dsp == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c new file +35 -0
new file mode 100644
index 0000000..074ca5b
@@ -0,0 +1,35 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt;
+    int dsp;
+    int result;
+
+    rs         = 0x11777066;
+    rt         = 0x55AA70FF;
+    result     = 0x0D;
+    __asm
+        ("cmpu.lt.qb %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 24) & 0x0F;
+    assert(dsp == result);
+
+    rs     = 0x11777066;
+    rt     = 0x11777066;
+    result = 0x00;
+    __asm
+        ("cmpu.lt.qb %1, %2\n\t"
+         "rddsp %0\n\t"
+         : "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 24) & 0x0F;
+    assert(dsp == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c new file +31 -0
new file mode 100644
index 0000000..a6425b6
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt, dsp;
+    int ach = 0, acl = 0;
+    int resulth, resultl, resultdsp;
+
+    rs        = 0x800000FF;
+    rt        = 0x80000002;
+    resulth   = 0x00;
+    resultl   = 0x800003FB;
+    resultdsp = 0x01;
+    __asm
+        ("mthi        %0, $ac1\n\t"
+         "mtlo        %1, $ac1\n\t"
+         "dpaq_s.w.ph $ac1, %3, %4\n\t"
+         "mfhi        %0,   $ac1\n\t"
+         "mflo        %1,   $ac1\n\t"
+         "rddsp       %2\n\t"
+         : "+r"(ach), "+r"(acl), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = dsp >> 17 & 0x01;
+    assert(dsp == resultdsp);
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c new file +31 -0
new file mode 100644
index 0000000..02bac2a
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt, dsp;
+    int ach = 0, acl = 0;
+    int resulth, resultl, resultdsp;
+
+    rs        = 0x800000FF;
+    rt        = 0x80000002;
+    resulth   = 0x7FFFFFFF;
+    resultl   = 0xFFFFFFFF;
+    resultdsp = 0x01;
+    __asm
+        ("mthi        %0, $ac1\n\t"
+         "mtlo        %0, $ac1\n\t"
+         "dpaq_sa.l.w $ac1, %3, %4\n\t"
+         "mfhi        %0,   $ac1\n\t"
+         "mflo        %1,   $ac1\n\t"
+         "rddsp       %2\n\t"
+         : "+r"(ach), "+r"(acl), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 17) & 0x01;
+    assert(dsp == resultdsp);
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/dpau_h_qbl.c new file +27 -0
new file mode 100644
index 0000000..6017b5e
@@ -0,0 +1,27 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt;
+    int ach = 5, acl = 3;
+    int resulth, resultl;
+
+    rs        = 0x800000FF;
+    rt        = 0x80000002;
+    resulth   = 0x05;
+    resultl   = 0x4003;
+    __asm
+        ("mthi       %0, $ac1\n\t"
+         "mtlo       %1, $ac1\n\t"
+         "dpau.h.qbl $ac1, %2, %3\n\t"
+         "mfhi       %0,   $ac1\n\t"
+         "mflo       %1,   $ac1\n\t"
+         : "+r"(ach), "+r"(acl)
+         : "r"(rs), "r"(rt)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/dpau_h_qbr.c new file +27 -0
new file mode 100644
index 0000000..e4abb2e
@@ -0,0 +1,27 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt;
+    int ach = 5, acl = 3;
+    int resulth, resultl;
+
+    rs        = 0x800000FF;
+    rt        = 0x80000002;
+    resulth   = 0x05;
+    resultl   = 0x0201;
+    __asm
+        ("mthi       %0, $ac1\n\t"
+         "mtlo       %1, $ac1\n\t"
+         "dpau.h.qbr $ac1, %2, %3\n\t"
+         "mfhi       %0,   $ac1\n\t"
+         "mflo       %1,   $ac1\n\t"
+         : "+r"(ach), "+r"(acl)
+         : "r"(rs), "r"(rt)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c new file +27 -0
new file mode 100644
index 0000000..70ad443
@@ -0,0 +1,27 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt;
+    int ach = 5, acl = 5;
+    int resulth, resultl;
+
+    rs      = 0xBC0123AD;
+    rt      = 0x01643721;
+    resulth = 0x04;
+    resultl = 0xEE9794A3;
+    __asm
+        ("mthi  %0, $ac1\n\t"
+         "mtlo  %1, $ac1\n\t"
+         "dpsq_s.w.ph $ac1, %2, %3\n\t"
+         "mfhi  %0, $ac1\n\t"
+         "mflo  %1, $ac1\n\t"
+         : "+r"(ach), "+r"(acl)
+         : "r"(rs), "r"(rt)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c new file +31 -0
new file mode 100644
index 0000000..3d6b24c
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt, dsp;
+    int ach = 5, acl = 5;
+    int resulth, resultl, resultdsp;
+
+    rs      = 0xBC0123AD;
+    rt      = 0x01643721;
+    resulth = 0x7FFFFFFF;
+    resultl = 0xFFFFFFFF;
+    resultdsp = 0x01;
+    __asm
+        ("mthi  %0, $ac1\n\t"
+         "mtlo  %1, $ac1\n\t"
+         "dpsq_sa.l.w $ac1, %3, %4\n\t"
+         "mfhi  %0, $ac1\n\t"
+         "mflo  %1, $ac1\n\t"
+         "rddsp %2\n\t"
+         : "+r"(ach), "+r"(acl), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 17) & 0x01;
+    assert(dsp == resultdsp);
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c new file +27 -0
new file mode 100644
index 0000000..94e2bf6
@@ -0,0 +1,27 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt;
+    int ach = 5, acl = 5;
+    int resulth, resultl;
+
+    rs      = 0xBC0123AD;
+    rt      = 0x01643721;
+    resulth = 0x04;
+    resultl = 0xFFFFFEE5;
+    __asm
+        ("mthi  %0, $ac1\n\t"
+         "mtlo  %1, $ac1\n\t"
+         "dpsu.h.qbl $ac1, %2, %3\n\t"
+         "mfhi  %0, $ac1\n\t"
+         "mflo  %1, $ac1\n\t"
+         : "+r"(ach), "+r"(acl)
+         : "r"(rs), "r"(rt)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c new file +27 -0
new file mode 100644
index 0000000..a1e6635
@@ -0,0 +1,27 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt;
+    int ach = 5, acl = 5;
+    int resulth, resultl;
+
+    rs      = 0xBC0123AD;
+    rt      = 0x01643721;
+    resulth = 0x04;
+    resultl = 0xFFFFE233;
+    __asm
+        ("mthi  %0, $ac1\n\t"
+         "mtlo  %1, $ac1\n\t"
+         "dpsu.h.qbr $ac1, %2, %3\n\t"
+         "mfhi  %0, $ac1\n\t"
+         "mflo  %1, $ac1\n\t"
+         : "+r"(ach), "+r"(acl)
+         : "r"(rs), "r"(rt)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/extp.c new file +44 -0

44 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/extpdp.c new file +46 -0

46 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/extpdpv.c new file +47 -0

47 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/extpv.c new file +45 -0

45 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/extr_r_w.c new file +25 -0
new file mode 100644
index 0000000..570dfbd
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, ach, acl, dsp;
+    int result;
+
+    ach = 0x05;
+    acl = 0xB4CB;
+    result = 0xA0001699;
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "extr_r.w %0, $ac1, 0x03\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rt), "=r"(dsp)
+         : "r"(ach), "r"(acl)
+        );
+    dsp = (dsp >> 23) & 0x01;
+    assert(dsp == 1);
+    assert(result == rt);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/extr_rs_w.c new file +25 -0
new file mode 100644
index 0000000..a0bf7b4
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, ach, acl, dsp;
+    int result;
+
+    ach = 0x05;
+    acl = 0xB4CB;
+    result = 0x7FFFFFFF;
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "extr_rs.w %0, $ac1, 0x03\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rt), "=r"(dsp)
+         : "r"(ach), "r"(acl)
+        );
+    dsp = (dsp >> 23) & 0x01;
+    assert(dsp == 1);
+    assert(result == rt);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/extr_s_h.c new file +25 -0
new file mode 100644
index 0000000..c863f29
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, ach, acl, dsp;
+    int result;
+
+    ach = 0x05;
+    acl = 0xB4CB;
+    result = 0x00007FFF;
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "extr_s.h %0, $ac1, 0x03\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rt), "=r"(dsp)
+         : "r"(ach), "r"(acl)
+        );
+    dsp = (dsp >> 23) & 0x01;
+    assert(dsp == 1);
+    assert(result == rt);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/extr_w.c new file +25 -0
new file mode 100644
index 0000000..40994cb
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, ach, acl, dsp;
+    int result;
+
+    ach = 0x05;
+    acl = 0xB4CB;
+    result = 0xA0001699;
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "extr.w %0, $ac1, 0x03\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rt), "=r"(dsp)
+         : "r"(ach), "r"(acl)
+        );
+    dsp = (dsp >> 23) & 0x01;
+    assert(dsp == 1);
+    assert(result == rt);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/extrv_r_w.c new file +29 -0
new file mode 100644
index 0000000..43aba53
@@ -0,0 +1,29 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs, ach, acl, dsp;
+    int result;
+
+    ach = 0x05;
+    acl = 0xB4CB;
+    dsp = 0x07;
+    rs  = 0x03;
+    result = 0xA0001699;
+
+    __asm
+        ("wrdsp %1, 0x01\n\t"
+         "mthi %3, $ac1\n\t"
+         "mtlo %4, $ac1\n\t"
+         "extrv_r.w %0, $ac1, %2\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rt), "+r"(dsp)
+         : "r"(rs), "r"(ach), "r"(acl)
+        );
+    dsp = (dsp >> 23) & 0x01;
+    assert(dsp == 1);
+    assert(result == rt);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/extrv_rs_w.c new file +29 -0
new file mode 100644
index 0000000..60e0d43
@@ -0,0 +1,29 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs, ach, acl, dsp;
+    int result;
+
+    ach = 0x05;
+    acl = 0xB4CB;
+    dsp = 0x07;
+    rs  = 0x03;
+    result = 0x7FFFFFFF;
+
+    __asm
+        ("wrdsp %1, 0x01\n\t"
+         "mthi %3, $ac1\n\t"
+         "mtlo %4, $ac1\n\t"
+         "extrv_rs.w %0, $ac1, %2\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rt), "+r"(dsp)
+         : "r"(rs), "r"(ach), "r"(acl)
+        );
+    dsp = (dsp >> 23) & 0x01;
+    assert(dsp == 1);
+    assert(result == rt);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/extrv_s_h.c new file +29 -0
new file mode 100644
index 0000000..c7f70e3
@@ -0,0 +1,29 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs, ach, acl, dsp;
+    int result;
+
+    ach = 0x05;
+    acl = 0xB4CB;
+    dsp = 0x07;
+    rs  = 0x03;
+    result = 0x00007FFF;
+
+    __asm
+        ("wrdsp %1, 0x01\n\t"
+         "mthi %3, $ac1\n\t"
+         "mtlo %4, $ac1\n\t"
+         "extrv_s.h %0, $ac1, %2\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rt), "+r"(dsp)
+         : "r"(rs), "r"(ach), "r"(acl)
+        );
+    dsp = (dsp >> 23) & 0x01;
+    assert(dsp == 1);
+    assert(result == rt);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/extrv_w.c new file +29 -0
new file mode 100644
index 0000000..c63a25c
@@ -0,0 +1,29 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs, ach, acl, dsp;
+    int result;
+
+    ach = 0x05;
+    acl = 0xB4CB;
+    dsp = 0x07;
+    rs  = 0x03;
+    result = 0xA0001699;
+
+    __asm
+        ("wrdsp %1, 0x01\n\t"
+         "mthi %3, $ac1\n\t"
+         "mtlo %4, $ac1\n\t"
+         "extrv.w %0, $ac1, %2\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rt), "+r"(dsp)
+         : "r"(rs), "r"(ach), "r"(acl)
+        );
+    dsp = (dsp >> 23) & 0x01;
+    assert(dsp == 1);
+    assert(result == rt);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/insv.c new file +23 -0
new file mode 100644
index 0000000..7e3b047
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs, dsp;
+    int result;
+
+    /* msb = 10, lsb = 5 */
+    dsp    = 0x305;
+    rt     = 0x12345678;
+    rs     = 0x87654321;
+    result = 0x12345338;
+    __asm
+        ("wrdsp %2, 0x03\n\t"
+         "insv  %0, %1\n\t"
+         : "+r"(rt)
+         : "r"(rs), "r"(dsp)
+        );
+    assert(rt == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/lbux.c new file +23 -0
new file mode 100644
index 0000000..7e8ab9c
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int value, index, rd;
+    int result;
+
+    value  = 0xBCDEF389;
+    index  = 28;
+    result = value & 0xFF;
+    __asm
+        ("lw  $10, 28($fp)\n\t"
+         "sw  %2,  28($fp)\n\t"
+         "lbux %0, %1($fp)\n\t"
+         "sw  $10, 28($fp)\n\t"
+         : "=r"(rd)
+         : "r"(index), "r"(value)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/lhx.c new file +23 -0
new file mode 100644
index 0000000..45edf19
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int value, index, rd;
+    int result;
+
+    value  = 0xBCDEF389;
+    index  = 28;
+    result = 0xFFFFF389;
+    __asm
+        ("lw  $10, 28($fp)\n\t"
+         "sw  %2,  28($fp)\n\t"
+         "lhx %0, %1($fp)\n\t"
+         "sw  $10, 28($fp)\n\t"
+         : "=r"(rd)
+         : "r"(index), "r"(value)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/lwx.c new file +23 -0
new file mode 100644
index 0000000..0f1b457
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int value, index, rd;
+    int result;
+
+    value  = 0xBCDEF389;
+    index  = 28;
+    result = value;
+    __asm
+        ("lw  $10, 28($fp)\n\t"
+         "sw  %2,  28($fp)\n\t"
+         "lwx %0, %1($fp)\n\t"
+         "sw  $10, 28($fp)\n\t"
+         : "=r"(rd)
+         : "r"(index), "r"(value)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/madd.c new file +31 -0
new file mode 100644
index 0000000..af4bfcf
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs;
+    int achi, acli;
+    int acho, aclo;
+    int resulth, resultl;
+
+    achi = 0x05;
+    acli = 0xB4CB;
+    rs  = 0x01;
+    rt  = 0x01;
+    resulth = 0x05;
+    resultl = 0xB4CC;
+
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "madd $ac1, %4, %5\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(acho), "=r"(aclo)
+         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
+        );
+    assert(resulth == acho);
+    assert(resultl == aclo);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/maddu.c new file +31 -0
new file mode 100644
index 0000000..af4bfcf
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs;
+    int achi, acli;
+    int acho, aclo;
+    int resulth, resultl;
+
+    achi = 0x05;
+    acli = 0xB4CB;
+    rs  = 0x01;
+    rt  = 0x01;
+    resulth = 0x05;
+    resultl = 0xB4CC;
+
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "madd $ac1, %4, %5\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(acho), "=r"(aclo)
+         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
+        );
+    assert(resulth == acho);
+    assert(resultl == aclo);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/maq_s_w_phl.c new file +31 -0
new file mode 100644
index 0000000..f5de818
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs;
+    int achi, acli;
+    int acho, aclo;
+    int resulth, resultl;
+
+    achi = 0x05;
+    acli = 0xB4CB;
+    rs  = 0xFF060000;
+    rt  = 0xCB000000;
+    resulth = 0x04;
+    resultl = 0x947438CB;
+
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "maq_s.w.phl $ac1, %4, %5\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(acho), "=r"(aclo)
+         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
+        );
+    assert(resulth == acho);
+    assert(resultl == aclo);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/maq_s_w_phr.c new file +31 -0
new file mode 100644
index 0000000..8336f00
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs;
+    int achi, acli;
+    int acho, aclo;
+    int resulth, resultl;
+
+    achi = 0x05;
+    acli = 0xB4CB;
+    rs  = 0xFF06;
+    rt  = 0xCB00;
+    resulth = 0x04;
+    resultl = 0x947438CB;
+
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "maq_s.w.phr $ac1, %4, %5\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(acho), "=r"(aclo)
+         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
+        );
+    assert(resulth == acho);
+    assert(resultl == aclo);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c new file +31 -0
new file mode 100644
index 0000000..35c5bfb
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs;
+    int achi, acli;
+    int acho, aclo;
+    int resulth, resultl;
+
+    achi = 0x05;
+    acli = 0xB4CB;
+    rs  = 0xFF060000;
+    rt  = 0xCB000000;
+    resulth = 0xFFFFFFFF;
+    resultl = 0x80000000;
+
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "maq_sa.w.phl $ac1, %4, %5\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(acho), "=r"(aclo)
+         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
+        );
+    assert(resulth == acho);
+    assert(resultl == aclo);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c new file +31 -0
new file mode 100644
index 0000000..45ba792
@@ -0,0 +1,31 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rt, rs;
+    int achi, acli;
+    int acho, aclo;
+    int resulth, resultl;
+
+    achi = 0x05;
+    acli = 0xB4CB;
+    rs  = 0xFF06;
+    rt  = 0xCB00;
+    resulth = 0xFFFFFFFF;
+    resultl = 0x80000000;
+
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "maq_sa.w.phr $ac1, %4, %5\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(acho), "=r"(aclo)
+         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
+        );
+    assert(resulth == acho);
+    assert(resultl == aclo);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/mfhi.c new file +21 -0
new file mode 100644
index 0000000..43a8066
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int achi, acho;
+    int result;
+
+    achi   = 0x004433;
+    result = 0x004433;
+
+    __asm
+        ("mthi %1, $ac1\n\t"
+         "mfhi %0, $ac1\n\t"
+         : "=r"(acho)
+         : "r"(achi)
+        );
+    assert(result == acho);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/mflo.c new file +21 -0
new file mode 100644
index 0000000..caeafdb
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int acli, aclo;
+    int result;
+
+    acli   = 0x004433;
+    result = 0x004433;
+
+    __asm
+        ("mthi %1, $ac1\n\t"
+         "mfhi %0, $ac1\n\t"
+         : "=r"(aclo)
+         : "r"(acli)
+        );
+    assert(result == aclo);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/modsub.c new file +30 -0
new file mode 100644
index 0000000..c294eeb
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0xFFFFFFFF;
+    rt     = 0x000000FF;
+    result = 0xFFFFFF00;
+    __asm
+        ("modsub %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    rs     = 0x00000000;
+    rt     = 0x00CD1FFF;
+    result = 0x0000CD1F;
+    __asm
+        ("modsub %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/msub.c new file +30 -0
new file mode 100644
index 0000000..5779e6f
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int achi, acli, rs, rt;
+    int acho, aclo;
+    int resulth, resultl;
+
+    rs      = 0x00BBAACC;
+    rt      = 0x0B1C3D2F;
+    achi    = 0x00004433;
+    acli    = 0xFFCC0011;
+    resulth = 0xFFF81F29;
+    resultl = 0xB355089D;
+
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "msub $ac1, %4, %5\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(acho), "=r"(aclo)
+         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
+        );
+    assert(acho == resulth);
+    assert(aclo == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/msubu.c new file +30 -0
new file mode 100644
index 0000000..e0f9b5a
@@ -0,0 +1,30 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int achi, acli, rs, rt;
+    int acho, aclo;
+    int resulth, resultl;
+
+    rs      = 0x00BBAACC;
+    rt      = 0x0B1C3D2F;
+    achi    = 0x00004433;
+    acli    = 0xFFCC0011;
+    resulth = 0xFFF81F29;
+    resultl = 0xB355089D;
+
+    __asm
+        ("mthi %2, $ac1\n\t"
+         "mtlo %3, $ac1\n\t"
+         "msubu $ac1, %4, %5\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(acho), "=r"(aclo)
+         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
+        );
+    assert(acho == resulth);
+    assert(aclo == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/mthi.c new file +21 -0
new file mode 100644
index 0000000..43a8066
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int achi, acho;
+    int result;
+
+    achi   = 0x004433;
+    result = 0x004433;
+
+    __asm
+        ("mthi %1, $ac1\n\t"
+         "mfhi %0, $ac1\n\t"
+         : "=r"(acho)
+         : "r"(achi)
+        );
+    assert(result == acho);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/mthlip.c new file +34 -0
new file mode 100644
index 0000000..74e83bf
@@ -0,0 +1,34 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, ach, acl, dsp;
+    int result, resulth, resultl;
+
+    dsp = 0x07;
+    ach = 0x05;
+    acl = 0xB4CB;
+    rs  = 0x00FFBBAA;
+    resulth = 0xB4CB;
+    resultl = 0x00FFBBAA;
+    result  = 0x27;
+
+    __asm
+        ("wrdsp %0, 0x01\n\t"
+         "mthi %1, $ac1\n\t"
+         "mtlo %2, $ac1\n\t"
+         "mthlip %3, $ac1\n\t"
+         "mfhi %1, $ac1\n\t"
+         "mflo %2, $ac1\n\t"
+         "rddsp %0\n\t"
+         : "+r"(dsp), "+r"(ach), "+r"(acl)
+         : "r"(rs)
+        );
+    dsp = dsp & 0x3F;
+    assert(dsp == result);
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/mtlo.c new file +21 -0
new file mode 100644
index 0000000..caeafdb
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int acli, aclo;
+    int result;
+
+    acli   = 0x004433;
+    result = 0x004433;
+
+    __asm
+        ("mthi %1, $ac1\n\t"
+         "mfhi %0, $ac1\n\t"
+         : "=r"(aclo)
+         : "r"(acli)
+        );
+    assert(result == aclo);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c new file +40 -0
new file mode 100644
index 0000000..8066d7d
@@ -0,0 +1,40 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs = 0x8000;
+    rt = 0x8000;
+    result = 0x7FFFFFFF;
+    resultdsp = 1;
+
+    __asm
+        ("muleq_s.w.phr %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 21) & 0x01;
+    assert(rd  == result);
+    assert(dsp == resultdsp);
+
+    rs = 0x1234;
+    rt = 0x4321;
+    result = 0x98be968;
+    resultdsp = 1;
+
+    __asm
+        ("muleq_s.w.phr %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 21) & 0x01;
+    assert(rd  == result);
+    assert(dsp == resultdsp);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c new file +25 -0
new file mode 100644
index 0000000..66a3828
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs = 0x80001234;
+    rt = 0x80004321;
+    result = 0xFFFF0000;
+    resultdsp = 1;
+
+    __asm
+        ("muleu_s.ph.qbl %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 21) & 0x01;
+    assert(rd  == result);
+    assert(dsp == resultdsp);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c new file +25 -0
new file mode 100644
index 0000000..4cc6c8f
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs = 0x8000;
+    rt = 0x80004321;
+    result = 0xFFFF0000;
+    resultdsp = 1;
+
+    __asm
+        ("muleu_s.ph.qbr %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 21) & 0x01;
+    assert(rd  == result);
+    assert(dsp == resultdsp);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/mulq_rs_ph.c new file +25 -0
new file mode 100644
index 0000000..c720603
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs = 0x80001234;
+    rt = 0x80004321;
+    result = 0x7FFF098C;
+    resultdsp = 1;
+
+    __asm
+        ("mulq_rs.ph %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 21) & 0x01;
+    assert(rd  == result);
+    assert(dsp == resultdsp);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/mult.c new file +24 -0
new file mode 100644
index 0000000..15e6fde
@@ -0,0 +1,24 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt, ach, acl;
+    int result, resulth, resultl;
+
+    rs  = 0x00FFBBAA;
+    rt  = 0x4B231000;
+    resulth = 0x4b0f01;
+    resultl = 0x71f8a000;
+    __asm
+        ("mult $ac1, %2, %3\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(ach), "=r"(acl)
+         : "r"(rs), "r"(rt)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/multu.c new file +24 -0
new file mode 100644
index 0000000..15e6fde
@@ -0,0 +1,24 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, rt, ach, acl;
+    int result, resulth, resultl;
+
+    rs  = 0x00FFBBAA;
+    rt  = 0x4B231000;
+    resulth = 0x4b0f01;
+    resultl = 0x71f8a000;
+    __asm
+        ("mult $ac1, %2, %3\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "=r"(ach), "=r"(acl)
+         : "r"(rs), "r"(rt)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/packrl_ph.c new file +21 -0
new file mode 100644
index 0000000..1f8e699
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    result = 0x56788765;
+
+    __asm
+        ("packrl.ph %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/pick_ph.c new file +23 -0
new file mode 100644
index 0000000..73342cb
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    dsp = 0x0A000000;
+    result = 0x12344321;
+
+    __asm
+        ("wrdsp %3, 0x10\n\t"
+         "pick.ph %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt), "r"(dsp)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/pick_qb.c new file +23 -0
new file mode 100644
index 0000000..052cc58
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    dsp = 0x0A000000;
+    result = 0x12655621;
+
+    __asm
+        ("wrdsp %3, 0x10\n\t"
+         "pick.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt), "r"(dsp)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/preceq_w_phl.c new file +20 -0
new file mode 100644
index 0000000..bf70bf7
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x87650000;
+
+    __asm
+        ("preceq.w.phl %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/preceq_w_phr.c new file +20 -0
new file mode 100644
index 0000000..3f885ef
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x43210000;
+
+    __asm
+        ("preceq.w.phr %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c new file +20 -0
new file mode 100644
index 0000000..63b7a95
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x43803280;
+
+    __asm
+        ("precequ.ph.qbl %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c new file +20 -0
new file mode 100644
index 0000000..31627f0
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x43802180;
+
+    __asm
+        ("precequ.ph.qbla %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c new file +20 -0
new file mode 100644
index 0000000..b6f72d3
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x21801080;
+
+    __asm
+        ("precequ.ph.qbr %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c new file +20 -0
new file mode 100644
index 0000000..4764fd0
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x32801080;
+
+    __asm
+        ("precequ.ph.qbra %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c new file +20 -0
new file mode 100644
index 0000000..fa95c26
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x00870065;
+
+    __asm
+        ("preceu.ph.qbl %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c new file +20 -0
new file mode 100644
index 0000000..021f21a
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x00870043;
+
+    __asm
+        ("preceu.ph.qbla %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c new file +20 -0
new file mode 100644
index 0000000..03df18c
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x00430021;
+
+    __asm
+        ("preceu.ph.qbr %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c new file +20 -0
new file mode 100644
index 0000000..6343276
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x87654321;
+    result = 0x00650021;
+
+    __asm
+        ("preceu.ph.qbra %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/precrq_ph_w.c new file +21 -0
new file mode 100644
index 0000000..25d45f1
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    result = 0x12348765;
+
+    __asm
+        ("precrq.ph.w %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/precrq_qb_ph.c new file +21 -0
new file mode 100644
index 0000000..fe23acc
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    result = 0x12568743;
+
+    __asm
+        ("precrq.qb.ph %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c new file +21 -0
new file mode 100644
index 0000000..87214b8
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    result = 0x12348765;
+
+    __asm
+        ("precrq_rs.ph.w %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c new file +21 -0
new file mode 100644
index 0000000..9a459cc
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    result = 0x24AC0086;
+
+    __asm
+        ("precrqu_s.qb.ph %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rs), "r"(rt)
+        );
+    assert(result == rd);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/raddu_w_qb.c new file +20 -0
new file mode 100644
index 0000000..77a983c
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs;
+    int result;
+
+    rs = 0x12345678;
+    result = 0x114;
+
+    __asm
+        ("raddu.w.qb %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rs)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/rddsp.c new file +54 -0

54 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/repl_ph.c new file +23 -0
new file mode 100644
index 0000000..2107495
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, result;
+
+    result = 0x01BF01BF;
+    __asm
+        ("repl.ph %0, 0x1BF\n\t"
+         : "=r"(rd)
+        );
+    assert(rd == result);
+
+    result = 0x01FF01FF;
+    __asm
+        ("repl.ph %0, 0x01FF\n\t"
+         : "=r"(rd)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/repl_qb.c new file +16 -0
new file mode 100644
index 0000000..6631393
@@ -0,0 +1,16 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, result;
+
+    result = 0xBFBFBFBF;
+    __asm
+        ("repl.qb %0, 0xBF\n\t"
+         : "=r"(rd)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/replv_ph.c new file +19 -0
new file mode 100644
index 0000000..07fb15f
@@ -0,0 +1,19 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt = 0x12345678;
+    result = 0x56785678;
+    __asm
+        ("replv.ph %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/replv_qb.c new file +19 -0
new file mode 100644
index 0000000..dd1271f
@@ -0,0 +1,19 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt     = 0x12345678;
+    result = 0x78787878;
+    __asm
+        ("replv.qb %0, %1\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shilo.c new file +27 -0
new file mode 100644
index 0000000..b686616
@@ -0,0 +1,27 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int ach, acl;
+    int resulth, resultl;
+
+    ach = 0xBBAACCFF;
+    acl = 0x1C3B001D;
+
+    resulth = 0x17755;
+    resultl = 0x99fe3876;
+
+    __asm
+        ("mthi %0, $ac1\n\t"
+         "mtlo %1, $ac1\n\t"
+         "shilo $ac1, 0x0F\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "+r"(ach), "+r"(acl)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shilov.c new file +29 -0
new file mode 100644
index 0000000..f186032
@@ -0,0 +1,29 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rs, ach, acl;
+    int resulth, resultl;
+
+    rs  = 0x0F;
+    ach = 0xBBAACCFF;
+    acl = 0x1C3B001D;
+
+    resulth = 0x17755;
+    resultl = 0x99fe3876;
+
+    __asm
+        ("mthi %0, $ac1\n\t"
+         "mtlo %1, $ac1\n\t"
+         "shilov $ac1, %2\n\t"
+         "mfhi %0, $ac1\n\t"
+         "mflo %1, $ac1\n\t"
+         : "+r"(ach), "+r"(acl)
+         : "r"(rs)
+        );
+    assert(ach == resulth);
+    assert(acl == resultl);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shll_ph.c new file +24 -0
new file mode 100644
index 0000000..b8f1ff5
@@ -0,0 +1,24 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt, dsp;
+    int result, resultdsp;
+
+    rt        = 0x12345678;
+    result    = 0xA000C000;
+    resultdsp = 1;
+
+    __asm
+        ("shll.ph %0, %2, 0x0B\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rt)
+        );
+    dsp = (dsp >> 22) & 0x01;
+    assert(dsp == resultdsp);
+    assert(rd  == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shll_qb.c new file +23 -0
new file mode 100644
index 0000000..d79814c
@@ -0,0 +1,23 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt, dsp;
+    int result, resultdsp;
+
+    rt     = 0x87654321;
+    result = 0x38281808;
+    resultdsp = 0x01;
+
+    __asm
+        ("shll.qb %0, %2, 0x03\n\t"
+         "rddsp   %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rt)
+        );
+    dsp = (dsp >> 22) & 0x01;
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shll_s_ph.c new file +24 -0
new file mode 100644
index 0000000..910fea3
@@ -0,0 +1,24 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt, dsp;
+    int result, resultdsp;
+
+    rt        = 0x12345678;
+    result    = 0x7FFF7FFF;
+    resultdsp = 0x01;
+
+    __asm
+        ("shll_s.ph %0, %2, 0x0B\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rt)
+        );
+    dsp = (dsp >> 22) & 0x01;
+    assert(dsp == resultdsp);
+    assert(rd  == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shll_s_w.c new file +24 -0
new file mode 100644
index 0000000..c42c168
@@ -0,0 +1,24 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt, dsp;
+    int result, resultdsp;
+
+    rt        = 0x12345678;
+    result    = 0x7FFFFFFF;
+    resultdsp = 0x01;
+
+    __asm
+        ("shll_s.w %0, %2, 0x0B\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rt)
+        );
+    dsp = (dsp >> 22) & 0x01;
+    assert(dsp == resultdsp);
+    assert(rd  == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shllv_ph.c new file +25 -0
new file mode 100644
index 0000000..b0fcae8
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs        = 0x0B;
+    rt        = 0x12345678;
+    result    = 0xA000C000;
+    resultdsp = 1;
+
+    __asm
+        ("shllv.ph %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rt), "r"(rs)
+        );
+    dsp = (dsp >> 22) & 0x01;
+    assert(dsp == resultdsp);
+    assert(rd  == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shllv_qb.c new file +24 -0
new file mode 100644
index 0000000..0bcc24c
@@ -0,0 +1,24 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs     = 0x03;
+    rt     = 0x87654321;
+    result = 0x38281808;
+    resultdsp = 0x01;
+
+    __asm
+        ("shllv.qb %0, %2, %3\n\t"
+         "rddsp   %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rt), "r"(rs)
+        );
+    dsp = (dsp >> 22) & 0x01;
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shllv_s_ph.c new file +25 -0
new file mode 100644
index 0000000..a6d61b1
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs        = 0x0B;
+    rt        = 0x12345678;
+    result    = 0x7FFF7FFF;
+    resultdsp = 0x01;
+
+    __asm
+        ("shllv_s.ph %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rt), "r"(rs)
+        );
+    dsp = (dsp >> 22) & 0x01;
+    assert(dsp == resultdsp);
+    assert(rd  == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shllv_s_w.c new file +25 -0
new file mode 100644
index 0000000..69c896d
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs        = 0x0B;
+    rt        = 0x12345678;
+    result    = 0x7FFFFFFF;
+    resultdsp = 0x01;
+
+    __asm
+        ("shllv_s.w %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rt), "r"(rs)
+        );
+    dsp = (dsp >> 22) & 0x01;
+    assert(dsp == resultdsp);
+    assert(rd  == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shra_ph.c new file +20 -0
new file mode 100644
index 0000000..be7711a
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt     = 0x87654321;
+    result = 0xF0EC0864;
+
+    __asm
+        ("shra.ph %0, %1, 0x03\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shra_r_ph.c new file +20 -0
new file mode 100644
index 0000000..bb64683
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt     = 0x87654321;
+    result = 0xF0ED0864;
+
+    __asm
+        ("shra_r.ph %0, %1, 0x03\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shra_r_w.c new file +20 -0
new file mode 100644
index 0000000..b94748c
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt     = 0x87654321;
+    result = 0xF0ECA864;
+
+    __asm
+        ("shra_r.w %0, %1, 0x03\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shrav_ph.c new file +21 -0
new file mode 100644
index 0000000..a4db736
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x03;
+    rt     = 0x87654321;
+    result = 0xF0EC0864;
+
+    __asm
+        ("shrav.ph %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rt), "r"(rs)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shrav_r_ph.c new file +21 -0
new file mode 100644
index 0000000..f6d3c70
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x03;
+    rt     = 0x87654321;
+    result = 0xF0ED0864;
+
+    __asm
+        ("shrav_r.ph %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rt), "r"(rs)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shrav_r_w.c new file +21 -0
new file mode 100644
index 0000000..1841381
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x03;
+    rt     = 0x87654321;
+    result = 0xF0ECA864;
+
+    __asm
+        ("shrav_r.w %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rt), "r"(rs)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shrl_qb.c new file +20 -0
new file mode 100644
index 0000000..ccc991f
@@ -0,0 +1,20 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rt;
+    int result;
+
+    rt     = 0x12345678;
+    result = 0x00010203;
+
+    __asm
+        ("shrl.qb %0, %1, 0x05\n\t"
+         : "=r"(rd)
+         : "r"(rt)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/shrlv_qb.c new file +21 -0
new file mode 100644
index 0000000..4b0a826
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt;
+    int result;
+
+    rs     = 0x05;
+    rt     = 0x12345678;
+    result = 0x00010203;
+
+    __asm
+        ("shrlv.qb %0, %1, %2\n\t"
+         : "=r"(rd)
+         : "r"(rt), "r"(rs)
+        );
+    assert(rd == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/subq_ph.c new file +25 -0
new file mode 100644
index 0000000..e9d349a
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    result    = 0x8ACF1357;
+    resultdsp = 0x01;
+
+    __asm
+        ("subq.ph %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 20) & 0x01;
+    assert(dsp == resultdsp);
+    assert(rd  == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/subq_s_ph.c new file +25 -0
new file mode 100644
index 0000000..56fed9b
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    result    = 0x7FFF1357;
+    resultdsp = 0x01;
+
+    __asm
+        ("subq_s.ph %0, %2, %3\n\t"
+         "rddsp %1\n\t"
+         : "=r"(rd), "=r"(dsp)
+         : "r"(rs), "r"(rt)
+        );
+    dsp = (dsp >> 20) & 0x01;
+    assert(dsp == resultdsp);
+    assert(rd  == result);
+
+    return 0;
+}
tests/tcg/mips/mips32-dsp/subq_s_w.c new file +25 -0
new file mode 100644
index 0000000..f44f36e
@@ -0,0 +1,25 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main()
+{
+    int rd, rs, rt, dsp;
+    int result, resultdsp;
+
+    rs = 0x12345678;
+    rt = 0x87654321;
+    result    = 0x7FFFFFFF;
+    resultdsp = 0x01;
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/subu_qb.c new file +25 -0
new file mode 100644
index 0000000..4209096

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/subu_s_qb.c new file +25 -0
new file mode 100644
index 0000000..3d65053

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/wrdsp.c new file +54 -0

54 lines not on this page · raw message

tests/tcg/mips/mips32-dspr2/Makefile new file +71 -0

71 lines not on this page · raw message

tests/tcg/mips/mips32-dspr2/absq_s_qb.c new file +35 -0
new file mode 100644
index 0000000..af4683f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addqh_ph.c new file +30 -0
new file mode 100644
index 0000000..11f8597

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addqh_r_ph.c new file +30 -0
new file mode 100644
index 0000000..ab91c0f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addqh_r_w.c new file +34 -0
new file mode 100644
index 0000000..75a75c5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addqh_w.c new file +34 -0
new file mode 100644
index 0000000..de6926e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addu_ph.c new file +30 -0
new file mode 100644
index 0000000..01efb3d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addu_s_ph.c new file +30 -0
new file mode 100644
index 0000000..51cc2ac

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/adduh_qb.c new file +30 -0
new file mode 100644
index 0000000..a1f5d63

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/adduh_r_qb.c new file +30 -0
new file mode 100644
index 0000000..81e98c1

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/append.c new file +30 -0
new file mode 100644
index 0000000..9a91e16

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/balign.c new file +30 -0
new file mode 100644
index 0000000..537cf04

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c new file +37 -0
new file mode 100644
index 0000000..fccd975

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c new file +37 -0
new file mode 100644
index 0000000..a0ecdca

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c new file +37 -0
new file mode 100644
index 0000000..dba99e3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpa_w_ph.c new file +27 -0
new file mode 100644
index 0000000..d2bf3be

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c new file +57 -0

57 lines not on this page · raw message

tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c new file +30 -0
new file mode 100644
index 0000000..17182b5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpax_w_ph.c new file +27 -0
new file mode 100644
index 0000000..f756997

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dps_w_ph.c new file +27 -0
new file mode 100644
index 0000000..8303643

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c new file +31 -0
new file mode 100644
index 0000000..0f26071

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c new file +31 -0
new file mode 100644
index 0000000..4688caf

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c new file +27 -0
new file mode 100644
index 0000000..6db59a4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mul_ph.c new file +25 -0
new file mode 100644
index 0000000..fc91f5d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mul_s_ph.c new file +25 -0
new file mode 100644
index 0000000..949ea5e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/muleq_s_w_phl.c new file +40 -0
new file mode 100644
index 0000000..4e3262f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulq_rs_w.c new file +36 -0
new file mode 100644
index 0000000..669405f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulq_s_ph.c new file +25 -0
new file mode 100644
index 0000000..d0f7674

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulq_s_w.c new file +36 -0
new file mode 100644
index 0000000..df148b7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c new file +29 -0
new file mode 100644
index 0000000..a694093

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c new file +29 -0
new file mode 100644
index 0000000..06c91a4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/precr_qb_ph.c new file +21 -0
new file mode 100644
index 0000000..3a2b3fd

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c new file +32 -0
new file mode 100644
index 0000000..5c9baab

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c new file +32 -0
new file mode 100644
index 0000000..6474a10

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/prepend.c new file +30 -0
new file mode 100644
index 0000000..f6bcd47

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shra_qb.c new file +30 -0
new file mode 100644
index 0000000..48193de

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shra_r_qb.c new file +30 -0
new file mode 100644
index 0000000..29afa0e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shrav_qb.c new file +32 -0
new file mode 100644
index 0000000..b21e1b7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shrav_r_qb.c new file +32 -0
new file mode 100644
index 0000000..9ea8aa0

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shrl_ph.c new file +20 -0
new file mode 100644
index 0000000..724b9a7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shrlv_ph.c new file +21 -0
new file mode 100644
index 0000000..ac79aa6

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subqh_ph.c new file +21 -0
new file mode 100644
index 0000000..dbc0967

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subqh_r_ph.c new file +21 -0
new file mode 100644
index 0000000..24ef0f1

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subqh_r_w.c new file +21 -0
new file mode 100644
index 0000000..d460f86

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subqh_w.c new file +21 -0
new file mode 100644
index 0000000..42be3de

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subu_ph.c new file +25 -0
new file mode 100644
index 0000000..b9cf138

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subu_s_ph.c new file +25 -0
new file mode 100644
index 0000000..a3b034f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subuh_qb.c new file +21 -0
new file mode 100644
index 0000000..92cfc76

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subuh_r_qb.c new file +21 -0
new file mode 100644
index 0000000..d9e6f2f

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.5.4

Part of the diff is not shown here. View the raw message.

#15 lore raw
In reply to Jia Liu
Quoted 7 lines · Jia Liu

This is MIPS ASE DSP instructions support for QEMU. These instructions are grouped according to "Chapter 4. MIPS DSP ASE Instruction Summary" in MIPS ASE DSP manual [1].

[1] MIPS32® Architecture for Programmers VolumeIV-e: The MIPS® DSP Application-Specific Extension to the MIPS32®Architecture
http://www.mips.com/products/product-materials/processor/mips-architecture/

Any plans to support the mips64 version?

It also occurred to me to actually try this code, which shows you haven't thought about mips64 at all. Configure with --enable-debug:

Quoted 6 lines

CC mips64-softmmu/translate.o
/home/rth/work/qemu/qemu/target-mips/translate.c: In function 'gen_compute_branch':
/home/rth/work/qemu/qemu/target-mips/translate.c:2989:9: error: incompatible type for argument 1 of 'tcg_gen_andi_i32' /home/rth/work/qemu/qemu/tcg/tcg-op.h:521:20: note: expected 'TCGv_i32' but argument is of type 'TCGv_i64' /home/rth/work/qemu/qemu/target-mips/translate.c:2989:9: error: incompatible type for argument 2 of 'tcg_gen_andi_i32' /home/rth/work/qemu/qemu/tcg/tcg-op.h:521:20: note: expected 'TCGv_i32' but argument is of type 'TCGv_i64'

All of your helpers, whereever they receive or return a register value, need to use type target_ulong and the DEF_HELPER lines need to use "tl". All of the mips32 helpers you've written so far that return values need to make sure to sign-extend their results from 32-bits.

With that, the compilation errors should go away, and you should produce correct results for the subset of the mips64 dsp ase that overlaps with the mips32 dsp ase.

r~

author
#16 lore raw
Quoted 5 lines · Richard Henderson
Quoted 4 lines · Jia Liu

This is MIPS ASE DSP instructions support for QEMU. These instructions are grouped according to "Chapter 4. MIPS DSP ASE Instruction Summary" in MIPS ASE DSP manual [1].

Quoted 9 lines
Quoted 3 lines

[1] MIPS32® Architecture for Programmers VolumeIV-e: The MIPS® DSP Application-Specific Extension to the MIPS32®Architecture
    http://www.mips.com/products/product-materials/processor/mips-architecture/

Any plans to support the mips64 version?

It also occurred to me to actually try this code, which shows you haven't thought about mips64 at all.  Configure with --enable-debug:

I planed when mips32dsp is OK, I'll working on mips64dsp, so I'm not think about mips64 too much yet.

Quoted 9 lines
Quoted 7 lines

  CC    mips64-softmmu/translate.o
/home/rth/work/qemu/qemu/target-mips/translate.c: In function 'gen_compute_branch':
/home/rth/work/qemu/qemu/target-mips/translate.c:2989:9: error: incompatible type for argument 1 of 'tcg_gen_andi_i32' /home/rth/work/qemu/qemu/tcg/tcg-op.h:521:20: note: expected 'TCGv_i32' but argument is of type 'TCGv_i64' /home/rth/work/qemu/qemu/target-mips/translate.c:2989:9: error: incompatible type for argument 2 of 'tcg_gen_andi_i32' /home/rth/work/qemu/qemu/tcg/tcg-op.h:521:20: note: expected 'TCGv_i32' but argument is of type 'TCGv_i64'

Quoted 4 lines

All of your helpers, whereever they receive or return a register value, need to use type target_ulong and the DEF_HELPER lines need to use "tl".  All of the mips32 helpers you've written so far that return values need to make sure to sign-extend their results from 32-bits.

I'll check the return values.

And, do you mean replace all "i32" "int" in DEF_HELPER with "tl", all "uint32_t" "int" in dsp_hlper.c with "target_ulong"?

Quoted 4 lines

With that, the compilation errors should go away, and you should produce correct results for the subset of the mips64 dsp ase that overlaps with the mips32 dsp ase.

Thanks, I'll make sure the subset of the mips64dsp that overlaps with the mips32dsp get correct results.

Quoted 2 lines

r~

Regards,
Jia.

#17 lore raw
In reply to Richard Henderson
Quoted 4 lines · Richard Henderson

All of your helpers, whereever they receive or return a register value, need to use type target_ulong and the DEF_HELPER lines need to use "tl". All of the mips32 helpers you've written so far that return values need to make sure to sign-extend their results from 32-bits.

Hmm, actually I wonder if that's the best advice.

It looks like your translated code isn't going to work well with r0.

I suspect it would be better to add a gen_load_gpr32 function for the translator that (1) sets 0 for r0, (2a) copies the register for mips32, and (2b) truncates the register for mips64. That way 32-bit hosts do not need to use 64-bit arithmetic when unnecessary. You'd need a gen_store_gpr32 function as well, which for mips64 sign-extends the value.

r~

author
#18 lore raw

Hi all,

Sorry.

I pinged my binutils/gcc patches, and I was told MIPS have change DSP r3 spec. So, I have to frozen my Qemu MIPS-DSP patches, util MIPS open DSP r3 spec and I write the new patches.

Sorry all, thanks for your time.

Please allow me keep the V5 patch here.

Regards,
Jia.

Quoted 10 lines · Richard Henderson
Quoted 4 lines · Richard Henderson

All of your helpers, whereever they receive or return a register value, need to use type target_ulong and the DEF_HELPER lines need to use "tl".  All of the mips32 helpers you've written so far that return values need to make sure to sign-extend their results from 32-bits.

Hmm, actually I wonder if that's the best advice.

It looks like your translated code isn't going to work well with r0.

Quoted 8 lines

I suspect it would be better to add a gen_load_gpr32 function for the translator that (1) sets 0 for r0, (2a) copies the register for mips32, and (2b) truncates the register for mips64.  That way 32-bit hosts do not need to use 64-bit arithmetic when unnecessary.  You'd need a gen_store_gpr32 function as well, which for mips64 sign-extends the value.

r~

From 24562d58fbf472c85eef089757dc7a30d10f35e9 Mon Sep 17 00:00:00 2001
From: Jia Liu <[email protected]>
Date: Wed, 4 Apr 2012 22:46:38 +0800
Subject: [PATCH] MIPS DSP Support V5
Content-Type: text/plain; charset="utf-8"

---
 Makefile.target                                |    3 +
 target-mips/dsp_helper.c                       | 3844 ++++++++++++++++++++++++
 target-mips/helper.h                           |  153 +
 target-mips/translate.c                        | 1229 ++++++++-
 tests/tcg/mips/mips32-dsp/Makefile             |  133 +
 tests/tcg/mips/mips32-dsp/absq_s_ph.c          |   30 +
 tests/tcg/mips/mips32-dsp/absq_s_w.c           |   37 +
 tests/tcg/mips/mips32-dsp/addq_ph.c            |   30 +
 tests/tcg/mips/mips32-dsp/addq_s_ph.c          |   30 +
 tests/tcg/mips/mips32-dsp/addsc.c              |   30 +
 tests/tcg/mips/mips32-dsp/addu_qb.c            |   30 +
 tests/tcg/mips/mips32-dsp/addu_s_qb.c          |   30 +
 tests/tcg/mips/mips32-dsp/addwc.c              |   30 +
 tests/tcg/mips/mips32-dsp/bitrev.c             |   20 +
 tests/tcg/mips/mips32-dsp/bposge32.c           |   44 +
 tests/tcg/mips/mips32-dsp/cmp_eq_ph.c          |   35 +
 tests/tcg/mips/mips32-dsp/cmp_le_ph.c          |   35 +
 tests/tcg/mips/mips32-dsp/cmp_lt_ph.c          |   35 +
 tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c        |   31 +
 tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c        |   31 +
 tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c        |   31 +
 tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c         |   35 +
 tests/tcg/mips/mips32-dsp/cmpu_le_qb.c         |   35 +
 tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c         |   35 +
 tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c        |   31 +
 tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c        |   31 +
 tests/tcg/mips/mips32-dsp/dpau_h_qbl.c         |   27 +
 tests/tcg/mips/mips32-dsp/dpau_h_qbr.c         |   27 +
 tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c        |   27 +
 tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c        |   31 +
 tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c         |   27 +
 tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c         |   27 +
 tests/tcg/mips/mips32-dsp/extp.c               |   44 +
 tests/tcg/mips/mips32-dsp/extpdp.c             |   46 +
 tests/tcg/mips/mips32-dsp/extpdpv.c            |   47 +
 tests/tcg/mips/mips32-dsp/extpv.c              |   45 +
 tests/tcg/mips/mips32-dsp/extr_r_w.c           |   25 +
 tests/tcg/mips/mips32-dsp/extr_rs_w.c          |   25 +
 tests/tcg/mips/mips32-dsp/extr_s_h.c           |   25 +
 tests/tcg/mips/mips32-dsp/extr_w.c             |   25 +
 tests/tcg/mips/mips32-dsp/extrv_r_w.c          |   29 +
 tests/tcg/mips/mips32-dsp/extrv_rs_w.c         |   29 +
 tests/tcg/mips/mips32-dsp/extrv_s_h.c          |   29 +
 tests/tcg/mips/mips32-dsp/extrv_w.c            |   29 +
 tests/tcg/mips/mips32-dsp/insv.c               |   23 +
 tests/tcg/mips/mips32-dsp/lbux.c               |   23 +
 tests/tcg/mips/mips32-dsp/lhx.c                |   23 +
 tests/tcg/mips/mips32-dsp/lwx.c                |   23 +
 tests/tcg/mips/mips32-dsp/madd.c               |   31 +
 tests/tcg/mips/mips32-dsp/maddu.c              |   31 +
 tests/tcg/mips/mips32-dsp/main.c               |    6 +
 tests/tcg/mips/mips32-dsp/maq_s_w_phl.c        |   31 +
 tests/tcg/mips/mips32-dsp/maq_s_w_phr.c        |   31 +
 tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c       |   31 +
 tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c       |   31 +
 tests/tcg/mips/mips32-dsp/mfhi.c               |   21 +
 tests/tcg/mips/mips32-dsp/mflo.c               |   21 +
 tests/tcg/mips/mips32-dsp/modsub.c             |   30 +
 tests/tcg/mips/mips32-dsp/msub.c               |   30 +
 tests/tcg/mips/mips32-dsp/msubu.c              |   30 +
 tests/tcg/mips/mips32-dsp/mthi.c               |   21 +
 tests/tcg/mips/mips32-dsp/mthlip.c             |   34 +
 tests/tcg/mips/mips32-dsp/mtlo.c               |   21 +
 tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c      |   40 +
 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c     |   25 +
 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c     |   25 +
 tests/tcg/mips/mips32-dsp/mulq_rs_ph.c         |   25 +
 tests/tcg/mips/mips32-dsp/mult.c               |   24 +
 tests/tcg/mips/mips32-dsp/multu.c              |   24 +
 tests/tcg/mips/mips32-dsp/packrl_ph.c          |   21 +
 tests/tcg/mips/mips32-dsp/pick_ph.c            |   23 +
 tests/tcg/mips/mips32-dsp/pick_qb.c            |   23 +
 tests/tcg/mips/mips32-dsp/preceq_w_phl.c       |   20 +
 tests/tcg/mips/mips32-dsp/preceq_w_phr.c       |   20 +
 tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c     |   20 +
 tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c    |   20 +
 tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c     |   20 +
 tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c    |   20 +
 tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c      |   20 +
 tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c     |   20 +
 tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c      |   20 +
 tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c     |   20 +
 tests/tcg/mips/mips32-dsp/precrq_ph_w.c        |   21 +
 tests/tcg/mips/mips32-dsp/precrq_qb_ph.c       |   21 +
 tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c     |   21 +
 tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c    |   21 +
 tests/tcg/mips/mips32-dsp/raddu_w_qb.c         |   20 +
 tests/tcg/mips/mips32-dsp/rddsp.c              |   54 +
 tests/tcg/mips/mips32-dsp/repl_ph.c            |   23 +
 tests/tcg/mips/mips32-dsp/repl_qb.c            |   16 +
 tests/tcg/mips/mips32-dsp/replv_ph.c           |   19 +
 tests/tcg/mips/mips32-dsp/replv_qb.c           |   19 +
 tests/tcg/mips/mips32-dsp/shilo.c              |   27 +
 tests/tcg/mips/mips32-dsp/shilov.c             |   29 +
 tests/tcg/mips/mips32-dsp/shll_ph.c            |   24 +
 tests/tcg/mips/mips32-dsp/shll_qb.c            |   23 +
 tests/tcg/mips/mips32-dsp/shll_s_ph.c          |   24 +
 tests/tcg/mips/mips32-dsp/shll_s_w.c           |   24 +
 tests/tcg/mips/mips32-dsp/shllv_ph.c           |   25 +
 tests/tcg/mips/mips32-dsp/shllv_qb.c           |   24 +
 tests/tcg/mips/mips32-dsp/shllv_s_ph.c         |   25 +
 tests/tcg/mips/mips32-dsp/shllv_s_w.c          |   25 +
 tests/tcg/mips/mips32-dsp/shra_ph.c            |   20 +
 tests/tcg/mips/mips32-dsp/shra_r_ph.c          |   20 +
 tests/tcg/mips/mips32-dsp/shra_r_w.c           |   20 +
 tests/tcg/mips/mips32-dsp/shrav_ph.c           |   21 +
 tests/tcg/mips/mips32-dsp/shrav_r_ph.c         |   21 +
 tests/tcg/mips/mips32-dsp/shrav_r_w.c          |   21 +
 tests/tcg/mips/mips32-dsp/shrl_qb.c            |   20 +
 tests/tcg/mips/mips32-dsp/shrlv_qb.c           |   21 +
 tests/tcg/mips/mips32-dsp/subq_ph.c            |   25 +
 tests/tcg/mips/mips32-dsp/subq_s_ph.c          |   25 +
 tests/tcg/mips/mips32-dsp/subq_s_w.c           |   25 +
 tests/tcg/mips/mips32-dsp/subu_qb.c            |   25 +
 tests/tcg/mips/mips32-dsp/subu_s_qb.c          |   25 +
 tests/tcg/mips/mips32-dsp/wrdsp.c              |   54 +
 tests/tcg/mips/mips32-dspr2/Makefile           |   71 +
 tests/tcg/mips/mips32-dspr2/absq_s_qb.c        |   35 +
 tests/tcg/mips/mips32-dspr2/addqh_ph.c         |   30 +
 tests/tcg/mips/mips32-dspr2/addqh_r_ph.c       |   30 +
 tests/tcg/mips/mips32-dspr2/addqh_r_w.c        |   34 +
 tests/tcg/mips/mips32-dspr2/addqh_w.c          |   34 +
 tests/tcg/mips/mips32-dspr2/addu_ph.c          |   30 +
 tests/tcg/mips/mips32-dspr2/addu_s_ph.c        |   30 +
 tests/tcg/mips/mips32-dspr2/adduh_qb.c         |   30 +
 tests/tcg/mips/mips32-dspr2/adduh_r_qb.c       |   30 +
 tests/tcg/mips/mips32-dspr2/append.c           |   30 +
 tests/tcg/mips/mips32-dspr2/balign.c           |   30 +
 tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c     |   37 +
 tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c     |   37 +
 tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c     |   37 +
 tests/tcg/mips/mips32-dspr2/dpa_w_ph.c         |   27 +
 tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c     |   57 +
 tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c    |   30 +
 tests/tcg/mips/mips32-dspr2/dpax_w_ph.c        |   27 +
 tests/tcg/mips/mips32-dspr2/dps_w_ph.c         |   27 +
 tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c     |   31 +
 tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c    |   31 +
 tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c        |   27 +
 tests/tcg/mips/mips32-dspr2/mul_ph.c           |   25 +
 tests/tcg/mips/mips32-dspr2/mul_s_ph.c         |   25 +
 tests/tcg/mips/mips32-dspr2/muleq_s_w_phl.c    |   40 +
 tests/tcg/mips/mips32-dspr2/mulq_rs_w.c        |   36 +
 tests/tcg/mips/mips32-dspr2/mulq_s_ph.c        |   25 +
 tests/tcg/mips/mips32-dspr2/mulq_s_w.c         |   36 +
 tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c       |   29 +
 tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c    |   29 +
 tests/tcg/mips/mips32-dspr2/precr_qb_ph.c      |   21 +
 tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c   |   32 +
 tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c |   32 +
 tests/tcg/mips/mips32-dspr2/prepend.c          |   30 +
 tests/tcg/mips/mips32-dspr2/shra_qb.c          |   30 +
 tests/tcg/mips/mips32-dspr2/shra_r_qb.c        |   30 +
 tests/tcg/mips/mips32-dspr2/shrav_qb.c         |   32 +
 tests/tcg/mips/mips32-dspr2/shrav_r_qb.c       |   32 +
 tests/tcg/mips/mips32-dspr2/shrl_ph.c          |   20 +
 tests/tcg/mips/mips32-dspr2/shrlv_ph.c         |   21 +
 tests/tcg/mips/mips32-dspr2/subqh_ph.c         |   21 +
 tests/tcg/mips/mips32-dspr2/subqh_r_ph.c       |   21 +
 tests/tcg/mips/mips32-dspr2/subqh_r_w.c        |   21 +
 tests/tcg/mips/mips32-dspr2/subqh_w.c          |   21 +
 tests/tcg/mips/mips32-dspr2/subu_ph.c          |   25 +
 tests/tcg/mips/mips32-dspr2/subu_s_ph.c        |   25 +
 tests/tcg/mips/mips32-dspr2/subuh_qb.c         |   21 +
 tests/tcg/mips/mips32-dspr2/subuh_r_qb.c       |   21 +
 tests/tcg/mips/mips64-dsp/Makefile             |  150 +
 tests/tcg/mips/mips64-dsp/absq_s_ph.c          |   35 +
 tests/tcg/mips/mips64-dsp/absq_s_w.c           |   45 +
 tests/tcg/mips/mips64-dsp/addq_ph.c            |   35 +
 tests/tcg/mips/mips64-dsp/addq_s_ph.c          |   35 +
 tests/tcg/mips/mips64-dsp/addsc.c              |   35 +
 tests/tcg/mips/mips64-dsp/addu_qb.c            |   35 +
 tests/tcg/mips/mips64-dsp/addu_s_qb.c          |   29 +
 tests/tcg/mips/mips64-dsp/addwc.c              |   35 +
 tests/tcg/mips/mips64-dsp/alias.h              |   39 +
 tests/tcg/mips/mips64-dsp/bitrev.c             |   22 +
 tests/tcg/mips/mips64-dsp/bposge32.c           |   46 +
 tests/tcg/mips/mips64-dsp/cmp_eq_ph.c          |   40 +
 tests/tcg/mips/mips64-dsp/cmp_le_ph.c          |   38 +
 tests/tcg/mips/mips64-dsp/cmp_lt_ph.c          |   39 +
 tests/tcg/mips/mips64-dsp/cmpgu_eq_qb.c        |   36 +
 tests/tcg/mips/mips64-dsp/cmpgu_le_qb.c        |   35 +
 tests/tcg/mips/mips64-dsp/cmpgu_lt_qb.c        |   36 +
 tests/tcg/mips/mips64-dsp/cmpu_eq_qb.c         |   40 +
 tests/tcg/mips/mips64-dsp/cmpu_le_qb.c         |   39 +
 tests/tcg/mips/mips64-dsp/cmpu_lt_qb.c         |   40 +
 tests/tcg/mips/mips64-dsp/dpaq_s_w_ph.c        |   31 +
 tests/tcg/mips/mips64-dsp/dpaq_sa_l_w.c        |   31 +
 tests/tcg/mips/mips64-dsp/dpau_h_qbl.c         |   28 +
 tests/tcg/mips/mips64-dsp/dpau_h_qbr.c         |   28 +
 tests/tcg/mips/mips64-dsp/dpsq_s_w_ph.c        |   28 +
 tests/tcg/mips/mips64-dsp/dpsq_sa_l_w.c        |   31 +
 tests/tcg/mips/mips64-dsp/dpsu_h_qbl.c         |   28 +
 tests/tcg/mips/mips64-dsp/dpsu_h_qbr.c         |   28 +
 tests/tcg/mips/mips64-dsp/extp.c               |   48 +
 tests/tcg/mips/mips64-dsp/extpdp.c             |   49 +
 tests/tcg/mips/mips64-dsp/extpdpv.c            |   50 +
 tests/tcg/mips/mips64-dsp/extpv.c              |   49 +
 tests/tcg/mips/mips64-dsp/extr_r_w.c           |   26 +
 tests/tcg/mips/mips64-dsp/extr_rs_w.c          |   26 +
 tests/tcg/mips/mips64-dsp/extr_s_h.c           |   26 +
 tests/tcg/mips/mips64-dsp/extr_w.c             |   26 +
 tests/tcg/mips/mips64-dsp/extrv_r_w.c          |   30 +
 tests/tcg/mips/mips64-dsp/extrv_rs_w.c         |   30 +
 tests/tcg/mips/mips64-dsp/extrv_s_h.c          |   30 +
 tests/tcg/mips/mips64-dsp/extrv_w.c            |   30 +
 tests/tcg/mips/mips64-dsp/head.S               |   16 +
 tests/tcg/mips/mips64-dsp/insv.c               |   25 +
 tests/tcg/mips/mips64-dsp/io.h                 |    6 +
 tests/tcg/mips/mips64-dsp/lbux.c               |   25 +
 tests/tcg/mips/mips64-dsp/lhx.c                |   25 +
 tests/tcg/mips/mips64-dsp/lwx.c                |   25 +
 tests/tcg/mips/mips64-dsp/macro.h              |   18 +
 tests/tcg/mips/mips64-dsp/madd.c               |   32 +
 tests/tcg/mips/mips64-dsp/maddu.c              |   32 +
 tests/tcg/mips/mips64-dsp/main.c               |    6 +
 tests/tcg/mips/mips64-dsp/maq_s_w_phl.c        |   32 +
 tests/tcg/mips/mips64-dsp/maq_s_w_phr.c        |   32 +
 tests/tcg/mips/mips64-dsp/maq_sa_w_phl.c       |   32 +
 tests/tcg/mips/mips64-dsp/maq_sa_w_phr.c       |   32 +
 tests/tcg/mips/mips64-dsp/mfhi.c               |   23 +
 tests/tcg/mips/mips64-dsp/mflo.c               |   23 +
 tests/tcg/mips/mips64-dsp/mips_boot.lds        |   11 +
 tests/tcg/mips/mips64-dsp/mipsregs.h           |  527 ++++
 tests/tcg/mips/mips64-dsp/modsub.c             |   35 +
 tests/tcg/mips/mips64-dsp/msub.c               |   31 +
 tests/tcg/mips/mips64-dsp/msubu.c              |   31 +
 tests/tcg/mips/mips64-dsp/mthi.c               |   23 +
 tests/tcg/mips/mips64-dsp/mthlip.c             |   34 +
 tests/tcg/mips/mips64-dsp/mtlo.c               |   23 +
 tests/tcg/mips/mips64-dsp/muleq_s_w_phr.c      |   43 +
 tests/tcg/mips/mips64-dsp/muleu_s_ph_qbl.c     |   26 +
 tests/tcg/mips/mips64-dsp/muleu_s_ph_qbr.c     |   26 +
 tests/tcg/mips/mips64-dsp/mulq_rs_ph.c         |   26 +
 tests/tcg/mips/mips64-dsp/mult.c               |   25 +
 tests/tcg/mips/mips64-dsp/multu.c              |   25 +
 tests/tcg/mips/mips64-dsp/packrl_ph.c          |   23 +
 tests/tcg/mips/mips64-dsp/pick_ph.c            |   25 +
 tests/tcg/mips/mips64-dsp/pick_qb.c            |   25 +
 tests/tcg/mips/mips64-dsp/preceq_w_phl.c       |   22 +
 tests/tcg/mips/mips64-dsp/preceq_w_phr.c       |   22 +
 tests/tcg/mips/mips64-dsp/precequ_ph_qbl.c     |   22 +
 tests/tcg/mips/mips64-dsp/precequ_ph_qbla.c    |   22 +
 tests/tcg/mips/mips64-dsp/precequ_ph_qbr.c     |   22 +
 tests/tcg/mips/mips64-dsp/precequ_ph_qbra.c    |   22 +
 tests/tcg/mips/mips64-dsp/preceu_ph_qbl.c      |   22 +
 tests/tcg/mips/mips64-dsp/preceu_ph_qbla.c     |   22 +
 tests/tcg/mips/mips64-dsp/preceu_ph_qbr.c      |   22 +
 tests/tcg/mips/mips64-dsp/preceu_ph_qbra.c     |   22 +
 tests/tcg/mips/mips64-dsp/precrq_ph_w.c        |   23 +
 tests/tcg/mips/mips64-dsp/precrq_qb_ph.c       |   23 +
 tests/tcg/mips/mips64-dsp/precrq_rs_ph_w.c     |   23 +
 tests/tcg/mips/mips64-dsp/precrqu_s_qb_ph.c    |   23 +
 tests/tcg/mips/mips64-dsp/printk.c             |  125 +
 tests/tcg/mips/mips64-dsp/raddu_w_qb.c         |   22 +
 tests/tcg/mips/mips64-dsp/rddsp.c              |   52 +
 tests/tcg/mips/mips64-dsp/repl_ph.c            |   28 +
 tests/tcg/mips/mips64-dsp/repl_qb.c            |   18 +
 tests/tcg/mips/mips64-dsp/replv_ph.c           |   21 +
 tests/tcg/mips/mips64-dsp/replv_qb.c           |   21 +
 tests/tcg/mips/mips64-dsp/shilo.c              |   28 +
 tests/tcg/mips/mips64-dsp/shilov.c             |   30 +
 tests/tcg/mips/mips64-dsp/shll_ph.c            |   25 +
 tests/tcg/mips/mips64-dsp/shll_qb.c            |   25 +
 tests/tcg/mips/mips64-dsp/shll_s_ph.c          |   25 +
 tests/tcg/mips/mips64-dsp/shll_s_w.c           |   25 +
 tests/tcg/mips/mips64-dsp/shllv_ph.c           |   26 +
 tests/tcg/mips/mips64-dsp/shllv_qb.c           |   26 +
 tests/tcg/mips/mips64-dsp/shllv_s_ph.c         |   26 +
 tests/tcg/mips/mips64-dsp/shllv_s_w.c          |   26 +
 tests/tcg/mips/mips64-dsp/shra_ph.c            |   22 +
 tests/tcg/mips/mips64-dsp/shra_r_ph.c          |   22 +
 tests/tcg/mips/mips64-dsp/shra_r_w.c           |   22 +
 tests/tcg/mips/mips64-dsp/shrav_ph.c           |   23 +
 tests/tcg/mips/mips64-dsp/shrav_r_ph.c         |   23 +
 tests/tcg/mips/mips64-dsp/shrav_r_w.c          |   23 +
 tests/tcg/mips/mips64-dsp/shrl_qb.c            |   22 +
 tests/tcg/mips/mips64-dsp/shrlv_qb.c           |   23 +
 tests/tcg/mips/mips64-dsp/subq_ph.c            |   26 +
 tests/tcg/mips/mips64-dsp/subq_s_ph.c          |   26 +
 tests/tcg/mips/mips64-dsp/subq_s_w.c           |   26 +
 tests/tcg/mips/mips64-dsp/subu_qb.c            |   26 +
 tests/tcg/mips/mips64-dsp/subu_s_qb.c          |   26 +
 tests/tcg/mips/mips64-dsp/wrdsp.c              |   47 +
 tests/tcg/mips/mips64-dspr2/Makefile           |   88 +
 tests/tcg/mips/mips64-dspr2/Makefile-bk        |   71 +
 tests/tcg/mips/mips64-dspr2/absq_s_qb.c        |   35 +
 tests/tcg/mips/mips64-dspr2/addqh_ph.c         |   30 +
 tests/tcg/mips/mips64-dspr2/addqh_r_ph.c       |   34 +
 tests/tcg/mips/mips64-dspr2/addqh_r_w.c        |   34 +
 tests/tcg/mips/mips64-dspr2/addqh_w.c          |   39 +
 tests/tcg/mips/mips64-dspr2/addu_ph.c          |   31 +
 tests/tcg/mips/mips64-dspr2/addu_s_ph.c        |   31 +
 tests/tcg/mips/mips64-dspr2/adduh_qb.c         |   31 +
 tests/tcg/mips/mips64-dspr2/adduh_r_qb.c       |   31 +
 tests/tcg/mips/mips64-dspr2/alias.h            |   39 +
 tests/tcg/mips/mips64-dspr2/append.c           |   31 +
 tests/tcg/mips/mips64-dspr2/balign.c           |   31 +
 tests/tcg/mips/mips64-dspr2/cmpgdu_eq_qb.c     |   41 +
 tests/tcg/mips/mips64-dspr2/cmpgdu_le_qb.c     |   40 +
 tests/tcg/mips/mips64-dspr2/cmpgdu_lt_qb.c     |   40 +
 tests/tcg/mips/mips64-dspr2/dpa_w_ph.c         |   28 +
 tests/tcg/mips/mips64-dspr2/dpaqx_s_w_ph.c     |   62 +
 tests/tcg/mips/mips64-dspr2/dpaqx_sa_w_ph.c    |   32 +
 tests/tcg/mips/mips64-dspr2/dpax_w_ph.c        |   32 +
 tests/tcg/mips/mips64-dspr2/dps_w_ph.c         |   26 +
 tests/tcg/mips/mips64-dspr2/dpsqx_s_w_ph.c     |   31 +
 tests/tcg/mips/mips64-dspr2/dpsqx_sa_w_ph.c    |   27 +
 tests/tcg/mips/mips64-dspr2/dpsx_w_ph.c        |   25 +
 tests/tcg/mips/mips64-dspr2/head.S             |   16 +
 tests/tcg/mips/mips64-dspr2/io.h               |    6 +
 tests/tcg/mips/mips64-dspr2/macro.h            |   18 +
 tests/tcg/mips/mips64-dspr2/mips_boot.lds      |   11 +
 tests/tcg/mips/mips64-dspr2/mipsregs.h         |  527 ++++
 tests/tcg/mips/mips64-dspr2/mul_ph.c           |   26 +
 tests/tcg/mips/mips64-dspr2/mul_s_ph.c         |   23 +
 tests/tcg/mips/mips64-dspr2/muleq_s_w_phl.c    |   42 +
 tests/tcg/mips/mips64-dspr2/mulq_rs_w.c        |   36 +
 tests/tcg/mips/mips64-dspr2/mulq_s_ph.c        |   23 +
 tests/tcg/mips/mips64-dspr2/mulq_s_w.c         |   36 +
 tests/tcg/mips/mips64-dspr2/mulsa_w_ph.c       |   27 +
 tests/tcg/mips/mips64-dspr2/mulsaq_s_w_ph.c    |   28 +
 tests/tcg/mips/mips64-dspr2/precr_qb_ph.c      |   21 +
 tests/tcg/mips/mips64-dspr2/precr_sra_ph_w.c   |   33 +
 tests/tcg/mips/mips64-dspr2/precr_sra_r_ph_w.c |   33 +
 tests/tcg/mips/mips64-dspr2/prepend.c          |   31 +
 tests/tcg/mips/mips64-dspr2/printk.c           |  125 +
 tests/tcg/mips/mips64-dspr2/shra_qb.c          |   31 +
 tests/tcg/mips/mips64-dspr2/shra_r_qb.c        |   35 +
 tests/tcg/mips/mips64-dspr2/shrav_qb.c         |   33 +
 tests/tcg/mips/mips64-dspr2/shrav_r_qb.c       |   33 +
 tests/tcg/mips/mips64-dspr2/shrl_ph.c          |   20 +
 tests/tcg/mips/mips64-dspr2/shrlv_ph.c         |   20 +
 tests/tcg/mips/mips64-dspr2/subqh_ph.c         |   21 +
 tests/tcg/mips/mips64-dspr2/subqh_r_ph.c       |   21 +
 tests/tcg/mips/mips64-dspr2/subqh_r_w.c        |   21 +
 tests/tcg/mips/mips64-dspr2/subqh_w.c          |   21 +
 tests/tcg/mips/mips64-dspr2/subu_ph.c          |   24 +
 tests/tcg/mips/mips64-dspr2/subu_s_ph.c        |   23 +
 tests/tcg/mips/mips64-dspr2/subuh_qb.c         |   23 +
 tests/tcg/mips/mips64-dspr2/subuh_r_qb.c       |   21 +
 341 files changed, 16258 insertions(+), 24 deletions(-)
 create mode 100644 target-mips/dsp_helper.c
 create mode 100644 tests/tcg/mips/mips32-dsp/Makefile
 create mode 100644 tests/tcg/mips/mips32-dsp/absq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/absq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addsc.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addu_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addu_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/addwc.c
 create mode 100644 tests/tcg/mips/mips32-dsp/bitrev.c
 create mode 100644 tests/tcg/mips/mips32-dsp/bposge32.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_eq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_le_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmp_lt_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpau_h_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpau_h_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpdp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpdpv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extpv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_s_h.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extr_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_s_h.c
 create mode 100644 tests/tcg/mips/mips32-dsp/extrv_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/insv.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lbux.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lhx.c
 create mode 100644 tests/tcg/mips/mips32-dsp/lwx.c
 create mode 100644 tests/tcg/mips/mips32-dsp/madd.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maddu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/main.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_s_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_s_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mfhi.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mflo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/modsub.c
 create mode 100644 tests/tcg/mips/mips32-dsp/msub.c
 create mode 100644 tests/tcg/mips/mips32-dsp/msubu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mthi.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mthlip.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mtlo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mulq_rs_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/mult.c
 create mode 100644 tests/tcg/mips/mips32-dsp/multu.c
 create mode 100644 tests/tcg/mips/mips32-dsp/packrl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/pick_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/pick_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceq_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceq_w_phr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/raddu_w_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/rddsp.c
 create mode 100644 tests/tcg/mips/mips32-dsp/repl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/repl_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/replv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/replv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shilo.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shilov.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shll_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shllv_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shra_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrav_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrl_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/shrlv_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subu_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/subu_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dsp/wrdsp.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/Makefile
 create mode 100644 tests/tcg/mips/mips32-dspr2/absq_s_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addqh_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addu_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/addu_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/adduh_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/adduh_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/append.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/balign.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpax_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dps_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mul_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mul_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/muleq_s_w_phl.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_rs_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulq_s_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_qb_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/prepend.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shra_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shra_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrav_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrav_r_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrl_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/shrlv_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_r_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_r_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subqh_w.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subu_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subu_s_ph.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subuh_qb.c
 create mode 100644 tests/tcg/mips/mips32-dspr2/subuh_r_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/Makefile
 create mode 100644 tests/tcg/mips/mips64-dsp/absq_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/absq_s_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/addq_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/addq_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/addsc.c
 create mode 100644 tests/tcg/mips/mips64-dsp/addu_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/addu_s_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/addwc.c
 create mode 100644 tests/tcg/mips/mips64-dsp/alias.h
 create mode 100644 tests/tcg/mips/mips64-dsp/bitrev.c
 create mode 100644 tests/tcg/mips/mips64-dsp/bposge32.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmp_eq_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmp_le_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmp_lt_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmpgu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmpgu_le_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmpgu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmpu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmpu_le_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/cmpu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/dpaq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/dpaq_sa_l_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/dpau_h_qbl.c
 create mode 100644 tests/tcg/mips/mips64-dsp/dpau_h_qbr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/dpsq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/dpsq_sa_l_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/dpsu_h_qbl.c
 create mode 100644 tests/tcg/mips/mips64-dsp/dpsu_h_qbr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extp.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extpdp.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extpdpv.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extpv.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extr_r_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extr_rs_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extr_s_h.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extr_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extrv_r_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extrv_rs_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extrv_s_h.c
 create mode 100644 tests/tcg/mips/mips64-dsp/extrv_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/head.S
 create mode 100644 tests/tcg/mips/mips64-dsp/insv.c
 create mode 100644 tests/tcg/mips/mips64-dsp/io.h
 create mode 100644 tests/tcg/mips/mips64-dsp/lbux.c
 create mode 100644 tests/tcg/mips/mips64-dsp/lhx.c
 create mode 100644 tests/tcg/mips/mips64-dsp/lwx.c
 create mode 100644 tests/tcg/mips/mips64-dsp/macro.h
 create mode 100644 tests/tcg/mips/mips64-dsp/madd.c
 create mode 100644 tests/tcg/mips/mips64-dsp/maddu.c
 create mode 100644 tests/tcg/mips/mips64-dsp/main.c
 create mode 100644 tests/tcg/mips/mips64-dsp/maq_s_w_phl.c
 create mode 100644 tests/tcg/mips/mips64-dsp/maq_s_w_phr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/maq_sa_w_phl.c
 create mode 100644 tests/tcg/mips/mips64-dsp/maq_sa_w_phr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/mfhi.c
 create mode 100644 tests/tcg/mips/mips64-dsp/mflo.c
 create mode 100644 tests/tcg/mips/mips64-dsp/mips_boot.lds
 create mode 100644 tests/tcg/mips/mips64-dsp/mipsregs.h
 create mode 100644 tests/tcg/mips/mips64-dsp/modsub.c
 create mode 100644 tests/tcg/mips/mips64-dsp/msub.c
 create mode 100644 tests/tcg/mips/mips64-dsp/msubu.c
 create mode 100644 tests/tcg/mips/mips64-dsp/mthi.c
 create mode 100644 tests/tcg/mips/mips64-dsp/mthlip.c
 create mode 100644 tests/tcg/mips/mips64-dsp/mtlo.c
 create mode 100644 tests/tcg/mips/mips64-dsp/muleq_s_w_phr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/muleu_s_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips64-dsp/muleu_s_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/mulq_rs_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/mult.c
 create mode 100644 tests/tcg/mips/mips64-dsp/multu.c
 create mode 100644 tests/tcg/mips/mips64-dsp/packrl_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/pick_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/pick_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/preceq_w_phl.c
 create mode 100644 tests/tcg/mips/mips64-dsp/preceq_w_phr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/precequ_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips64-dsp/precequ_ph_qbla.c
 create mode 100644 tests/tcg/mips/mips64-dsp/precequ_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/precequ_ph_qbra.c
 create mode 100644 tests/tcg/mips/mips64-dsp/preceu_ph_qbl.c
 create mode 100644 tests/tcg/mips/mips64-dsp/preceu_ph_qbla.c
 create mode 100644 tests/tcg/mips/mips64-dsp/preceu_ph_qbr.c
 create mode 100644 tests/tcg/mips/mips64-dsp/preceu_ph_qbra.c
 create mode 100644 tests/tcg/mips/mips64-dsp/precrq_ph_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/precrq_qb_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/precrq_rs_ph_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/precrqu_s_qb_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/printk.c
 create mode 100644 tests/tcg/mips/mips64-dsp/raddu_w_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/rddsp.c
 create mode 100644 tests/tcg/mips/mips64-dsp/repl_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/repl_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/replv_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/replv_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shilo.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shilov.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shll_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shll_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shll_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shll_s_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shllv_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shllv_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shllv_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shllv_s_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shra_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shra_r_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shra_r_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shrav_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shrav_r_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shrav_r_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shrl_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/shrlv_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/subq_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/subq_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dsp/subq_s_w.c
 create mode 100644 tests/tcg/mips/mips64-dsp/subu_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/subu_s_qb.c
 create mode 100644 tests/tcg/mips/mips64-dsp/wrdsp.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/Makefile
 create mode 100644 tests/tcg/mips/mips64-dspr2/Makefile-bk
 create mode 100644 tests/tcg/mips/mips64-dspr2/absq_s_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/addqh_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/addqh_r_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/addqh_r_w.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/addqh_w.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/addu_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/addu_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/adduh_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/adduh_r_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/alias.h
 create mode 100644 tests/tcg/mips/mips64-dspr2/append.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/balign.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/cmpgdu_eq_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/cmpgdu_le_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/cmpgdu_lt_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/dpa_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/dpaqx_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/dpaqx_sa_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/dpax_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/dps_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/dpsqx_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/dpsqx_sa_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/dpsx_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/head.S
 create mode 100644 tests/tcg/mips/mips64-dspr2/io.h
 create mode 100644 tests/tcg/mips/mips64-dspr2/macro.h
 create mode 100644 tests/tcg/mips/mips64-dspr2/mips_boot.lds
 create mode 100644 tests/tcg/mips/mips64-dspr2/mipsregs.h
 create mode 100644 tests/tcg/mips/mips64-dspr2/mul_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/mul_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/muleq_s_w_phl.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/mulq_rs_w.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/mulq_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/mulq_s_w.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/mulsa_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/mulsaq_s_w_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/precr_qb_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/precr_sra_ph_w.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/precr_sra_r_ph_w.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/prepend.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/printk.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/shra_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/shra_r_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/shrav_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/shrav_r_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/shrl_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/shrlv_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/subqh_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/subqh_r_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/subqh_r_w.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/subqh_w.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/subu_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/subu_s_ph.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/subuh_qb.c
 create mode 100644 tests/tcg/mips/mips64-dspr2/subuh_r_qb.c
Makefile.target +3 -0
index cff15f0..4e034f6 100644
@@ -101,6 +101,9 @@ libobj-$(TARGET_SPARC) += int32_helper.o
 libobj-$(TARGET_SPARC64) += int64_helper.o
 libobj-$(TARGET_UNICORE32) += cpu.o
 libobj-$(TARGET_ALPHA) += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
+ifeq ($(TARGET_BASE_ARCH), mips)
+libobj-y += dsp_helper.o
+endif
 
 libobj-y += disas.o
 libobj-$(CONFIG_TCI_DIS) += tci-dis.o
target-mips/dsp_helper.c new file +3844 -0

2,991 lines not on this page · raw message

target-mips/helper.h +153 -0

153 lines not on this page · raw message

target-mips/translate.c +1205 -24

1,229 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/Makefile new file +133 -0

133 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/absq_s_ph.c new file +30 -0
new file mode 100644
index 0000000..22db463

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/absq_s_w.c new file +37 -0
new file mode 100644
index 0000000..3f52a48

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/addq_ph.c new file +30 -0
new file mode 100644
index 0000000..2d9b6fc

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/addq_s_ph.c new file +30 -0
new file mode 100644
index 0000000..ace1ecd

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/addsc.c new file +30 -0
new file mode 100644
index 0000000..9ad974a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/addu_qb.c new file +30 -0
new file mode 100644
index 0000000..1b98e5e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/addu_s_qb.c new file +30 -0
new file mode 100644
index 0000000..46717ee

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/addwc.c new file +30 -0
new file mode 100644
index 0000000..d47ac65

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/bitrev.c new file +20 -0
new file mode 100644
index 0000000..04d8a38

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/bposge32.c new file +44 -0

44 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/cmp_eq_ph.c new file +35 -0
new file mode 100644
index 0000000..957bd88

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/cmp_le_ph.c new file +35 -0
new file mode 100644
index 0000000..356f156

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/cmp_lt_ph.c new file +35 -0
new file mode 100644
index 0000000..3fb4827

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/cmpgu_eq_qb.c new file +31 -0
new file mode 100644
index 0000000..2615c84

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/cmpgu_le_qb.c new file +31 -0
new file mode 100644
index 0000000..65d0813

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/cmpgu_lt_qb.c new file +31 -0
new file mode 100644
index 0000000..7dddad9

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/cmpu_eq_qb.c new file +35 -0
new file mode 100644
index 0000000..680f2a1

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/cmpu_le_qb.c new file +35 -0
new file mode 100644
index 0000000..43cfa50

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/cmpu_lt_qb.c new file +35 -0
new file mode 100644
index 0000000..074ca5b

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/dpaq_s_w_ph.c new file +31 -0
new file mode 100644
index 0000000..a6425b6

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/dpaq_sa_l_w.c new file +31 -0
new file mode 100644
index 0000000..02bac2a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/dpau_h_qbl.c new file +27 -0
new file mode 100644
index 0000000..6017b5e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/dpau_h_qbr.c new file +27 -0
new file mode 100644
index 0000000..e4abb2e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/dpsq_s_w_ph.c new file +27 -0
new file mode 100644
index 0000000..70ad443

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/dpsq_sa_l_w.c new file +31 -0
new file mode 100644
index 0000000..3d6b24c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/dpsu_h_qbl.c new file +27 -0
new file mode 100644
index 0000000..94e2bf6

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/dpsu_h_qbr.c new file +27 -0
new file mode 100644
index 0000000..a1e6635

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/extp.c new file +44 -0

44 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/extpdp.c new file +46 -0

46 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/extpdpv.c new file +47 -0

47 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/extpv.c new file +45 -0

45 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/extr_r_w.c new file +25 -0
new file mode 100644
index 0000000..570dfbd

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/extr_rs_w.c new file +25 -0
new file mode 100644
index 0000000..a0bf7b4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/extr_s_h.c new file +25 -0
new file mode 100644
index 0000000..c863f29

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/extr_w.c new file +25 -0
new file mode 100644
index 0000000..40994cb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/extrv_r_w.c new file +29 -0
new file mode 100644
index 0000000..43aba53

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/extrv_rs_w.c new file +29 -0
new file mode 100644
index 0000000..60e0d43

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/extrv_s_h.c new file +29 -0
new file mode 100644
index 0000000..c7f70e3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/extrv_w.c new file +29 -0
new file mode 100644
index 0000000..c63a25c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/insv.c new file +23 -0
new file mode 100644
index 0000000..7e3b047

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/lbux.c new file +23 -0
new file mode 100644
index 0000000..7e8ab9c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/lhx.c new file +23 -0
new file mode 100644
index 0000000..45edf19

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/lwx.c new file +23 -0
new file mode 100644
index 0000000..0f1b457

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/madd.c new file +31 -0
new file mode 100644
index 0000000..af4bfcf

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/maddu.c new file +31 -0
new file mode 100644
index 0000000..af4bfcf

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/main.c new file +6 -0
new file mode 100644
index 0000000..b296b20

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/maq_s_w_phl.c new file +31 -0
new file mode 100644
index 0000000..f5de818

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/maq_s_w_phr.c new file +31 -0
new file mode 100644
index 0000000..8336f00

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/maq_sa_w_phl.c new file +31 -0
new file mode 100644
index 0000000..35c5bfb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/maq_sa_w_phr.c new file +31 -0
new file mode 100644
index 0000000..45ba792

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/mfhi.c new file +21 -0
new file mode 100644
index 0000000..43a8066

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/mflo.c new file +21 -0
new file mode 100644
index 0000000..caeafdb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/modsub.c new file +30 -0
new file mode 100644
index 0000000..c294eeb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/msub.c new file +30 -0
new file mode 100644
index 0000000..5779e6f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/msubu.c new file +30 -0
new file mode 100644
index 0000000..e0f9b5a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/mthi.c new file +21 -0
new file mode 100644
index 0000000..43a8066

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/mthlip.c new file +34 -0
new file mode 100644
index 0000000..74e83bf

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/mtlo.c new file +21 -0
new file mode 100644
index 0000000..caeafdb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/muleq_s_w_phr.c new file +40 -0
new file mode 100644
index 0000000..8066d7d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/muleu_s_ph_qbl.c new file +25 -0
new file mode 100644
index 0000000..66a3828

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/muleu_s_ph_qbr.c new file +25 -0
new file mode 100644
index 0000000..4cc6c8f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/mulq_rs_ph.c new file +25 -0
new file mode 100644
index 0000000..c720603

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/mult.c new file +24 -0
new file mode 100644
index 0000000..15e6fde

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/multu.c new file +24 -0
new file mode 100644
index 0000000..15e6fde

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/packrl_ph.c new file +21 -0
new file mode 100644
index 0000000..1f8e699

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/pick_ph.c new file +23 -0
new file mode 100644
index 0000000..73342cb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/pick_qb.c new file +23 -0
new file mode 100644
index 0000000..052cc58

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/preceq_w_phl.c new file +20 -0
new file mode 100644
index 0000000..bf70bf7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/preceq_w_phr.c new file +20 -0
new file mode 100644
index 0000000..3f885ef

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/precequ_ph_qbl.c new file +20 -0
new file mode 100644
index 0000000..63b7a95

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/precequ_ph_qbla.c new file +20 -0
new file mode 100644
index 0000000..31627f0

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/precequ_ph_qbr.c new file +20 -0
new file mode 100644
index 0000000..b6f72d3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/precequ_ph_qbra.c new file +20 -0
new file mode 100644
index 0000000..4764fd0

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/preceu_ph_qbl.c new file +20 -0
new file mode 100644
index 0000000..fa95c26

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/preceu_ph_qbla.c new file +20 -0
new file mode 100644
index 0000000..021f21a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/preceu_ph_qbr.c new file +20 -0
new file mode 100644
index 0000000..03df18c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/preceu_ph_qbra.c new file +20 -0
new file mode 100644
index 0000000..6343276

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/precrq_ph_w.c new file +21 -0
new file mode 100644
index 0000000..25d45f1

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/precrq_qb_ph.c new file +21 -0
new file mode 100644
index 0000000..fe23acc

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/precrq_rs_ph_w.c new file +21 -0
new file mode 100644
index 0000000..87214b8

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/precrqu_s_qb_ph.c new file +21 -0
new file mode 100644
index 0000000..9a459cc

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/raddu_w_qb.c new file +20 -0
new file mode 100644
index 0000000..77a983c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/rddsp.c new file +54 -0

54 lines not on this page · raw message

tests/tcg/mips/mips32-dsp/repl_ph.c new file +23 -0
new file mode 100644
index 0000000..2107495

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/repl_qb.c new file +16 -0
new file mode 100644
index 0000000..6631393

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/replv_ph.c new file +19 -0
new file mode 100644
index 0000000..07fb15f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/replv_qb.c new file +19 -0
new file mode 100644
index 0000000..dd1271f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shilo.c new file +27 -0
new file mode 100644
index 0000000..b686616

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shilov.c new file +29 -0
new file mode 100644
index 0000000..f186032

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shll_ph.c new file +24 -0
new file mode 100644
index 0000000..b8f1ff5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shll_qb.c new file +23 -0
new file mode 100644
index 0000000..d79814c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shll_s_ph.c new file +24 -0
new file mode 100644
index 0000000..910fea3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shll_s_w.c new file +24 -0
new file mode 100644
index 0000000..c42c168

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shllv_ph.c new file +25 -0
new file mode 100644
index 0000000..b0fcae8

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shllv_qb.c new file +24 -0
new file mode 100644
index 0000000..0bcc24c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shllv_s_ph.c new file +25 -0
new file mode 100644
index 0000000..a6d61b1

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shllv_s_w.c new file +25 -0
new file mode 100644
index 0000000..69c896d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shra_ph.c new file +20 -0
new file mode 100644
index 0000000..be7711a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shra_r_ph.c new file +20 -0
new file mode 100644
index 0000000..bb64683

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shra_r_w.c new file +20 -0
new file mode 100644
index 0000000..b94748c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shrav_ph.c new file +21 -0
new file mode 100644
index 0000000..a4db736

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shrav_r_ph.c new file +21 -0
new file mode 100644
index 0000000..f6d3c70

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shrav_r_w.c new file +21 -0
new file mode 100644
index 0000000..1841381

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shrl_qb.c new file +20 -0
new file mode 100644
index 0000000..ccc991f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/shrlv_qb.c new file +21 -0
new file mode 100644
index 0000000..4b0a826

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/subq_ph.c new file +25 -0
new file mode 100644
index 0000000..e9d349a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/subq_s_ph.c new file +25 -0
new file mode 100644
index 0000000..56fed9b

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/subq_s_w.c new file +25 -0
new file mode 100644
index 0000000..f44f36e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/subu_qb.c new file +25 -0
new file mode 100644
index 0000000..4209096

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/subu_s_qb.c new file +25 -0
new file mode 100644
index 0000000..3d65053

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dsp/wrdsp.c new file +54 -0

54 lines not on this page · raw message

tests/tcg/mips/mips32-dspr2/Makefile new file +71 -0

71 lines not on this page · raw message

tests/tcg/mips/mips32-dspr2/absq_s_qb.c new file +35 -0
new file mode 100644
index 0000000..af4683f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addqh_ph.c new file +30 -0
new file mode 100644
index 0000000..11f8597

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addqh_r_ph.c new file +30 -0
new file mode 100644
index 0000000..ab91c0f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addqh_r_w.c new file +34 -0
new file mode 100644
index 0000000..75a75c5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addqh_w.c new file +34 -0
new file mode 100644
index 0000000..de6926e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addu_ph.c new file +30 -0
new file mode 100644
index 0000000..01efb3d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/addu_s_ph.c new file +30 -0
new file mode 100644
index 0000000..51cc2ac

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/adduh_qb.c new file +30 -0
new file mode 100644
index 0000000..a1f5d63

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/adduh_r_qb.c new file +30 -0
new file mode 100644
index 0000000..81e98c1

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/append.c new file +30 -0
new file mode 100644
index 0000000..9a91e16

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/balign.c new file +30 -0
new file mode 100644
index 0000000..537cf04

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/cmpgdu_eq_qb.c new file +37 -0
new file mode 100644
index 0000000..fccd975

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/cmpgdu_le_qb.c new file +37 -0
new file mode 100644
index 0000000..a0ecdca

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/cmpgdu_lt_qb.c new file +37 -0
new file mode 100644
index 0000000..dba99e3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpa_w_ph.c new file +27 -0
new file mode 100644
index 0000000..d2bf3be

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpaqx_s_w_ph.c new file +57 -0

57 lines not on this page · raw message

tests/tcg/mips/mips32-dspr2/dpaqx_sa_w_ph.c new file +30 -0
new file mode 100644
index 0000000..17182b5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpax_w_ph.c new file +27 -0
new file mode 100644
index 0000000..f756997

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dps_w_ph.c new file +27 -0
new file mode 100644
index 0000000..8303643

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpsqx_s_w_ph.c new file +31 -0
new file mode 100644
index 0000000..0f26071

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpsqx_sa_w_ph.c new file +31 -0
new file mode 100644
index 0000000..4688caf

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/dpsx_w_ph.c new file +27 -0
new file mode 100644
index 0000000..6db59a4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mul_ph.c new file +25 -0
new file mode 100644
index 0000000..fc91f5d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mul_s_ph.c new file +25 -0
new file mode 100644
index 0000000..949ea5e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/muleq_s_w_phl.c new file +40 -0
new file mode 100644
index 0000000..4e3262f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulq_rs_w.c new file +36 -0
new file mode 100644
index 0000000..669405f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulq_s_ph.c new file +25 -0
new file mode 100644
index 0000000..d0f7674

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulq_s_w.c new file +36 -0
new file mode 100644
index 0000000..df148b7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c new file +29 -0
new file mode 100644
index 0000000..a694093

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/mulsaq_s_w_ph.c new file +29 -0
new file mode 100644
index 0000000..06c91a4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/precr_qb_ph.c new file +21 -0
new file mode 100644
index 0000000..3a2b3fd

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/precr_sra_ph_w.c new file +32 -0
new file mode 100644
index 0000000..5c9baab

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/precr_sra_r_ph_w.c new file +32 -0
new file mode 100644
index 0000000..6474a10

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/prepend.c new file +30 -0
new file mode 100644
index 0000000..f6bcd47

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shra_qb.c new file +30 -0
new file mode 100644
index 0000000..48193de

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shra_r_qb.c new file +30 -0
new file mode 100644
index 0000000..29afa0e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shrav_qb.c new file +32 -0
new file mode 100644
index 0000000..b21e1b7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shrav_r_qb.c new file +32 -0
new file mode 100644
index 0000000..9ea8aa0

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shrl_ph.c new file +20 -0
new file mode 100644
index 0000000..724b9a7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/shrlv_ph.c new file +21 -0
new file mode 100644
index 0000000..ac79aa6

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subqh_ph.c new file +21 -0
new file mode 100644
index 0000000..dbc0967

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subqh_r_ph.c new file +21 -0
new file mode 100644
index 0000000..24ef0f1

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subqh_r_w.c new file +21 -0
new file mode 100644
index 0000000..d460f86

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subqh_w.c new file +21 -0
new file mode 100644
index 0000000..42be3de

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subu_ph.c new file +25 -0
new file mode 100644
index 0000000..b9cf138

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subu_s_ph.c new file +25 -0
new file mode 100644
index 0000000..a3b034f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subuh_qb.c new file +21 -0
new file mode 100644
index 0000000..92cfc76

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips32-dspr2/subuh_r_qb.c new file +21 -0
new file mode 100644
index 0000000..d9e6f2f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/Makefile new file +150 -0

150 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/absq_s_ph.c new file +35 -0
new file mode 100644
index 0000000..5c83272

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/absq_s_w.c new file +45 -0

45 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/addq_ph.c new file +35 -0
new file mode 100644
index 0000000..1f7abb7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/addq_s_ph.c new file +35 -0
new file mode 100644
index 0000000..6d64f2f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/addsc.c new file +35 -0
new file mode 100644
index 0000000..89aad0a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/addu_qb.c new file +35 -0
new file mode 100644
index 0000000..91af96a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/addu_s_qb.c new file +29 -0
new file mode 100644
index 0000000..2c0fc1f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/addwc.c new file +35 -0
new file mode 100644
index 0000000..729ad08

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/alias.h new file +39 -0
new file mode 100644
index 0000000..64d3efa

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/bitrev.c new file +22 -0
new file mode 100644
index 0000000..f5b8626

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/bposge32.c new file +46 -0

46 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/cmp_eq_ph.c new file +40 -0
new file mode 100644
index 0000000..ac610d9

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/cmp_le_ph.c new file +38 -0
new file mode 100644
index 0000000..9d0a191

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/cmp_lt_ph.c new file +39 -0
new file mode 100644
index 0000000..846affa

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/cmpgu_eq_qb.c new file +36 -0
new file mode 100644
index 0000000..c604a6c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/cmpgu_le_qb.c new file +35 -0
new file mode 100644
index 0000000..32ecee8

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/cmpgu_lt_qb.c new file +36 -0
new file mode 100644
index 0000000..964d0a2

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/cmpu_eq_qb.c new file +40 -0
new file mode 100644
index 0000000..28add6d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/cmpu_le_qb.c new file +39 -0
new file mode 100644
index 0000000..d1b25aa

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/cmpu_lt_qb.c new file +40 -0
new file mode 100644
index 0000000..acbdc1e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/dpaq_s_w_ph.c new file +31 -0
new file mode 100644
index 0000000..164b320

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/dpaq_sa_l_w.c new file +31 -0
new file mode 100644
index 0000000..f91648d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/dpau_h_qbl.c new file +28 -0
new file mode 100644
index 0000000..137db6e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/dpau_h_qbr.c new file +28 -0
new file mode 100644
index 0000000..2ce5e70

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/dpsq_s_w_ph.c new file +28 -0
new file mode 100644
index 0000000..77f50ff

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/dpsq_sa_l_w.c new file +31 -0
new file mode 100644
index 0000000..8fada85

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/dpsu_h_qbl.c new file +28 -0
new file mode 100644
index 0000000..1c9c76d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/dpsu_h_qbr.c new file +28 -0
new file mode 100644
index 0000000..cfbb3d3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/extp.c new file +48 -0

48 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/extpdp.c new file +49 -0

49 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/extpdpv.c new file +50 -0

50 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/extpv.c new file +49 -0

49 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/extr_r_w.c new file +26 -0
new file mode 100644
index 0000000..ee5511d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/extr_rs_w.c new file +26 -0
new file mode 100644
index 0000000..2653c4a

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/extr_s_h.c new file +26 -0
new file mode 100644
index 0000000..0c961c2

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/extr_w.c new file +26 -0
new file mode 100644
index 0000000..49728a6

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/extrv_r_w.c new file +30 -0
new file mode 100644
index 0000000..3840455

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/extrv_rs_w.c new file +30 -0
new file mode 100644
index 0000000..19a9425

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/extrv_s_h.c new file +30 -0
new file mode 100644
index 0000000..aff0120

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/extrv_w.c new file +30 -0
new file mode 100644
index 0000000..dfb2b68

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/head.S new file +16 -0
new file mode 100644
index 0000000..46ba0de

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/insv.c new file +25 -0
new file mode 100644
index 0000000..ee27058

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/io.h new file +6 -0
new file mode 100644
index 0000000..ea499d4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/lbux.c new file +25 -0
new file mode 100644
index 0000000..f170ec3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/lhx.c new file +25 -0
new file mode 100644
index 0000000..95c5657

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/lwx.c new file +25 -0
new file mode 100644
index 0000000..89a919e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/macro.h new file +18 -0
new file mode 100644
index 0000000..ed4d572

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/madd.c new file +32 -0
new file mode 100644
index 0000000..90a6591

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/maddu.c new file +32 -0
new file mode 100644
index 0000000..e537daa

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/main.c new file +6 -0
new file mode 100644
index 0000000..b296b20

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/maq_s_w_phl.c new file +32 -0
new file mode 100644
index 0000000..04bafb7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/maq_s_w_phr.c new file +32 -0
new file mode 100644
index 0000000..5d00579

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/maq_sa_w_phl.c new file +32 -0
new file mode 100644
index 0000000..8f54f68

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/maq_sa_w_phr.c new file +32 -0
new file mode 100644
index 0000000..f7cea21

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mfhi.c new file +23 -0
new file mode 100644
index 0000000..2e4bf8e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mflo.c new file +23 -0
new file mode 100644
index 0000000..e350d18

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mips_boot.lds new file +11 -0
new file mode 100644
index 0000000..ffd1992

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mipsregs.h new file +527 -0

527 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/modsub.c new file +35 -0
new file mode 100644
index 0000000..a47dcd6

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/msub.c new file +31 -0
new file mode 100644
index 0000000..0d86f83

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/msubu.c new file +31 -0
new file mode 100644
index 0000000..a1544ab

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mthi.c new file +23 -0
new file mode 100644
index 0000000..f14dc9c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mthlip.c new file +34 -0
new file mode 100644
index 0000000..f47b401

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mtlo.c new file +23 -0
new file mode 100644
index 0000000..fe6e5be

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/muleq_s_w_phr.c new file +43 -0

43 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/muleu_s_ph_qbl.c new file +26 -0
new file mode 100644
index 0000000..6383fdb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/muleu_s_ph_qbr.c new file +26 -0
new file mode 100644
index 0000000..d503e0d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mulq_rs_ph.c new file +26 -0
new file mode 100644
index 0000000..6e746dc

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/mult.c new file +25 -0
new file mode 100644
index 0000000..ae0fc6e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/multu.c new file +25 -0
new file mode 100644
index 0000000..9643ebb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/packrl_ph.c new file +23 -0
new file mode 100644
index 0000000..49e79a4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/pick_ph.c new file +25 -0
new file mode 100644
index 0000000..61f4b72

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/pick_qb.c new file +25 -0
new file mode 100644
index 0000000..773d339

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/preceq_w_phl.c new file +22 -0
new file mode 100644
index 0000000..2d4b80e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/preceq_w_phr.c new file +22 -0
new file mode 100644
index 0000000..177de25

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/precequ_ph_qbl.c new file +22 -0
new file mode 100644
index 0000000..2bd4338

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/precequ_ph_qbla.c new file +22 -0
new file mode 100644
index 0000000..3cc7d95

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/precequ_ph_qbr.c new file +22 -0
new file mode 100644
index 0000000..b631272

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/precequ_ph_qbra.c new file +22 -0
new file mode 100644
index 0000000..2900977

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/preceu_ph_qbl.c new file +22 -0
new file mode 100644
index 0000000..5600749

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/preceu_ph_qbla.c new file +22 -0
new file mode 100644
index 0000000..f7fed6f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/preceu_ph_qbr.c new file +22 -0
new file mode 100644
index 0000000..13aee9d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/preceu_ph_qbra.c new file +22 -0
new file mode 100644
index 0000000..6a352a3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/precrq_ph_w.c new file +23 -0
new file mode 100644
index 0000000..3bf5f11

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/precrq_qb_ph.c new file +23 -0
new file mode 100644
index 0000000..6347ea8

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/precrq_rs_ph_w.c new file +23 -0
new file mode 100644
index 0000000..d462d56

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/precrqu_s_qb_ph.c new file +23 -0
new file mode 100644
index 0000000..eccabff

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/printk.c new file +125 -0

125 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/raddu_w_qb.c new file +22 -0
new file mode 100644
index 0000000..c02512f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/rddsp.c new file +52 -0

52 lines not on this page · raw message

tests/tcg/mips/mips64-dsp/repl_ph.c new file +28 -0
new file mode 100644
index 0000000..1ad53f8

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/repl_qb.c new file +18 -0
new file mode 100644
index 0000000..22b1364

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/replv_ph.c new file +21 -0
new file mode 100644
index 0000000..5ed99b4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/replv_qb.c new file +21 -0
new file mode 100644
index 0000000..7da6cb4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shilo.c new file +28 -0
new file mode 100644
index 0000000..dbe6b38

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shilov.c new file +30 -0
new file mode 100644
index 0000000..1c3430d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shll_ph.c new file +25 -0
new file mode 100644
index 0000000..392c419

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shll_qb.c new file +25 -0
new file mode 100644
index 0000000..76152f7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shll_s_ph.c new file +25 -0
new file mode 100644
index 0000000..ef1b997

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shll_s_w.c new file +25 -0
new file mode 100644
index 0000000..b69b889

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shllv_ph.c new file +26 -0
new file mode 100644
index 0000000..dbe17e4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shllv_qb.c new file +26 -0
new file mode 100644
index 0000000..cdf4a8b

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shllv_s_ph.c new file +26 -0
new file mode 100644
index 0000000..c5fdfde

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shllv_s_w.c new file +26 -0
new file mode 100644
index 0000000..96ad49f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shra_ph.c new file +22 -0
new file mode 100644
index 0000000..2274dbd

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shra_r_ph.c new file +22 -0
new file mode 100644
index 0000000..021c109

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shra_r_w.c new file +22 -0
new file mode 100644
index 0000000..ba6b03d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shrav_ph.c new file +23 -0
new file mode 100644
index 0000000..05b9c81

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shrav_r_ph.c new file +23 -0
new file mode 100644
index 0000000..093b984

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shrav_r_w.c new file +23 -0
new file mode 100644
index 0000000..30b2948

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shrl_qb.c new file +22 -0
new file mode 100644
index 0000000..0d3c980

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/shrlv_qb.c new file +23 -0
new file mode 100644
index 0000000..b23d90e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/subq_ph.c new file +26 -0
new file mode 100644
index 0000000..487a7c5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/subq_s_ph.c new file +26 -0
new file mode 100644
index 0000000..7259d96

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/subq_s_w.c new file +26 -0
new file mode 100644
index 0000000..b5a8fc2

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/subu_qb.c new file +26 -0
new file mode 100644
index 0000000..3fd15b3

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/subu_s_qb.c new file +26 -0
new file mode 100644
index 0000000..c3a34e7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dsp/wrdsp.c new file +47 -0

47 lines not on this page · raw message

tests/tcg/mips/mips64-dspr2/Makefile new file +88 -0

88 lines not on this page · raw message

tests/tcg/mips/mips64-dspr2/Makefile-bk new file +71 -0

71 lines not on this page · raw message

tests/tcg/mips/mips64-dspr2/absq_s_qb.c new file +35 -0
new file mode 100644
index 0000000..a35dc65

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/addqh_ph.c new file +30 -0
new file mode 100644
index 0000000..48f2fbb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/addqh_r_ph.c new file +34 -0
new file mode 100644
index 0000000..b2665b9

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/addqh_r_w.c new file +34 -0
new file mode 100644
index 0000000..8dda1a5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/addqh_w.c new file +39 -0
new file mode 100644
index 0000000..f312d74

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/addu_ph.c new file +31 -0
new file mode 100644
index 0000000..e22c1d6

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/addu_s_ph.c new file +31 -0
new file mode 100644
index 0000000..36fcdce

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/adduh_qb.c new file +31 -0
new file mode 100644
index 0000000..5284973

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/adduh_r_qb.c new file +31 -0
new file mode 100644
index 0000000..3a37af5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/alias.h new file +39 -0
new file mode 100644
index 0000000..64d3efa

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/append.c new file +31 -0
new file mode 100644
index 0000000..9a96d21

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/balign.c new file +31 -0
new file mode 100644
index 0000000..c379ccc

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/cmpgdu_eq_qb.c new file +41 -0

41 lines not on this page · raw message

tests/tcg/mips/mips64-dspr2/cmpgdu_le_qb.c new file +40 -0
new file mode 100644
index 0000000..c137c1f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/cmpgdu_lt_qb.c new file +40 -0
new file mode 100644
index 0000000..2845048

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/dpa_w_ph.c new file +28 -0
new file mode 100644
index 0000000..884c723

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/dpaqx_s_w_ph.c new file +62 -0

62 lines not on this page · raw message

tests/tcg/mips/mips64-dspr2/dpaqx_sa_w_ph.c new file +32 -0
new file mode 100644
index 0000000..c63a4fd

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/dpax_w_ph.c new file +32 -0
new file mode 100644
index 0000000..3671f6b

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/dps_w_ph.c new file +26 -0
new file mode 100644
index 0000000..7d2e597

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/dpsqx_s_w_ph.c new file +31 -0
new file mode 100644
index 0000000..62c8e6d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/dpsqx_sa_w_ph.c new file +27 -0
new file mode 100644
index 0000000..54edb49

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/dpsx_w_ph.c new file +25 -0
new file mode 100644
index 0000000..a251d43

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/head.S new file +16 -0
new file mode 100644
index 0000000..46ba0de

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/io.h new file +6 -0
new file mode 100644
index 0000000..ea499d4

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/macro.h new file +18 -0
new file mode 100644
index 0000000..ed4d572

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/mips_boot.lds new file +11 -0
new file mode 100644
index 0000000..ffd1992

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/mipsregs.h new file +527 -0

527 lines not on this page · raw message

tests/tcg/mips/mips64-dspr2/mul_ph.c new file +26 -0
new file mode 100644
index 0000000..be0a55d

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/mul_s_ph.c new file +23 -0
new file mode 100644
index 0000000..f56f18e

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/muleq_s_w_phl.c new file +42 -0

42 lines not on this page · raw message

tests/tcg/mips/mips64-dspr2/mulq_rs_w.c new file +36 -0
new file mode 100644
index 0000000..3e0f8cf

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/mulq_s_ph.c new file +23 -0
new file mode 100644
index 0000000..e5b2d1b

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/mulq_s_w.c new file +36 -0
new file mode 100644
index 0000000..b71e96c

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/mulsa_w_ph.c new file +27 -0
new file mode 100644
index 0000000..3c155bc

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/mulsaq_s_w_ph.c new file +28 -0
new file mode 100644
index 0000000..fc3ff44

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/precr_qb_ph.c new file +21 -0
new file mode 100644
index 0000000..f98cdd9

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/precr_sra_ph_w.c new file +33 -0
new file mode 100644
index 0000000..24279b2

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/precr_sra_r_ph_w.c new file +33 -0
new file mode 100644
index 0000000..afbfcbd

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/prepend.c new file +31 -0
new file mode 100644
index 0000000..bc2d117

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/printk.c new file +125 -0

125 lines not on this page · raw message

tests/tcg/mips/mips64-dspr2/shra_qb.c new file +31 -0
new file mode 100644
index 0000000..cd48abc

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/shra_r_qb.c new file +35 -0
new file mode 100644
index 0000000..cc66641

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/shrav_qb.c new file +33 -0
new file mode 100644
index 0000000..196e038

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/shrav_r_qb.c new file +33 -0
new file mode 100644
index 0000000..1e9bb53

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/shrl_ph.c new file +20 -0
new file mode 100644
index 0000000..8d6efb1

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/shrlv_ph.c new file +20 -0
new file mode 100644
index 0000000..38dc0fb

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/subqh_ph.c new file +21 -0
new file mode 100644
index 0000000..d5af172

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/subqh_r_ph.c new file +21 -0
new file mode 100644
index 0000000..9bac9c7

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/subqh_r_w.c new file +21 -0
new file mode 100644
index 0000000..248935f

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/subqh_w.c new file +21 -0
new file mode 100644
index 0000000..556b5cd

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/subu_ph.c new file +24 -0
new file mode 100644
index 0000000..7bb881b

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/subu_s_ph.c new file +23 -0
new file mode 100644
index 0000000..b9df7d8

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/subuh_qb.c new file +23 -0
new file mode 100644
index 0000000..a1fb0e5

Lines of this file are not shown. View the raw message.

tests/tcg/mips/mips64-dspr2/subuh_r_qb.c new file +21 -0
new file mode 100644
index 0000000..44f80bc

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.5.4

Part of the diff is not shown here. View the raw message.